Page 1 of 1

when switch is off for 1 minute

Posted: Friday 26 May 2023 12:53
by coene369
Hi,

I have serval esp3266 (espeasy) running. these sometimes want to go offline. via hardware (ping) I can see in domoticz whether they are offline or online. now i want to write a script if the esp8266 is offline for more than 1 minute a switch will turn off for 1 minute and turn on again.

how do i do this

thanks in advance

Re: when switch is off for 1 minute

Posted: Friday 26 May 2023 13:55
by waltervl
Use something like

Code: Select all

if  ( domoticz.devices('your esp3266 device').state == 'Off' and domoticz.devices('your esp3266 device').lastUpdate.secondsAgo > 60 ) then
 domoticz.devices('switch').switchOn().forMin(1)
 end