Code Monkey home page Code Monkey logo

docker-telegraf-netatmo's Introduction

Netatmo script for telegraf

This repository contains a script for retrieving data of a netatmo weather station for use with telegraf.

First obtain API keys from the Netatmo developmer website:

https://dev.netatmo.com/

Dependencies

The script requires ruby 2.0 or newer.

Usage

Usage: netatmo [options]
    -c, --config=PATH                Path to configuration file

Example

Here is an example what data is read from the station (with one outdoor sensor):

{
  "station": {
    "Innenraum": {
      "wifi_status": 65,
      "Temperature": 21.9,
      "CO2": 1246,
      "Humidity": 62,
      "Noise": 37,
      "Pressure": 1010.2,
      "AbsolutePressure": 975.4,
      "AbsoluteHumidity": 11.96
    },
    "Aussenraum": {
      "battery_percent": 45,
      "rf_status": 74,
      "Temperature": 15.8,
      "Humidity": 100,
      "AbsoluteHumidity": 13.45
    }
  }
}

Or with include_station_name: false:

{
  "Innenraum": {
    "wifi_status": 66,
    "Temperature": 21.8,
    "CO2": 1242,
    "Humidity": 62,
    "Noise": 47,
    "Pressure": 1010,
    "AbsolutePressure": 975.2,
    "AbsoluteHumidity": 11.89
  },
  "Aussenraum": {
    "battery_percent": 45,
    "rf_status": 74,
    "Temperature": 15.6,
    "Humidity": 100,
    "AbsoluteHumidity": 13.29
  }
}

The AbsoluteHumidity values are calculated by the script.

Configuration

The script reads credentials from the /etc/netatmo.yml configuration file:

---
client_id: <hex-value>
client_secret: <hex-value>
refresh_token: <token generated on website>
device_id: <station MAC>
# include_station_name: false # returns stations data on root level

Telegraf configuration

You need to configure a exec input in your telegraf.conf:

[[outputs.influxdb]]
  urls = ["http://influxdb:8086"]
  database = "telegraf"

[[inputs.exec]]
  commands = ["/usr/local/bin/netatmo"]
  interval = "10m"
  timeout = "15s"
  data_format = "json"
  name_suffix = "_netatmo"

docker-telegraf-netatmo's People

Contributors

benningm avatar to-ha avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.