Docker image to fetch data from the Netatmo API and place it in your influxdb. This project is based on the following projects:
-
Initiator of netatmo-api-python with great documentation lnetatmo.
-
turbosnute's netatmo-influxdb
-
Manabuishii's docker-netatmo-influxdb-python
-
dbsqp's fork from turbosnute with Influx DB v2 fork to store data in Influx v2
-
created new Docker file with new base image, new Python version and latest lnetatmo version
-
fixed lnetatmo module to report module data from default station
-
fixed "netatmo2influxdb.py" script to support insecure Influx connections
-
modified "netatmo2influxdb.py" script to use json file that stores the netatmo authentication tokens. The file must be writeable. The refresh token will be updated by the latest lnetatmo module after each request. This is due to breaking change in the Netatmo API.
- Go to: https://dev.netatmo.com/
- Log in.
- Go to "My Apps"
- Click "Create"
- Fill out info...
- Click "Save"
- Get your client id and client secret
- Generate token with scope read_station
- Get your refresh token
Setup InfluxDBv2, create bucket and create a token with write permissions for said bucket.
Newer Ubuntu base image, latest lnetatmo module with modifications and enhanced netatmo2influxdb.py script to use oauth using a credential file for clientID, client Token and refresh token.
https://hub.docker.com/repository/docker/dbsqp/netatmo-influxdbv2
docker run -d \
-v /config/netatmo/.netatmo.credentials:/netatmo/.netatmo.credentials \
-e INFLUXDB2_HOST="influxdb" \
-e INFLUXDB2_PORT="8086" \
-e INFLUXDB2_ORG="Home" \
-e INFLUXDB2_TOKEN="InfluxDbToken" \
-e INFLUXDB2_BUCKET="netatmo" \
-e INFLUXDB2_SSL="True" \
-e INFLUXDB2_SSL_VERIFY="False" \
-e DEBUG="true" \
--network "iot" \
--name "netatmo" \
netatmo:latest
-e INFLUXDB2_SSL="true"
-e INFLUXDB2_SSL_VERIFY="TRUE"
To report out further details in the log enable debug:
-e DEBUG="true"
Updated for lnetatmo oauth.