V3.8035
There are two motion sensors, one virtual switch and a group of lights, and this script gives me the error:
scripts/lua/script_device_lysPåNatt.lua:3: 'then' expected near ')'
What's wrong with the parantheses?
Code: Select all
commandArray = {}
if ((devicechanged['Bevegelse Neo'] == 'On') or (devicechanged['Bevegelse'] == 'Motion')) and ((otherdevices['Natta']) == 'On') and (otherdevices['Group:Lys stue']) == 'On')) then
commandArray['TomStue']='Off'
print ("Noen har våknet og lyset er på igjen")
if (uservariables['Natta'] == 0) then
commandArray['SendNotification']='Noen har våknet og lyset er på igjen'
commandArray['Variable:Natta']=tostring (1)
end
end
return commandArray