Code: Select all
return {
on =
{
devices = {
'PIRSleeping',
['nightTime'] = {'between 23:00 and 06:00'}
},
},
execute = function(domoticz, PIRSleeping)
if (domoticz.devices("PIRSleeping").state == "Off" and (domoticz.devices == 'nightTime' and domoticz.devices == 'On')) then
domoticz.devices('gosund').switchOn()
end
end
}