Weatherflow Tempest & HomeAssistant

Integrating the Tempest into HomeAssistant (HA) using NodeRed

Having a private weather station is a nice resource for providing data to a home automation system or alerting neighbors when hazardous conditions may arise. I already had setup a weather watchdog for alerting neighbors, displaying it on my home brew weather tube, and now I wanted to start sending the data to my HomeAssistant system so that I could also display it on the dashboard, but also to provide weather awareness to certain home automation processes and decisions. By doing this, I am now making my smart home weather aware.

There isn’t a lot of documentation on connecting the Tempest data feed to HA, so I joined the digiblurDIY discord and found help in their #node-red channel and started asking around for pointers. It just so happened that another person wanted to do the same thing. This other person sent me his NodeRed flow json, and I imported it to my NodeRed system and made some minor modifications. I then took the modified flow and attached it to the Payload output node that fed my weather watchdog notifier. This allowed me to use the same data stream and run some conversions and processing to allow each data point to be sent over my MQTT broker and be discovered by HA. Nothing magically appeared on the HA dashboard, but it did create the various entities for each data point that was sent over. I could then build a dashboard card and display the realtime data on my HA dashboards. The new entities can also now be used in new and existing automations within HA. In true open source spirit, and because I am grateful for the help of others in the community, I have published my NodeRed flow so that others can also learn and re-use the flow for their projects. You can get it here.

To keep API requests to a minimum, I do buffer the json data stream on my own webserver, and my NodeRed flow grabs the data from there. This is a good idea so that load on Weatherflow’s systems can be kept to a minimum. Here’s how I did that on the webserver machine: (by installing this cron job)

*/1 * * * *   root    /usr/bin/curl "https://swd.weatherflow.com/swd/rest/observations/station/<your station id>?token=<your API token>" > /var/www/tools/observations.json

The file observations.json is then served out to any process that can do a simple GET or cURL request. The above cron job updates the file once per minute from Weatherflow’s network, where my weather station reports continually. You can use the same process by just replacing your weather station ID and API key on any webserver you want to use for data buffering. Now on my Home Assistant dashboard, I can also see the data in real time:

In addition to Home Assistant getting this data, my Weather Watchdog notification service also functions to notify folks who are subscribed via pushover. Subscribers can get notifications via their mobile, or smart watch:

Leave a Reply

Your email address will not be published. Required fields are marked *