We have moved at community.getvera.com

Author Topic: Scene for Dusk When Alarm is Away Mode  (Read 524 times)

Offline ryanjohnson00

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Scene for Dusk When Alarm is Away Mode
« on: December 16, 2018, 10:19:35 am »
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:
  • Put Luup code in my scene to not run if alarm is in "Away" mode
  • 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
  • Find where to put code when I arm system as "Away", to turn off my cabinet lights.
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
    --    -- Return false and scene will not run, lights will not turn on.    --
    return false

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Scene for Dusk When Alarm is Away Mode
« Reply #1 on: December 17, 2018, 05:04:21 am »
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
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.