When "Dusk Dawn Sensor" is On and "Hall Lamp Wall Switch" is Off switch "Hall Lamp Socket" On.
The script runs and shows no errors but the Hall Lamp Socket does not switch on and is not triggered in the script.
Where am I going wrong.
Code: Select all
return {
active = true,
on = {
devices = {
'Hall Lamp Wall Switch',
'Dusk Dawn Sensor',
'Hall Lamp Socket'
},
},
execute = function(domoticz, device)
if ((device.name == 'Dusk Dawn Sensor' and device.state == 'On')
and (device.name == 'Hall Lamp Wall Switch' and device.state == 'Off')) then
domoticz.devices('Hall Lamp Socket').switchOn()
end
end
}