Problems with Disarm Scene and Ready & Not Ready Triggering Disarm

I have the Vera 3 with the ad2usb and an Ademco Vista 20P. It all works great except the scene that I created for when the alarm is first disabled. When I disable the alarm it turns on the lights and sets the Nest thermostat to home. However when the motion sensors are tripped it changes to Not Ready and back to Ready and triggers the event again. Its not a problem except when the lights are off and all motion turns them on. It also keeps sending home to the thermostat.

How can I set up the vera so that only on the first state change from Armed Away will the “Come Home” scene be executed (set thermostat to Home and turn on the lights).

Extra credit for only turn on the lights after sunset :wink:

Thanks in Advance!
Chris G

What are you using to trigger the scene?

It should be disarm.

Use the day or night plugin or Luup: (in the luup tab. Just past the following in so it runs at night)

if ( luup.is_night() ) then
return true
else
return false
end

The problem with that is that the thermostat won’t get changed either, if they are in the same scene.

Why are the motion sensors in the scene logic?

To clarify I believe you want to:

1: Always set the thermostat to Home when you disarm the alarm

2: Only at night, night turn on a few lights when you disarm the alarm

Correct?

Long story short, check the DetailedArmMode variable as well as the ArmMode variable. ArmMode will only show you part of what you are looking for with your alarm system. DetailedArmMode will let you make sure that your system as indeed been set to the proper mode. By checking both variables, it will help you eliminate any “false positives” with your alarm system. (Disclaimer, I have a DSB system, so I am assuming the plugin that interfaces to yours has similar options.)

You will have to play with your system and find out what the different values for ArmMode and DetailedArmMode are that you need to use.

Here is an example:

I use the following code in a scene set to run every two minutes. This sets my thermostat into EnergySavingsMode when the alarm has been set to Armed mode. (You can setup code to fire when the alarm is disarmed using the proper trigger and similar code).

It knows that the alarm has been properly set by checking both ArmMode and DetailedArmMode and seeing if the both are set to “Armed”, meaning that the alarm panel is in armed mode.

PARTITION_DEV_NUM is the device number of the alarm partition device in Vera.
THERMOSTAT_DEV is the device number of your thermostat

[code]local PARTITION_DEV_NUM = 61
local THERMOSTAT_DEV = 93

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

local detailed_state = luup.variable_get(“urn:micasaverde-com:serviceId:AlarmPartition2”, “DetailedArmMode”, PARTITION_DEV_NUM)

– SHOW VARIABLES FOR DEBUGGING
luup.log("ThermostatAway- "…state)
luup.log("ThermostatAway- "…detailed_state)

if (state == “Armed”) then
if (detailed_state == “Armed”) then
local status = luup.variable_get( “urn:upnp-org:serviceId:SwitchPower1”, “Status”, THERMOSTAT_DEV) or “0”
if (status == “0”) then
luup.log(“Thermostat already in Energy Saving Mode. Skipping…”)
else
luup.call_action(“urn:wdsc-hvac-org:serviceId:WDSC_HVAC1”, “RestartPolling”,{ delay=0 }, 126)

		luup.log("Alarm armed in Away mode, setting Thermostat to Energy Savings Mode.")
		luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" }, THERMOSTAT_DEV)
		luup.call_action("urn:upnp-org:serviceId:IOSPush1", "SendProwlNotification",{ Event= "Thermostat Alert", Description="Thermostat switched to Energy Saving Mode", Priority=1, URL=""}, 20)
		luup.call_action("urn:upnp-org:serviceId:IOSPush1", "SendProwlNotification",{ Event= "Thermostat Alert", Description="Thermostat switched to Energy Saving Mode", Priority=1, URL=""}, 41)
	end
end  

end[/code]