Commit Graph

2 Commits (3cdaffc81f4fc80abab6b2ceaa733a5cbae28a13)

Author SHA1 Message Date
SchiZzA 2c6b698ca9
fix(review): clamp heat index, unify Windy uv, bound forward timeouts 2026-07-26 13:13:05 +02:00
SchiZzA 0e5a8ce10c
fix(wslink): compute heat and wind chill index when the station omits them
The WU/PWS platform derives both indices from temperature, humidity and wind
(value_from_data_fn=heat_index / chill_index), but the WSLink descriptions only
read the station's own t1heat / t1chill via value_fn=to_float. Stations that do
not report those fields still got both entities, because
_auto_enable_derived_sensors creates them as soon as the raw inputs arrive, so
they stayed Unavailable forever.

Add wslink_heat_index / wslink_chill_index: prefer the station's reading, compute
it otherwise. The conversions are the subtle part. The WSLink payload is metric
and both entities are declared in Celsius, while the NWS formulas are defined for
Fahrenheit, and chill_index converts the temperature but not the wind speed even
though its formula needs mph. So the temperature goes C -> F in, the wind m/s ->
mph, and the result F -> C back out. For the reported payload (6.2 C, 40 %,
30.6 m/s) that is -1.94 C; leaving the wind in m/s would have reported 0.34 C.

The native unit stays Celsius on purpose: switching it to Fahrenheit to match the
WU platform would misread the values of stations that do send t1heat / t1chill.

Also guard on missing temperature/humidity/wind before delegating, so a payload
without those fields no longer logs an error on every push.
2026-07-26 01:20:56 +02:00