Piston stopping when door opens


#1

1) Give a description of the problem
new to smartthings and webcore, but trying. setting up a small piston to speak alerts for an exit and entry delays when SHM armed. it works fine if I dont open a door to leave the house. When I open the door, the announcements stop and the virtual switch never gets set to on.

2) What is the expected behavior?
I dont want the top section to be interupted

3) What is happening/not happening?
virtual switch is not getting turned on.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
<|+0ms|â•”Received event [Marshad Dr.].alarmSystemStatus = off with a delay of 59ms|
| — | — |
|+120ms|â•‘RunTime Analysis CS > 20ms > PS > 72ms > PE > 29ms > CE|
|+123ms|â•‘Runtime (42282 bytes) successfully initialized in 72ms (v0.3.108.20180906) (122ms)|
|+124ms|â•‘â•”Execution stage started|
|+137ms|â•‘â•‘Comparison (string) off changes_to (string) away = false (1ms)|
|+139ms|â•‘â•‘Condition #2 evaluated false (7ms)|
|+140ms|â•‘â•‘Condition group #1 evaluated false (state did not change) (10ms)|
|+155ms|║║Cancelling condition #21’s schedules…|
|+157ms|â•‘â•‘Condition #21 evaluated false (13ms)|
|+158ms|â•‘â•‘Condition group #19 evaluated false (state did not change) (15ms)|
|+161ms|â•‘â•šExecution stage complete. (37ms)|
|+163ms|â•šEvent processed successfully (163ms)|
|12/12/2018, 11:32:45 AM +150ms|
|+1ms|â•”Received event [Marshad Dr.].time = 1544635966192 with a delay of -1042ms|
|+131ms|â•‘RunTime Analysis CS > 23ms > PS > 77ms > PE > 30ms > CE|
|+134ms|â•‘Runtime (42282 bytes) successfully initialized in 77ms (v0.3.108.20180906) (132ms)|
|+136ms|â•‘â•”Execution stage started|
|+138ms|â•‘â•šExecution stage complete. (2ms)|
|+140ms|â•šEvent processed successfully (140ms)|
|12/12/2018, 11:32:35 AM +889ms|
|+2ms|â•”Received event [Door-Front].contact = open with a delay of 60ms|
|+8699ms|â•‘RunTime Analysis CS > 17ms > PS > 8652ms > PE > 30ms > CE|
|+8701ms|â•‘Piston waited at a semaphore for 8587ms|
|+8704ms|â•‘Runtime (42349 bytes) successfully initialized in 8652ms (v0.3.108.20180906) (8701ms)|
|+8705ms|â•‘â•”Execution stage started|
|+8719ms|â•‘â•‘Comparison (string) away changes_to (string) away = false (1ms)|
|+8722ms|â•‘â•‘Condition #2 evaluated false (9ms)|
|+8723ms|â•‘â•‘Condition group #1 evaluated false (state did not change) (11ms)|
|+8737ms|â•‘â•‘Comparison (enum) open changes = true (2ms)|
|+8740ms|║║Cancelling condition #21’s schedules…|
|+8742ms|â•‘â•‘Condition #21 evaluated true (14ms)|
|+8754ms|â•‘â•‘Comparison (enum) off is (string) on = false (3ms)|
|+8757ms|â•‘â•‘Condition #28 evaluated false (13ms)|
|+8759ms|â•‘â•‘Condition group #19 evaluated false (state did not change) (32ms)|
|+8764ms|â•‘â•šExecution stage complete. (58ms)|
|+8766ms|â•šEvent processed successfully (8765ms)|
|12/12/2018, 11:32:39 AM +454ms|
|+1ms|â•”Received event [Door-Front].contact = closed with a delay of 47ms|
|+103ms|â•‘RunTime Analysis CS > 18ms > PS > 60ms > PE > 26ms > CE|
|+106ms|â•‘Runtime (42272 bytes) successfully initialized in 60ms (v0.3.108.20180906) (104ms)|
|+107ms|â•‘â•”Execution stage started|
|+121ms|â•‘â•‘Comparison (string) away changes_to (string) away = false (1ms)|
|+123ms|║║Cancelling condition #2’s schedules…|
|+124ms|â•‘â•‘Condition #2 evaluated false (10ms)|
|+125ms|║║Cancelling condition #1’s schedules…|
|+127ms|â•‘â•‘Condition group #1 evaluated false (state changed) (13ms)|
|+139ms|â•‘â•‘Comparison (enum) closed changes = false (0ms)|
|+141ms|â•‘â•‘Condition #21 evaluated false (11ms)|
|+142ms|â•‘â•‘Condition group #19 evaluated false (state did not change) (13ms)|
|+146ms|â•‘â•šExecution stage complete. (39ms)|
|+148ms|â•šEvent processed successfully (148ms)|
|12/12/2018, 11:32:34 AM +246ms|
|+0ms|â•”Received event [Marshad Dr.].time = 1544635955201 with a delay of -956ms|
|+119ms|â•‘RunTime Analysis CS > 21ms > PS > 69ms > PE > 29ms > CE|
|+121ms|â•‘Runtime (42279 bytes) successfully initialized in 69ms (v0.3.108.20180906) (119ms)|
|+123ms|â•‘â•”Execution stage started|
|+1838ms|â•‘â•‘Executed physical command [Echo - Main Display].speak([Alarm is arming, you have 50 seconds to leave the house.]) (1691ms)|
|+1840ms|â•‘â•‘Executed [Echo - Main Display].speak (1694ms)|
|+1936ms|â•‘â•‘Executed physical command [Echo - Utility Tablet].speak([Alarm is arming, you have 50 seconds to leave the house.]) (92ms)|
|+1937ms|â•‘â•‘Executed [Echo - Utility Tablet].speak (94ms)|
|+1943ms|â•‘â•‘Executed virtual command [Echo - Main Display, Echo - Utility Tablet].wait (1ms)|
|+1945ms|â•‘â•‘Requesting a wake up for Wed, Dec 12 2018 @ 11:32:46 AM CST (in 10.0s)|
|+1953ms|â•‘â•šExecution stage complete. (1831ms)|
|+1956ms|â•‘Setting up scheduled job for Wed, Dec 12 2018 @ 11:32:46 AM CST (in 9.992s)|
|+1965ms|â•šEvent processed successfully (1964ms)|
|12/12/2018, 11:32:24 AM +563ms|
|+0ms|â•”Received event [Marshad Dr.].alarmSystemStatus = away with a delay of 73ms|
|+130ms|â•‘RunTime Analysis CS > 20ms > PS > 72ms > PE > 38ms > CE|
|+132ms|â•‘Runtime (42283 bytes) successfully initialized in 72ms (v0.3.108.20180906) (131ms)|
|+134ms|â•‘â•”Execution stage started|
|+147ms|â•‘â•‘Comparison (string) away changes_to (string) away = true (1ms)|
|+149ms|║║Cancelling condition #2’s schedules…|
|+150ms|â•‘â•‘Condition #2 evaluated true (10ms)|
|+152ms|║║Cancelling condition #1’s schedules…|
|+153ms|â•‘â•‘Condition group #1 evaluated true (state changed) (13ms)|
|+158ms|║║Cancelling statement #4’s schedules…|
|+235ms|â•‘â•‘Executed physical command [Echo - Main Display].setLevel([75]) (70ms)|
|+236ms|â•‘â•‘Executed [Echo - Main Display].setLevel (71ms)|
|+444ms|â•‘â•‘Executed physical command [Echo - Utility Tablet].setLevel([75]) (202ms)|
|+445ms|â•‘â•‘Executed [Echo - Utility Tablet].setLevel (205ms)|
|+553ms|â•‘â•‘Executed physical command [Echo - Main Display].speak([Alarm is arming, you have 60 seconds to leave the house.]) (102ms)|
|+554ms|â•‘â•‘Executed [Echo - Main Display].speak (106ms)|
|+630ms|â•‘â•‘Executed physical command [Echo - Utility Tablet].speak([Alarm is arming, you have 60 seconds to leave the house.]) (72ms)|
|+631ms|â•‘â•‘Executed [Echo - Utility Tablet].speak (75ms)|
|+636ms|â•‘â•‘Executed virtual command [Echo - Main Display, Echo - Utility Tablet].wait (1ms)|
|+637ms|â•‘â•‘Requesting a wake up for Wed, Dec 12 2018 @ 11:32:35 AM CST (in 10.0s)|
|+643ms|â•‘â•šExecution stage complete. (510ms)|
|+645ms|â•‘Setting up scheduled job for Wed, Dec 12 2018 @ 11:32:35 AM CST (in 9.994s)|
|+654ms|â•šEvent processed successfully (653ms)|Preformatted text>


