- Sensor de movimiento Kerui D026
- Autoapagado en 5 segundo
return {
on = {
devices = {'P_Garage_Abierta', 'P_Garage_Cerrada' }
},
execute = function(dz, device)
local luz = dz.devices('Sonoff_basic_101')
local sensor1 = dz.devices('P_Garage_Abierta')
local sensor2 = dz.devices('P_Garage_Cerrada')
if sensor1.state == 'On' then
luz.switchOn()
dz.log('LOG: Puerta Garage Abierta', dz.LOG_INFO)
end
if sensor2.state == 'On' then
luz.switchOff().afterSec(50)
dz.log('LOG: Puerta Garage Cerrada', dz.LOG_INFO)
end
end
}