Need help recreating old piston from core


#1

1) Give a description of the problem
Hi all. I’m new here. I had a great piston set up in CORE that worked as an alarm delay. My door sensors are too sensitive so I don’t want my alarm going off unless they’re open for a few seconds, otherwise I get tons of false alarms.

I tried copying my CORE command but since there is no “but if” I think that’s where I’m running into the issue.

2) What is the expected behaviour?
What I want to happen is that if the contact sensor opens, ST waits 3 seconds and then if it’s still open, it opens the virtual sensor which my alarm is connected to, and if it’s not still open nothing changes (the virtual sensor doesn’t open).

3) What is happening/not happening?
The 3 second delay is working in that when I open the door And the actual contact opens, it takes 3 seconds for the virtual sensor to open. Great! However, even if I close the door during the 3 second waiting period, the virtual sensor opens.

**4) Post a Green Snapshot of the piston!
Old CORE logic

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY


#2

I get the same… 3 seconds just isn’t enough time for task cancellation to kick in. It works with a 5 second wait though.

This is a side effect of the fact that waits below 5 seconds run in a single execution, whereas 5+ second waits force the piston to ‘request a wake up’ and end the current execution. It will then wake up for a second execution at the allotted time, to complete the rest of the piston.

Device state changes are not taken into account whilst an execution is actively running, the piston pulls the required data at the start of each execution, not continually. A 5+ second wait allows the piston to sleep and then load any updated data before continuing.

CORE worked worked differently.

Note that your piston design is inherently unsafe anyway, an intruder could easily close the door behind themselves within 3-5 seconds, thus not triggering the alarm. They would not even have to know they need to, closing the door quickly hides their activity from the street.

I used to have a piston that chirped a siren for 20 seconds before going full alarm, giving SHM time to deactivate should my presence arrival have been delayed.


#3

Thank you. That makes sense, but short of getting another alarm system I’ve gotta have it on some kind of delay long enough to keep me from getting false alarms in the middle of the night.

Does anyone have any tips on changing the piston so it will actually work? I will try it again with a 5 second delay.