Piston to prevent false alarms


#1

1) Give a description of the problem
(I am trying to design a piston where it will hopefully prevent smartthings to push out false alarms. How I would want to tackle this is to have webcore only send out notifcations and to turn on an alarm, when I get one, when both the multi-sensor and the motion sensor is triggered. In this case, from closed to open for the multi-sesnor and from inactive and active for the motion sensor. )

2) What is the expected behavior?
(When the multi-purpose sensor contact is set to open and the motion sensor is tripped to active, after walking a few steps away from the door as the motion sensor is not directly aimed at the door, a SMS is sent out and the alarm is turned on. I do not have not have an alarm yet but planning to get one.)

3) What is happening/not happening?
(Regular IF statement is not working for this because it is expecting the motion sensor to set to active right after the multi-sensor at the door is changed to open. Since the motion sensor is not actually aimed directly at the door, and requires the person/thief to walk a few steps, the IF statements do not seem to apply and exits on its own when the conditions for the motion sensor is false. I have been trying to design it where this is a delay in between when the status changes for the multi-purpose sensor and the motion sensor with avail)

4) Post a Green Snapshot of the pistonimage
(https://prnt.sc/hym5jb)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING


#2

The reason that does not work is that you have two triggers in the same IF statement. But you’re on the right track. However, as you say, those actions cannot (in real life and in the digital world) happen absolutely at the same exact moment. To fix this, in your piston, click on the word “and” in between the two triggers and you’ll get a new menu. In that menu you’ll see you can select “Followed by”. That is what you want.

image


#3

Thanks for your help on this. One more question:

What is the best way for me to set my presence as a condition without it being delayed for a minute after changing it from “and” to “followed by”. Basically I’ll want it to execute the command if I am away based on my presence, along with the other conditions like in my original design.


#4

I think i answered my own question, by adding a restriction, haven’t tested it yet though. Will do that when I get home. The restrictions were turned off by default, I had to turn it on to see it in the editor


#5

You can also do:

If presence sensor 1’s presence is not present
and
Contact Sensor 1’s contact changes to open
followed by
Motion sensor…

There’s a difference between a condition (something you can measure to see how it is set) and a trigger (an event that happens in a moment in time). So you can have all the conditions in the world on the same AND statement as they can all be determined to be true or false at the time a piston runs, but you can’t have two triggers happen at the exact same millisecond.

There’s a good article here about the difference and how to use them: