Scene for Dusk When Alarm is Away Mode

I just got my first scene created to turn on some indoor cabinet lights at dusk. Very easy to do, now I want to enhance it and if the security system is armed “Away” do not turn on the cabinet lights.

To do this I think I should:

[ul][li]Put Luup code in my scene to not run if alarm is in “Away” mode[/li]
[li]Find where to put code when I disarm system, run my “At Dusk” scene. My thought is running that scene will turn on my light if it is after dusk[/li]
[li]Find where to put code when I arm system as “Away”, to turn off my cabinet lights.[/li][/ul]
I found some sample code and modified it a bit that I think I can use for step 1 above. Do I replace my device number where 94 is?

local alarmstatus = luup.variable_get(“urn:micasaverde-com:serviceId:AlarmPartition1”, “ArmMode”, 94)

if (alarmstatus != “Armed”) then

– Return true and allow scene to continue to run

return true
else
[font=verdana][size=2px] --[/size][/font][font=verdana][size=2px] – Return false and scene will not run, lights will not turn on.[/size][/font] –
return false
end

Hi Ryan,

Yes, look up your device number in the Advanced settings of your alarm panel plugin and that should replace the 94.

Have fun.

Cheers Rene