Code: Select all
return {
active = true,
logging = {
level = domoticz.LOG_DEBUG,
marker = 'patio sensor'
},
on = {
timer = {'Every minute'}
},
execute = function(domoticz)
--local movement sensor 1
local patiosensor1 = domoticz.devices(3530)
if (patiosensor1.state == 'On' ) then
domoticz.log('set sensor 1 ON')
end
if (patiosensor1.state == 'On' and patiosensor1.lastUpdate.minutesAgo >= 1 ) then
domoticz.log('set sensor 1 off')
patiosensor1.switchOff()
end
end
}
I must have used an incorrect command but cannot see what. Any hints appreciated.