#Stop Automation Triggering On Numeric State Change

23 messages · Page 1 of 1 (latest)

nova halo
#

I have an automation that triggers if a temperature is over 75. Is there a way to have it only trigger when it changes from below 75 to over? It seems to continuously trigger whenever the temperature value changes by 0.1F

outer cobalt
#

That's what a numeric_state trigger does

#

Seems you have a state trigger or something like that

nova halo
#

above: '75'
entity_id:

  • sensor.office_temperature
    platform: numeric_state
#

seems it's bugged or something because it keeps triggering

#

Could it be because it's a helper sensor?

outer cobalt
#

You should remove the quotes around 75

#

No, that is not relevant

#

Anyway, what you're describing is not the behavior of a numeric_state trigger

nova halo
#

that's what I had thought too

outer cobalt
#

If it keeps going below and above, then yes, it will keep triggering

nova halo
#

ah maybe it's fluctuating between 75.0 and 75.1

gloomy canopy
#

that seems likely

oblique gyro
#

I found that for situations like that, a template trigger usually works better: {{ states('sensor.sensor')|int(0) >= 75 }}. For the additional triggering, you can debounce the automation using the trigger variables and seeing when the last time it was triggered.

gloomy canopy
#

Or just making it trigger for 1 min

#

If its hovering around the trigger point

oblique gyro
#

Yup, holding state probably works too

gloomy canopy
#

Or a nice latching binary sensor that goes on at 75 but doesn't turn off until it goes below 74.5 and use it as a condition (don't trigger unless off). Get some hysteresis in there

oblique gyro
#

You mean a threshold helper... 😉 lol I used to use them all the time, but then started template triggering stuff and... ugh... it's just all out of control now.

gloomy canopy
#

Does threshold work like that?

oblique gyro
#

Either threshold or trend. I can't remember which one off the top of my head, but yeah.

#

Yeah, it's the threshold helper.

gloomy canopy
#

I thought that was just high between low and high threshold? Didn't realise it did latching too