But that would only trigger at 160. The API refreshes every minute so it could go from 154 to 162 and never hit 160. So I would be back to using templates similar to this?
I didn’t read your whole automation. I was simply pointing out that an “equals” numeric trigger in your case would the the same as a state trigger. Is this not what you want?
I have a slider to set a Timer for a light I have. After a given time it should turn off. If you slide the slider to “0” it also should turn off the light. That is my problem at the moment, where an “equal to” would help a lot.
I want a condition to check if my thermostat is set to 20. Yes I could use above 19.999 and below 20.001 but why? It would be much simpler to just have equals 20.
This will evaluate it as a string, so it will always return false.
- condition: state
entity_id: ...
attribute: ....
state: 20.0
Without the apostrophes it will evaluate as a number.
The issue is, when setting a condition via the UI, it automatically adds the apostrophes. Combine that with the fact that numeric state doesn’t have an “equal to”, there is currently no way to do this via the UI.
Sure it’s not hard to switch to YAML mode and remove the apostrophes, but is the complete newbie to HA going to know that? Having an “equal to” in the numeric state, even if it converts to yaml as state: 20 would make things much more user friendly.
Even as an HA user for several years, I just made up an automation through the GUI and was scratching my head trying to figure out why it was evaluating as false when it was clearly true. Took me a few minutes to realize it was a string vs a number.
I’m saying when it was created by the GUI it would not evaluate properly. I had to switch to YAML to remove the apostrophes in order to get it to work. Which is exactly what prompted me to search and revive this old thread.
However my point remains the same. With no “equal to” under numerical state, and the automation editor automatically adding quotes, this is not user friendly for a new HA user who is trying to avoid YAML entirely.
Don’t forget that the value of a zone is an integer. There are situations where you want to check that no one is home (zone.home == 0) or someone is alone at home (zone.home == 1).