Numeric_state - why no 'equal to'?

A cautionary tale for consideration - a lot of automations check state as a trigger. Of course using == in a template potentially creates situations where a value passes by the desired level without ever equalling it, failing to trigger. We can get around this using > or < easily enough. However, if your automation is critical, you also need to consider that NaN or ‘unavailable’ will also fail to trigger your automation.

I had a sensor on an outdoor hot tub and an automation set to notify me if the temperature of the water dropped below a threshold, such that I could intercede and prevent it from freezing if anything stopped working. Due to some electrical outages, the sensor crashed somehow and went offline at -25 C, as did the heater in the hot tub (the power was on, but had flickered, apparently causing confusion in the hot tub controller and the sensor). Three days later when I discovered this condition, the water in the tub was at 5 C and the pumps and pipes were all frozen. I’ll discover shortly how much damage this caused, but in hindsight it is now very clear that I should have also included a trigger to warn if the sensor went offline…

2 Likes