Can anyone see what I am doing wrong in the script?
The intention is that if I turn on one switch, the other 2 will turn off.
However, this does not happen.
As soon as I press a switch, it lights up briefly and goes out again. The others don't respond.
Thank you for thinking along.
Peter
----------------------------------------
Code: Select all
return {
on = {
devices = {
'Thuis',
'Afwezig',
'Vakantie'
}
},
logging =
{
level = domoticz.LOG_ERROR, -- change to dz.LOG_ERROR when script is OK
marker = 'test Statuscontrole',
},
execute = function(dz)
local Thuis = dz.devices('Thuis')
local Vakantie=dz.devices('Vakantie')
local Afwezig=dz.devices('Afwezig') -- idx 395
if(Thuis.state=='On') then
Afwezig.switchOff()
Vakantie.switchOff()
elseif(Afwezig.state=='On') then
Thuis.switchOff()
Vakantie.switchOff()
elseif(Vakantie.state=='On') then
Thuis.switchOff()
Afwezig.switchOff()
end
end
}