WeatherFlow Smart Weather Station via UDP

weatherflow
I finally managed to put together a Custom Component that can read Weather data from a WeatherFlow Smart Home Weather station using the UDP API that this station exposes. This means that everything is running on the local network and there is no need to access anything outside Home Assistant.

For people owning such a Weather Station, you can get realtime weather data that is updated every minute for most values and every 3 seconds for Wind Speed and Wind Bearing.

Output is a set of sensors all prefixed with smartweatherudp. and where most of them are direct readings from the weather station, some of them are calculated values based on formulas and data from the station.

It has been running on my test system now for several weeks, and even though it is a continues loop in the background, I have not noticed a big spike in load on my system, so hopefully that also applies for you.

I am not a programmer by trade, so I had to learn Python, by looking at what others did, and then adapt it to my needs, so please bear with me if the code is not pretty, but at least it works on my system.
Looking forward to feedback and suggestions from the community.

You find the source and instructions how to install on Github

I have also made a more extensive version that uses the REST API and the WeatherFlow Smart Weather hardware. For this Component look here: SmartWeather - Get local weather data combined with Dark Sky Forecast

Example of some of the sensors created by the system

6 Likes

Great work, i was already using your API version but will switch to this one. I will test this out and come back with feedback. Are you adding a tip option somewhere to reward your hard work?

Edit:
Question 1:
Does the UDP version not combine darksky weather with the Weatherflow data just like the API version?

Question 2:
Also no binary sensors like freezing/lightning/raining?

Are you going to add above just like with the API or better remove option 1 from code and change option 2 to template sensors?

Edit:
Got an error, think something in the mapping isn’t going right but will look into it tomorrow (it’s 23:32 here :stuck_out_tongue: )

My config:
#**********************************************************
#* Custom Components
#**********************************************************
#https://github.com/briis/smartweather --> Changed to https://github.com/briis/smartweatherudp

  • platform: smartweatherudp
    #wind_unit: kmh
    monitored_conditions:
    • temperature
    • feels_like_temperature
    • heat_index
    • wind_chill
    • dewpoint
    • wind_speed
    • wind_gust
    • wind_lull
    • wind_bearing
    • wind_direction
    • precipitation
    • precipitation_rate
    • precipitation_last_1hr
    • precipitation_last_24hr
    • precipitation_yesterday
    • humidity
    • pressure
    • uv
    • solar_radiation
    • illuminance
    • lightning_count
    • airbattery
    • skybattery

Error:

Log Details (ERROR)

Tue Apr 16 2019 23:28:32 GMT+0200 (Midden-Europese zomertijd)

Invalid config for [sensor.smartweatherudp]: value is not allowed @ data[‘monitored_conditions’][12]. Got ‘precipitation_last_1hr’ value is not allowed @ data[‘monitored_conditions’][13]. Got ‘precipitation_last_24hr’ value is not allowed @ data[‘monitored_conditions’][14]. Got ‘precipitation_yesterday’ value is not allowed @ data[‘monitored_conditions’][1]. Got ‘feels_like_temperature’. (See /config/components/sensors/custom_components.yaml, line 4). Please check the docs at https://home-assistant.io/components/sensor.smartweatherudp/

Hi @lubbertkramer, unfortunately I did an error in the documentation and had copied over the monitored_conditions from the other SmartWeather component - and the sensors are not completely the same, so that is why you get an error. I have updated the documentation so that the correct sensors are now displayed. At the same time I also added a new feature to Battery devices, so that the Icon is now displaying the Battery Status based on my experience when Batteries are full and the Unit stops sending data.

Btw. You don’t have to put in monitored_conditions. If you leave that out, all Sensors are loaded by default

Question 1: No this component only gives the direct sensor values. I am considering to combine with DarkSky also. For now, you can load both components, and then just not load the Sensor component from SmartWeatherUDP, and use this instead. I want some more testing on the stability and accuracy before I start doing the other components

Question 2: Same as 1. In order to do this, I will have to do some more work and rewrite the stuff.

Finally, I will not be adding a Tip option. I understand why some people need that with all the time they spend on helping the rest of us. But I am fortunate enough, to not need it, and I enjoy doing this. But thanks for asking

3 Likes

Thanks for your reply, i keep getting errors thrown at me when i use the config from the readme with all the monitored conditions, when i remove that part the UDP version works fine (i see data) so i will keep it that way for now just to see how it works (works next to your weatherflow API component :slight_smile: )

Log Details (ERROR)

Thu Apr 18 2019 00:13:03 GMT+0200 (Midden-Europese zomertijd)

