I use a Shelly 2.5 to control my two bedside lights. In the config of esp home I’d like to hardcode a timer for the amount of time the light are allowed to be on, independent from HA.
Everything works like a charm but I can’t seem to find a solution for this. I’m using regular switches that toggle the light if used.
Thanks for your answer @parautenbach but I just can’t understand the code. I am using a regular switch and because of that a just can’t “toggle” the light whenever the switch is used, use a delay, and toggle it again. Maybe I am wrong here but isn’t this also being triggered when the light is turned on via the dashboard.
Let’s assume that the light is on. If I use the switch, the light will toggle and turn off. Be off for the time of the delay and toggle back on. Am I correct?
I was searching for a way to check if the light is on, or in my case, the relay is closed. Then start the delay and then switch it off. In that case the delay isn’t used when the relay is open.
I don’t want to be a prick, I just can’t get my head around this code. I must admit I haven’t tried the code you pointed towards. Maybe I’ll try it. I’ll let you know.
It’s connected to the Shelly’s L and SW1 connections. The light is connected though a bridge connection shared with the N connection and the O1 on the Shelly.