I have an event that turns on a light when the door is opened, and sometimes it takes 5 minutes to perform the action
look at the log
2022-08-14 21:48:47.363 Status: User: Admin (IP: 192.168.3.241) initiated a scene/group command
The action is "Garage2" (Door Open)
2022-08-14 21:48:47.365 Activating Scene/Group: [Garage Button]
2022-08-14 21:48:49.735 Virtual: Light/Switch (Garage2)
2022-08-14 21:49:00.881 Status: Incoming connection from: 80.29.xxx.xxx
2022-08-14 21:49:00.907 Status: Incoming connection from: 80.29.xxx.xxx
The action is performed 5 minutes later:
2022-08-14 21:53:00.974 Status: Incoming connection from: 80.29.xxx.xxx
2022-08-14 21:53:09.416 Virtual: Light/Switch (FroniusState)
2022-08-14 21:53:09.961 Virtual: Light/Switch (Luz Rampa)
2022-08-14 21:53:09.979 Watts: Lighting 1 (Luz Garaje)
2022-08-14 21:53:18.516 Status: Set UserVariable rainLastTime = 2
2022-08-14 21:53:19.357 Virtual: Light/Switch (FroniusState)
2022-08-14 21:53:19.640 RFlink 433: Temp (Nevera)
Hardware is a raspberry pi 4 with SSD over USB
Any idea?return {
on = {
--quien dispara el evento, en este caso un cambio en "Garaje2"
devices = { 'Garaje2' }
}, execute = function(domoticz, device)
--comprobamos que sea de noche isNightTime
if(domoticz.time.isNightTime)then
if(device.state=='Open')then
--Cambiamos el device a ON durante 5 minutos, pero comprobamos que no esté ya en ON con el checkFirst
domoticz.devices('Luz Rampa').switchOn().checkFirst().forMin(5)
domoticz.devices('Luz Garaje').switchOn().checkFirst().forMin(5)
else
domoticz.devices('Luz Rampa').switchOff().afterMin(2)
domoticz.devices('Luz Garaje').switchOff().afterMin(2)
end
end
end
}