ha-illuminance icon indicating copy to clipboard operation
ha-illuminance copied to clipboard

Feature Request: fallback when weather sensor fails

Open rigrig opened this issue 2 years ago • 3 comments

The last Home Assistant update broke OpenWeatherMap, resulting in the illuminance sensor returning unknown, (log: No attribution attribute: weather.openweathermap.)
My automations expect a numeric value (to prevent flickering the lights when illuminance is unknown during HA restart), so didn't turn on my lights when it got dark.

Maybe instead of bailing out when it can't find/handle current conditions, the illuminance sensor could just fall back to ignoring the weather sensor, so lights at least still turn on/off according to day/night?

rigrig avatar Jul 07 '22 21:07 rigrig

Good idea. In fact, I can even make using a weather entity optional, which would just give the curve based solely on sun position.

pnbruckner avatar Jul 08 '22 03:07 pnbruckner

Good idea. In fact, I can even make using a weather entity optional, which would just give the curve based solely on sun position.

Did you ever add the weather entity being optional feature? I would like to use your tool "backwards", i.e. calculate "cloudiness" based on an actual sensor

luberk8 avatar Jan 05 '24 00:01 luberk8

@luberk8, no, not yet. In theory the "fallback" feature could do it, but the current implementation expects to see the weather entity at least once, and until it does, the sensor's state will be "unknown". I've been meaning to change that, but I could also explicitly make the weather entity optional. I kind of have that on my "to do" list, just haven't gotten around to it. I'll try to do it sooner rather than later.

pnbruckner avatar Jan 05 '24 14:01 pnbruckner