Conditional scenes with Elk and Lua

Hi,
I’m trying to figure out how to use Lua to trigger/prevent scenes. I’d appreciate if someone can give me a hand with this.

I set up this script attached to a scene, but it seems to trigger no matter what. Any ideas?

local allow = true
local status = luup.variable_get(“urn:schemas-micasaverde-com:device:ElkAlarmPartition:1”, “DetailedArmMode”, 6)
return ((status == “Armed”) == allow)

What I’m trying to do is prevent the scene from happening if I am at home, even if the system is armed StayInstant, but work if I’m out and the system is armed away. Thanks!

Try

local status = luup.variable_get(“urn:micasaverde-com:serviceId:AlarmPartition2”,“ArmMode”,6)

Success! It seems that it works. (knock on wood… I only tested once)

local allow = true
local status = luup.variable_get(“urn:micasaverde-com:serviceId:AlarmPartition2”,“ArmMode”,6)
return ((status == “Armed”) == allow)

did not work for my application because apparently StayInstant is considered Armed, just as when it’s armed in away mode. However, using this worked:

local allow = true
local status = luup.variable_get(“urn:micasaverde-com:serviceId:AlarmPartition2”,“DetailedArmMode”,6)
return ((status == “Armed”) == allow)

Thanks so much for your help!

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy