I have tried a couple of alternative ways, but I seem to be able to figure out why it is not fired!
Can you guys give me a suggestion?
(I am well aware that this has to be plain simple, but I have no clue at the moment where to dig deeper to make it work)
Here is my code:
Code: Select all
commandArray = {}
if (devicechanged['Switch - Shed Inside']) then
if (commandArray['Relay - 03 - Lamp Shed Inside']=='On') then
commandArray['Relay - 03 - Lamp Shed Inside']='Off'
elseif (commandArray['Relay - 03 - Lamp Shed Inside']=='Off') then
commandArray['Relay - 03 - Lamp Shed Inside']='On'
end
--elseif (otherdevices['Switch - Shed Inside'] == 'Closed') then
-- if (commandArray['Relay - 03 - Lamp Shed Inside']=='On') then
-- commandArray['Relay - 03 - Lamp Shed Inside']='Off'
-- elseif (commandArray['Relay - 03 - Lamp Shed Inside']=='Off') then
-- commandArray['Relay - 03 - Lamp Shed Inside']='On'
-- end
end
return commandArray
'Relay - 03 - Lamp Shed Inside' = on/of switch controlling GPIO output -> relay