The short story in ruby is:
a = 13.2471*(2.718 ** (17.67*t/(t+243.5)))*r/(273.15+t)
And in C:
float a = (6.112 * pow(2.71828,((17.67 * t)/(t + 243.5))) * r * 2.1674) / (273.15 + t);
To integrate my netatmo weather station with custom esp8266 based weather sensors i decided to setup a TIG stack.
The components of the stack are
- Telegraf – collects data from different sources and pushes them to influxdb
- Influxdb – a metric database
- Grafana – a visualization and dashboard application
The netatmo weather stations have no direct interface to capture the collected data, but there is an API server provided by Netatmo to retrieve data from it.
To access the API you must log into the developer website with your netatmo account and register an application:
After you created an application on their website an client_id and client_secret is assigned to this application. You need this information together with your account credentials to access your stations data within the API.
I wrote an integration script to read the data from the API and output it as JSON suitable for telegrafs exec input:
The script could be used directly or as a docker container:
See the github page or docker hub page for usage instruction.