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
when switch is off for 1 minute
Moderator: leecollings
- waltervl
- Posts: 5853
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: when switch is off for 1 minute
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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: Bing [Bot] and 1 guest