Timer to turn a switch off

I've got an automation that keeps a light on if a sensor detects motion, however the odd time I turn it on manually with Alexa it will stay on permanently due to no sensor activity.

What would be the best way to have a timer on this for say 30 mins then if no sensor activity and 30 mins past it would turn it off.

If device on wait for 30 mins of inactivity on motion sensor.

This way regardless of how it's turned on, it will rely on inactivity on the motion sensor to turn off

will give that a shot, thanks!

@rlithgow1 was this how you were thinking?

Even simpler. Expose switch to alexa

That's even better! Wish i knew the logic better for this, putting it on test now, will let you know how i get on

For general 'auto off' needs, there is a great auto-off app here.

I use it for lights/plugs I turn on manually but want to have turn off after a set period of time - like our whole house fan, and a hot water pump that heats up water for the master bedroom:

@danabw this might be what i'm looking for :slight_smile:

You may also wish to consider the Switch Timer with reset driver. This will setup a virtual switch which lasts a certain length of time. Check the status of this switch when you want an action to occur.