Simple template trigger on number increasing

Hi I have zoneminder intergration set up and I have a camera that watches my dogs bed. If she gets up its normally to go to the toilet. I have an automation that sends me a notification when she moves, but sometimes I found Zoneminder doesnt update to recording as its faster than the update period.

I have noticed that the number of events increase by 1 (330 events changes to 331) I want to add that events count as a trigger, so if it increases set off my notification, but not on decrease as it does a clean each day and I dont want it going off at 3 am.

how would I do a template on script to watch that?

the sesor is named sensor.back_yard_events and I have tried things like this:

{{ states(‘sensor.back_yard_events’) |float(0) > 1 }} which returns true as it is greater than one, how do I make it state true if it grew and then go back to false after the notification fires.

I might need to make the increase turn on a helper switch and the trigger turn it off and cycle it like that but I need the trigger state to start that.

Maybe I am over thinking this too.

Any help would be great!

Maybe you could have a trigger for any change - including a decrease. Then have a condition that the count is above zero.

as per above
trigger on state change
condition template: trigger.from_value.state < trigger.to_value.state
action: tbd

1 Like