I have an issue with a lua script I created to switch my living room lights on & off. Here's the situation:
The script to determine the previous state and switch the lamp goes as follows:
Code: Select all
commandArray = {}
if (devicechanged['$Living zitgedeelte V1'] == 'On' or devicechanged['$Living zitgedeelte V1'] == 'Off' or devicechanged['$Living zitgedeelte V2'] == 'On' or devicechanged['$Living zitgedeelte V2'] == 'Off') then
if(otherdevices['Living zitgedeelte'] == 'On') then
commandArray['Living zitgedeelte']='Off'
else
commandArray['Living zitgedeelte']='On'
end
end
return commandArray