I’d like to turn off a few lights (individually) in the case that someone leaves them on for a certain amount of time (say 30min)
I found an example of using timed switches here Example: Timed Switches but I can’t figure out how I can modify it so that I don’t have to create a separate script for each light I want it to apply to (each light must have its own countdown).
Is this possible or would I need a script per light?
If you don’t want to keep adjusting the time in the front end, you don’t need those scripts at all and can just use a simple automation for each light, this turns my shed light off 5 minutes after it’s turned on…
THis will not work. If the light was turned off before 5 mins and then turned back on it will switch off the light. Need to check if the light was actually continuously On for 5 mins before switching off.
This does not make sense… have you actually tried this? I don’t see any reason why this would not work unless there is another automation on your system doing this.
Of course! That is what he wanted.
If you manually switch off then on again, it’s retriggered for another 5 minutes.
I’m not seeing a problem with this.
Which is in fact the only part necessary for the trigger?
to: 'on'
for:
minutes: 5
Just refreshing all my automations to be as economical as possible, and was told the “from: off” here could be left out (and all other comparable automations of course…)
Havent run into trouble yet What do you think?
Yes but it is messy at the moment. For each automation you use to change the state of the switch you will also have to record that it was done by the automation using an input_boolean or mqtt binary sensor. You will also have to clear this when the switch is turned off.
I think I read somewhere that the ability to determine this is on the roadmap to be included in HA.