Automation That Triggers if Something Has NOT Happened in X Hours

I need to be reminded at a certain time if I do not push a button by midday each day (a Zigbee Xiaomi button).

The button is a sensor that can have multiple states depending on how it is pressed (Single = single click, Double = double click, Triple = triple click etc.), I need to be alerted if it has not had a Single button press between 6am and 12am.

I know how to sent an alert, what I don’t know is how to check specifically if a Single click has NOT happened between two time periods. I still want to be able to double click it or triple click it during this time period.

After being press, the sensor seems to “reset” itself after an hour. So if I single click it, the state becomes Single, and if no other clicks occur, then it loses its state after about an hour.

Here is what the sensor looks like in HA:

36%20PM

34%20PM

Any ideas how I can easily achieve this? I have been trying to think up ways but nothing simple comes to mind.

How about an automation on single press that turns on a boolean

Then, you can test if the boolean has been in state on for an hour

1 Like

history statistics searching for single click

Then you should be able to search for when it equals zero.

1 Like

Have a look at this example

3 Likes

Those are all great ideas. Thank you all.

1 Like

A ‘like’ back is appreciated and improves my karma :wink:

2 Likes