Piston to re_arm alarm


#1

**1) Give a description of the problem
Cannot figure out code to re-arm sensor after back door sensor closed. I have alarm.com alarm system. Have installed SmartThing switches called Alarm Away, Alarm Stay, and Disarm. Have routine that turns on Alarm Stay at night. However, have a son that lives in garage apartment that will come in the house after that time, disarm the alarm, but not re-arm when he goes back to his apartment.

2) What is the expected behavior?
I would like a piston that will re-arm the system every time it is disarmed, between certain hours (1 - 8 am), and after the back door sensor is closed.
3) What is happening/not happening?
nothing is happening

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
no logs

REMOVE BELOW AFTER READING


#2

Fundamentally I believe the problem is that you are subscribing to two “triggers” – Switch 2 changing to off, and Contact Sensor 1 changing to closed. These cannot be simultaneously true, and therefore the piston is not executing the “then” section.

What you need to do instead is make one of them a condition. Like this:

IF
{$hour24} is inside of range 1 and 7
and
Switch 2’s switch is off
and
Contact Sensor 1’s contact changes to closed

THEN
with Switch 2
do Set switch to on

For more information on Triggers vs. Conditions check out this thread: