I have a bunch of scrape sensors to calculation an air pollution index from some station raw data (scaped once every 15 minutes) and a min/max sensor to pick the largest of these values, defined just beneath in config.yaml.
Whenever I restart HASS, the min-max sensor produces some junk data before it settles onto the correct value. I am guessing that it is evaluating the min/max while the sensors are scraping. This produces spikes in my history chart and makes it ugly (have a look at the screnshot: the line is the max of the five sensors below, none of which has the junky spikes)
Is there some to prevent this? Maybe forcing min/max to wait until the scrape has finished, or something havenât thought about?
Same here, Iâm facing the same annoying thing since a while but never raised the point. I have several temperature sensors and the min/max sensor starts calculating after a restart while all sensors are not all updated, which translates to spikes like yours.
I already did some researches and the simplest way I found would be to introduce an arbitrary delay parameter that the sensor would wait before calculating. Another more complex approach would be to wait for all the sensors to have a âvalidâ value, but how to define what is a valid value? Not unknown or not unavailable?
In any case, that would require adapting the code.
Nothing related but that could also be very interesting to define weights for each base sensor. Like in my case bedroom temp is more important than the basement one. Anyway that would be for another topic.
I can almost guarantee that the template sensors arenât set up properly. The min max sensor ignores âunknownâ values, but not values that the sensors produce. The templates most likely produce 0 on startup instead of having an unknown state with the availability template. The min max does wait until itâs sensor has started, so Iâd start looking at the sensor that produces the values.