#Trigger on Sensor Increase for an hour

1 messages · Page 1 of 1 (latest)

thick minnow
#

I'm looking to figure out how to trigger and automation when a sensor increases by X aver an hour.

For example if the humidity changes from 45% to 55% over an hour I want it to trigger, but not if it goes from 45% to 50% in that hour. (I know how to set an automation to trigger if it goes over a threshold value ala I never want it to be above 70%).

Here's my current automation:

triggers:
 - trigger: state
    entity_id: sensor.humidity_average
conditions:
 - condition: template
    value_template: "{{ trigger.to_state.state - trigger.from_state.state|int > 1}}"
velvet lagoon
#

Make a statistics helper with max age set to 1hr and characteristic set to value min - this will give you the lowest value in the last hour. Then you can check if current value - statistics helper value >= X

thick minnow
#

@velvet lagoon does the statistical sensor only update on the hour or is it a rolling update?

velvet lagoon
#

why would it only update on the hour? it's continuous

thick minnow
#

Well I guess that's my worry. I want to notice the big changes, so if the min value is creeping up it won't see a significant change. Since there are chances for blips I'm trying to say ignore a seemingly random high number. Just let me know if we've trended up significantly

velvet lagoon
#

I don't understand what you're worried about in the first statement. Why wouldn't it see a significant change?

#

As for "blips" - that's a completely different issue. Use a filter to remove them