In the following simple script the second "if" doesn't work.
Code: Select all
return {
on = {
devices = {
'wall button 1',
'sleepingroom light'
}
},
execute = function(domoticz, device)
if ((device.name == 'wall button 1' and device.changed)) then
if ((device.name == 'sleepingroom light' and device.state == "Off")) then
domoticz.log('Light will wee turned on ')
end
end
end
}
Or maybe there is another way to do this?
Thanks,
Arek