Invalid config for [sensor.smartweatherudp]: value is not allowed @ data[‘monitored_conditions’][2]. Got ‘feels_like_temperature’. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.smartweatherudp/

Log Details (WARNING)

Thu Apr 18 2019 00:13:09 GMT+0200 (Midden-Europese zomertijd)

Failed to set unknown variable: variable.obs_air

Edit:
Also with the config like this i have some errors but can’t make anything out of it

  • platform: smartweatherudp

Log Details (WARNING)

Thu Apr 18 2019 00:19:09 GMT+0200 (Midden-Europese zomertijd)

Failed to set unknown variable: variable.obs_air

Log Details (WARNING)

Thu Apr 18 2019 00:18:57 GMT+0200 (Midden-Europese zomertijd)

Failed to set unknown variable: variable.obs_sky

But i see most sensors filled with data at the moment

I still missed 1 sensor that was wrong in the documentation. feels_like_temperature should be feels_like. README.md has been updated. I tested it and now it works.

For the other errors you see, I can’t reproduce these, and from the error log it is not possible for me to dig in to the code to see where this error comes from. But please let me know if they persist. At least it seems that you are getting the data.

Great work! Thanks for the effort. I love seeing the UDP version because I want to suggest it for a friend who has spotty internet access…this way it won’t ever be unavailable due to bad internet service!!
I prefer to keep as much on the home network as I can too so I think I’ll use it as well.

I haven’t had a chance to try this yet but will this weekend. BTW, if you don’t already know, Weatherflow has released their solar module for the Sky, it’s currently 40% off too.

Note for all: Due to the new structure of Custom Components I have added the manifest.json file.
But unfortunately the way I implemented Custom_Updater it does not download this file. So please re-download __init__.py, sensor.py and manifest.json. The files are then modified to work with Custom_Updater going forward. There are no functional changes to the Custom Components.

@danbutter and @efleming: Looking forward to hear how it works for you.
Btw: Thanks for the tip on the Solar Module - Just ordered mine :wink:

Me again, this time on the UDP thread :slight_smile:

So just installed this component, but no data seems to be populating the entities. I noted in your git it says it could be up to a minute before a UDP packet is sent, but all entities are showing as having an ‘unknown’ value after 10 minutes. I’ve restarted the Weatherflow bridge to see if that helped but no good. I’ve done both a manual install and a git clone, same result.

Anyone seen an issue where all values update every 3 seconds, instead of just the realtime wind?

What is the window of time for lightning_count? Will it reset back to zero after no detected hits for X amount of time?

@briis Any chance you can add an optional host property to the config? My SmartWeather is on a different (isolated) subnet so broadcasts don’t cross over to my HA server. I see I can edit the host within the custom_component, just wanted to see if there was a more “respectable” way.

Thanks for the component! Looking forward to getting it fully up and running.

I am out travelling at the moment, but I will look at this as soon as I can. Should be possible.

1 Like

I now made the change to the Integration so that you can add host as config option and specify the IP Address in stead of the default 0.0.0.0 As I don’t have a setup like yours, I have not been able to test this, so please let me know if it works.

While I was messing with this, I also changed the structure on Github to add support for HACS. It is not part of the default repository, but you can add it manually, and thus both install and upgrade from HACS.

Add the following to the Custom Repository under Settings in HACS:

briis/smartweatherudp and choose Ìntegration as Category

Broken in 100.3b version of HA :frowning:

Works for me in 100.3

Very nice work! Any plans to submit this as an official HA integration? WeatherFlow is currently doing a kickstarter for their new Tempest weather station, which uses the same hub (which should mean the UDP calls are all the same). Might see an increased user base for this

Hi Chris,
I neither have the skills nor the time to learn how to get this done as an official HA Integration. But I would be happy if someone with those skills would do it.

The other thing is that I am ‘between houses’ right now, so sold my old house and waiting for the new one to be finished in 4-6 month. In that time I don’t even have access to the Weather Station, as this is with the other stuff in the Storage Facility.

But again, any volunteer that want to finalize the code for an Official Integration, just reach out. At that time the new sensors that are available in the updated API could also be added.

Bjarne

2 Likes

Hey Bjarne,
It seems like they’re shipping the new weather station starting in March to the backers–I got in on the kickstarter. So, I’m looking forward to playing with your component and happy to help out when it arrives. I haven’t gone through the process of submitting anything to HA yet, but I feel like I understand enough to be helpful. We’ll see :slight_smile:

2 Likes

Sounds great Chris. Just reach out when you have your new station.