briis / hass-weatherflow2mqtt

WeatherFlow to MQTT for Home Assistant. Use UDP to get local weather data in to Home Assistant using MQTT Discovery
MIT License
129 stars 29 forks source link

Heavy Rain in precip_type #205

Closed GlennGoddard closed 1 year ago

GlennGoddard commented 1 year ago

Home Assistant Version?

2023.1.1

Add-On or Self Hosted?

Self managed Container

Weatherflow2MQTT version?

3.1.4 (Dev)

What happened?

Line 78 of in all the Translation languages lists type returned precip_types with "heavy-rain" da "heavy-rain": "Kraftig regn" de "heavy-rain": "Starkregen" en "heavy-rain": "Heavy Rain" fr "heavy-rain": "Forte pluie" nl "heavy-rain": "Zware regen"

Line 138 of helpers returns "heavy" type_array = ["none", "rain", "hail", "heavy"]

Correct me if I'm wrong, but it would appear that if a "3" is returned by the weather station then we would never get an actual output because the translation would not be able to match it. All other precipitation type translations match the helpers output.

I just came across this while I was comparing precip_type with rain_intensity; and noticed I have never had a precip_type of of "heavy".

Relevant log output

No response

GlennGoddard commented 1 year ago

I could do a PR on this and fix it in either translations or helpers. Less changes if done in helpers. I just wanted to make sure I was see this right.

GlennGoddard commented 1 year ago

I have ONLY had 0.97 inches of rain over the 948 minuets of rain today so I was going off of history and not current.

briis commented 1 year ago

No with a 3 this would return heavy as the type array is 0-based, so the 4. item will be a 3.

GlennGoddard commented 1 year ago

Right, but there is no translation for "heavy"

briis commented 1 year ago

Finally the penny drops by me 😁 You are absolutely right. It has taken a while for us to spot that - now fixed, so that type_array reads: ["none", "rain", "hail", "heavy-rain"]

briis commented 1 year ago

Pushed a new dev build to docker with this included. Will hold a full release a bit.