Simulating a sleep timer

Hi all,

Recently got my Unfolded Circle Remote 3 which I am loving. However, it does not yet have a sleep timer. I have installed an integration that allows HA to see the state of the remote. I tried to set an automation up in HA to switch the activity off if it’s been on for 2 hours after a certain time of day, but automations in HA only seem to be able to trigger if a state has changed, as opposed to being able to check the state and acting on that.

Is there a way of doing this based on checking the current state as opposed to watching for it to change state?

A state condition with a for clause reacts when state is that way for the given time. So that is some time after a change, as you ask. An example is in the docs:

If there are changes happening inbetween and you still want to react, create a timer helper and start that. It has the advantage that you can also cancel the timer when you have the need. When the timer runs out an event is fired, and you can react on that.

Apologies I didn’t come back to thank you for this. This got it working for me.

1 Like