Can anybody help me?
Posted: Wednesday 24 February 2016 22:33
Hi, I need help with a simple lua script. I wan't to do a script that turn off all lights (scene) when I turn on Security panel (arm away) and turn on one light when I deactivated security panel.
The first works fine but when I turn off the security panel doesn't happen.
this is the script:
commandArray = {}
local encendido
if (otherdevices['Security Panel'] == 'Arm Away') then
commandArray['Scene:ApagarLuces'] = 'On'
encendido = "Off"
print ("encendido: " .. encendido)
elseif (encendido == "Off") and (otherdevices['Security Panel'] == 'Normal') then
commandArray['Hab3 - Luz'] = 'On'
encendido = "On"
print ("encendido: " .. encendido)
end
return commandArray
On the other hand, I wan't to turn off light once time but with this script don't let me turn on any light when panel security is Arm Away, automatically turn off light.
Thank you very much
Regards
The first works fine but when I turn off the security panel doesn't happen.
this is the script:
commandArray = {}
local encendido
if (otherdevices['Security Panel'] == 'Arm Away') then
commandArray['Scene:ApagarLuces'] = 'On'
encendido = "Off"
print ("encendido: " .. encendido)
elseif (encendido == "Off") and (otherdevices['Security Panel'] == 'Normal') then
commandArray['Hab3 - Luz'] = 'On'
encendido = "On"
print ("encendido: " .. encendido)
end
return commandArray
On the other hand, I wan't to turn off light once time but with this script don't let me turn on any light when panel security is Arm Away, automatically turn off light.
Thank you very much
Regards