Unfortunately I have not fixed the autentication process after Netatmo changed it (see the open issue. Feel free to pull request a solution), so at the moment this container will not work.
This should not be super hard to fix, but I'm prioritizing another project (rewriting this whole thing in php+powershell) at the moment. If someone want to fix this issue, the trick is to make the script use a access token directly (can be generated in dev.netatmo.com).
I have now rewritten the whole thing in Powershell/PHP: https://github.com/turbosnute/netatmo-influxdb
Fetch data from the Netatmo API and place it in your influxdb. Based on Manabuishii's docker-netatmo-influxdb-python and netatmo2influxdb.py.
- Go to: https://dev.netatmo.com/
- Log in.
- Go to "My Apps"
- Click "Create"
- Write in the info...
- Click "Save"
- See your client id and client secret.
If you don't have a Influxdb server yet you can run one in Docker:
$ docker run -d -p 8086:8086 \
-v influxdb:/var/lib/influxdb \
influxdb
$ curl -G http://<INFLUXDB_SERVER>:8086/query --data-urlencode "q=CREATE DATABASE netatmo"
docker run -d -p 8086:8086 \
-v influxdb:/var/lib/influxdb \
influxdb /bin/bash
Container#> influx
> CREATE DATABASE netatmo
> exit
$ docker run -d \
-e NETATMO_CLIENT_ID="<NETATMO CLIENT ID>" \
-e NETATMO_CLIENT_SECRET="<NETATMO CLIENT SECRET>" \
-e NETATMO_USERNAME="<NETATMO USERNAME>" \
-e NETATMO_PASSWORD="<NETATMO PASSWORD>" \
-e INFLUXDB_HOST="<INFLUXDB SERVER>" \
-e INFLUXDB_PORT="8086" \
-e INFLUXDB_USERNAME="" \
-e INFLUXDB_PASSWORD="" \
-e INFLUXDB_DATABASE="netatmo" \
--name "netatmo-influxdb" \
turbosnute/netatmo-influxdb:latest
To get more debug data add:
-e DEBUG="true"
If you want to get data about air quality in your neighborhood from Norsk institutt for luftforskning (nilu.no). Add the following variables and change the coordinates to match your location:
-e AIRQUALITY_LATITUDE="63.426916" \
-e AIRQUALITY_LONGITUDE="10.396859" \