I'am running the script below to switch 2 lights on in my living room, but
sometimes i do not want the script to run.
1. Is it possible with a dummy switch in domoticz to switch the script to off (i mean the switch on/off in the events editor),
2. or is it better to implement a dummy switch state in the script to exit the script when this switch is on.
If the answer is option 2, can you please tell me how to implement this in the script below.
Thnx in advance,
René
Code: Select all
return
{
on = {
timer = {'every 10 minutes between 15:30 and 22:00'},
},
logging =
{
level = domoticz.LOG_ERROR, -- change to LOG_ERROR when ok (was LOG_DEBUG)
marker = 'dusk sensor',
},
execute = function(domoticz)
local dusk = domoticz.devices('Schemerschakelaar1')
if dusk.state == 'On' and domoticz.devices('Staande_lamp').state == 'Off' then
domoticz.devices('Staande_lamp').switchOn()
domoticz.devices('Dressoir').switchOn()
domoticz.log('Device ' .. item.name .. ' was updated', domoticz.LOG_INFO)
elseif
dusk.state == 'Off' and domoticz.devices('Staande_lamp').state == 'On' then
domoticz.devices('Staande_lamp').switchOff()
domoticz.devices('Dressoir').switchOff()
end
end
}