Code: Select all
return {
on = {
devices = {'StueNord_bevegelse', 'StueSoer_bevegelse', 'LGTV', 'SomeoneHome', 'x_minute_timer'}
},
execute = function(domoticz, device)
if (device.name == 'StueNord_bevegelse' and device.state == 'Motion' or
device.name == 'StueSoer_bevegelse' and device.state == On or
device.name == 'LGTV' and device.state == On and
device.name == 'SomeoneHome' and device.state == Off and
device.name == 'x_minute_timer' and device.state == Off) then
domoticz.devices('SomeoneHome').switchOn()
domoticz.devices('x_minute_timer').switchOn()
domoticz.notify('Noen er hjemme!', dz.PRIORITY_LOW)
end
end
}