Normally entities do not update if value is the same but something like the “filter” sensor may cause such updates.
I’m going to try and test what the behavior of the automation is in such cases but wanted to ask in case someone already knows.
To be explicit, my automation trigger looks like this
trigger:
- platform: state
entity_id:
- sensor.guest_bedroom_aqi_trailing_10_min_average
So my question is if the entity’s numerical state changes from 5 to… 5 again, will the automation trigger? Thanks.
Yes what you’re saying is true and I have run to the same problem. One thing you can do is make the States of the sensor the time it was changed - and then the value you wanted to originally use - make that an attribute of the sensor. Then in your logic look at the attribute value.
If you have control over the sensor, put a timestamp attribute on it.
Alternatively, just use a time_pattern trigger. That’s usually a sign of poor automation design, but if you want to trigger whether there’s a change or not, perhaps it’s your best solution.
No, I want the opposite. I want to only to trigger on true value changes, not just a republish of the same value (and again, I know in most cases people have the opposite problem, esp with derivative sensors).
Based on my testing, I think it will work exactly as I want it to. I.e. even if the sensor republishes it values with the same one somehow, it will not trigger the automation if the old and new values are identical. So I’m good ;).