#2

You need to use NEVER CANCEL TASK
because as soon as your trigger is no longer TRUE, piston will stop everything.

IF door changes to open
Do this do that (NEVER CANCEL)
wait 10 seconds
Do this do that.

(I can explain in detail if you need to)


#3

Thanks @ike2018! that did exactly what I was looking for. i couldn’t get the beeps to work like i wanted in SHM delay so had to find another way to keep the wife happy. She needed something to remind her the alarm was arming/armed.

for learning purposes for me. i read it as a logical order, am i misunderstanding?

if SHM changes to away, do this, do this do this… etc,

then i thought it would run the bottom part, if either door opens AND virtual switch is on…


#4

I am glad it worked.
This part of WebCore had confused me and many others as well, it’s slightly different than regular coding. (I have a very entry level coding knowledge)
it’s true that it rans in a logical order from top to bottom BUT once it’s DONE it will not go back and deal with unfinished business:))) as long as you use a trigger (which you will 95% of the time)

in your piston, lets say house changed to ARMED/AWAY
this change will trigger the piston and piston will start tasks from line 25,

  • it will take speaker to say that sentence about 5-6 seconds
    But right now CHANGES TO is ALREADY CHANGED… it’s over…piston will not deal with remaning tasks…

if you write something like this,

IF homemonitor status changes TO Armed/Away
DO
Turn lights OFF
Do this
Do that
DO other
With radio
Turn OFF

Yes the piston will run everything really fast and do it all… (Though ST sometimes will miss some of them because it’s too fast)

But adding a single WAIT (wihout Never Cancel)

IF homemonitor status changes TO Armed/Away
DO
Turn lights OFF
Do this
Do that
WAIT 5 seconds
DO other
With radio
Turn OFF

Now it will not do remaning tasks after WAIT… because while waiting, the trigger is no longer doing what the piston is looking for.

If you test this piston you will get a better picture…
IF simulated switch changes to ON
DO
Turn on X light bulb
WAIT 1 minute
Turn off X light bulb

Write this one and TRACE the steps…
You will see a countdown starting next to WAIT…
60…59…58…57…56
Somewhere around 55 to 50, all of a sudden the counter will disappear and piston will never turn the light OFF


#5

That makes sense. it basically continues to monitor the trigger and cancels any remaining steps if the trigger is no longer true (without never cancel).

thanks again Ike, you’ve helped me a lot!


#6

You are so welcome…
I am happy to help as much as I can.


#7

I’m sure i’ll need more in time! this community has already been great. love the posted pistons. using a few and others give me ideas.


#8

Oh man this place is great…
I was hesitant at the beginning because ST community was more like youtube comments section LOL
but here, I got almost all my questions answered, learnt a lot…