This project will integrate Netatmo data with a Weather Underground station.
Netatmo uses an OAuth flow with access and refresh tokens, which expire after some time. You will need to generate these and add them as environment variables for startup. The Docker container will keep up with rotating them going forward, storing them in a file under /temp. If you want the config to persist across docker container recreation, map the /temp folder.
Follow these steps to generate the tokens:
- Login to https://dev.netatmo.com/apps and create an app
- Click on the app and scroll down to the Token Generator field
- In the Scopes drop-down, choose "read_station" and click "Generate Token." Follow the prompts, and you should end up with Access Token and Refresh Token values.
- Install nodejs
git clone https://github.com/brbeaird/netatmo-wunderground-agent.git
npm install
- Open server.js in a text editor and enter in your Netatmo and Weather Underground credentials (these are never shared or stored anywhere outside of your local machine)
node server.js
I recommend using pm2 to run the agent in the background and automatically restart it if it crashes for some reason. Steps for that:
- Stop the agent if it's already running.
npm install -g pm2
pm2 start ecosystem.config.js
- This will automatically spin up an instance of the agent handled by pm2.
- For more info on pm2 commands, check out http://pm2.keymetrics.io/docs/usage/pm2-doc-single-page/
Docker: https://hub.docker.com/repository/docker/brbeaird/netatmo-wunderground-agent