Task cancelling on state change despite "never cancel"


#1

1) Give a description of the problem
Trying to get my kids to close the door behind them.

2) What is the expected behaviour?
The piston determines if the house is wide open to the elements for X minutes. Then Plays “Please close the door” repeatedly through alexa.

Then… after the door is closed, announces “The door was left open for 3 minutes. Please contribute £2 towards the heating bill”

3) What is happening/not happening?
The last part doesn’t work. When the doors close the piston stops running. I’ve tried various combinations of “never cancel” etc

**4) Post a Green Snapshot of the

5) Attach logs after turning logging level to Full
27/01/2023, 21:55:24 +529ms
+3ms ╔Received event [Front Outer Door Contact Sensor].switch = off with a delay of 25ms, canQueue: true, calledMyself: false
+14ms ║RunTime initialize > 13 LockT > 1ms > r9T > 3ms > pistonT > 1ms (first state access 6 m:9 4 9)
+17ms ║Runtime (8874 bytes) initialized in 3ms (v0.3.114.20230113_HE)
+19ms ║╔Execution stage started
+27ms ║║Comparison (enum) on stays (string) on = true (1ms)
+29ms ║║Comparison (enum) off stays (string) on = false (2ms)
+32ms ║║Cancelling any timed trigger schedule stays result false cancel any timers for condition 3
+35ms ║║Condition #3 evaluated false (13ms)
+41ms ║║Comparison (enum) off stays (string) on = false (1ms)
+43ms ║║Cancelling any timed trigger schedule stays result false cancel any timers for condition 4
+46ms ║║Condition #4 evaluated false (9ms)
+48ms ║║Condition group #2 evaluated false (condition changed) (25ms)
+50ms ║║Cancelling condition #1’s schedules…11 (st:13)
+51ms ║║Condition group #1 evaluated false (condition changed) (28ms)
+57ms ║╚Execution stage complete. (38ms)
+84ms ╚Event processed successfully (81ms)
27/01/2023, 21:55:22 +560ms
+4ms ╔Received event [Seafield Drive].time = 1674856522536 with a delay of 24ms, canQueue: true, calledMyself: false
+14ms ║RunTime initialize > 14 LockT > 1ms > r9T > 2ms > pistonT > 1ms (first state access 6 m:11 5 9)
+17ms ║Runtime (8860 bytes) initialized in 2ms (v0.3.114.20230113_HE)
+23ms ║╔Execution stage started
+40ms ║║Comparison (enum) on is (string) on = true (1ms)
+41ms ║║Comparison (enum) on is (string) on = true (1ms)
+42ms ║║Condition #9 evaluated true (11ms)
+43ms ║║Condition group #8 evaluated true (condition did not change) (12ms)
+44ms ║║Condition group #7 evaluated true (condition did not change) (13ms)
+218ms ║║Executed device command [Echo - Office Echo Show].setVolumeSpeakAndRestore(100.0,Please Close the Door,30.0) (167ms)
+224ms ║║Executed virtual command [Echo - Office Echo Show].wait [5000] (1ms)
+227ms ║║Requesting wake up at Fri, Jan 27 2023 @ 9:55:27 PM GMT (in 4999ms) for 11 (st:13)
+232ms ║╚Execution stage complete. (208ms)
+286ms ║Setting up scheduled job for Fri, Jan 27 2023 @ 9:55:27 PM GMT (in 4987ms)
+288ms ╚Event processed successfully (284ms)
27/01/2023, 21:55:17 +267ms
+3ms ╔Received event [Seafield Drive].time = 1674856517242 with a delay of 25ms, canQueue: true, calledMyself: false
+13ms ║RunTime initialize > 12 LockT > 0ms > r9T > 3ms > pistonT > 1ms (first state access 4 m:9 4 8)
+16ms ║Runtime (8853 bytes) initialized in 3ms (v0.3.114.20230113_HE)
+23ms ║╔Execution stage started
+28ms ║║Condition #3 evaluated true (1ms)
+36ms ║║Comparison (enum) off stays (string) on = false (1ms)
+39ms ║║Cancelling any timed trigger schedule stays result false cancel any timers for condition 4
+41ms ║║Condition #4 evaluated false (12ms)
+43ms ║║Condition group #2 evaluated true (condition changed) (16ms)
+45ms ║║Condition group #1 evaluated true (condition changed) (19ms)
+53ms ║║Calculating (integer)0 - (integer)1 >> (integer)-1
+58ms ║║Executed virtual command setVariable (2ms)
+67ms ║║Comparison (enum) on is (string) on = true (1ms)
+68ms ║║Comparison (enum) on is (string) on = true (1ms)
+70ms ║║Condition #9 evaluated true (10ms)
+72ms ║║Condition group #8 evaluated true (condition changed) (11ms)
+74ms ║║Condition group #7 evaluated true (condition changed) (14ms)
+263ms ║║Executed device command [Echo - Office Echo Show].setVolumeSpeakAndRestore(100.0,Please Close the Door,30.0) (181ms)
+269ms ║║Executed virtual command [Echo - Office Echo Show].wait [5000] (1ms)
+271ms ║║Requesting wake up at Fri, Jan 27 2023 @ 9:55:22 PM GMT (in 4998ms) for 11 (st:13)
+275ms ║╚Execution stage complete. (253ms)
+327ms ║Setting up scheduled job for Fri, Jan 27 2023 @ 9:55:22 PM GMT (in 4988ms)
+329ms ╚Event processed successfully (326ms)
27/01/2023, 21:55:12 +135ms
+4ms ╔Received event [Front Outer Door Contact Sensor].switch = on with a delay of 55ms, canQueue: true, calledMyself: false
+86ms ║RunTime initialize > 85 LockT > 1ms > r9T > 75ms > pistonT > 73ms (first state access 4 m:9 5 80)
+89ms ║Runtime (8661 bytes) initialized in 75ms (v0.3.114.20230113_HE)
+91ms ║╔Execution stage started
+99ms ║║Comparison (enum) on stays (string) on = true (1ms)
+101ms ║║Comparison (enum) on stays (string) on = true (1ms)
+110ms ║║Adding a timed trigger schedule stays result true scheduling timer for condition 3 wake up at Fri, Jan 27 2023 @ 9:55:17 PM GMT (in 4998ms) for 3 (st:3)
+112ms ║║Condition #3 evaluated false (16ms)
+120ms ║║Comparison (enum) off stays (string) on = false (2ms)
+124ms ║║Cancelling any timed trigger schedule stays result false cancel any timers for condition 4
+127ms ║║Condition #4 evaluated false (13ms)
+129ms ║║Condition group #2 evaluated false (condition did not change) (33ms)
+130ms ║║Condition group #1 evaluated false (condition did not change) (35ms)
+135ms ║╚Execution stage complete. (44ms)
+196ms ║Setting up scheduled job for Fri, Jan 27 2023 @ 9:55:17 PM GMT (in 4949ms)
+199ms ╚Event processed successfully (195ms)


#2

may need you to post a new green snapshot, as the one above seems garbled…


#3

Tried upgrading Webcore and also getting screenshot from Opera Edge and Chrome. Its all the same turns out garbled…
So I’ve used the clipping tool to grab it. Updated my post with the screenshot.


#4

It would good to have a view with the statement numbers visible.

05%20PM

Sometimes creating the green snap twice solves the issue on garble

@ipaterson ?


#5

On TCP

Please see:

https://wiki.webcore.co/Task_Cancellation_Policy

Note the statement:

54%20PM


#6

I actually do want that wait to be cancelled and then to skip onto the last section…


#7

I suggest you post again both the piston and what is wrong. (ie point it out in the logs).

I do see a condition canceling waits in your current logs…

Do make sure you are up to date on webCoRE. (if you are using user install on HE, hpm repair).


#8


This doesn’t look correct. What is “durationFriendly”? The parameters don’t look correct either. It should look something more like this:
setVolumeSpeakAndRestore(100, "Thank you. The door was left open for " duration " minutes. Please contribite two pounds to the heating bill.", 30)

That’s easiest to set using an expression. Just use quotes around the string parts and the variable will automagically be substituted just like it would if you were coding it.
image

But I also question why you have so many parameters in that function. Doesn’t it only take two? The volume and the statement? Isn’t it restoring back to the current volume?


#9

Hi Patsy Stone,

Thanks, I fixed that. There are some extra parameters but they’re just for visibility.

Durationfriendly in the amended version is a voice-friendly version of the duration e.g. “one minute and thirty two seconds”

I just cannot get that part to run. I’m still stuck with this Any ideas?


#10

This is a massively simplified version of the same piston. Can’t get this to work either.

It never outputs “The door is no longer open”.

Really I want the “wait” in the first block to cancel then then execute the last part.

Webcore really needs a “cleanup” section… like when a condition was true but no longer is.


#11

can you show logs?


#12

The reason that isn’t going to execute is because there is an IF statement that it is on. That is no longer true. Move the other action to execute after the LOOP lower and you will see that it works. Put it here:


#13

Also, FYI, you don’t need these to be separate:
image

You can do them under the same location setting like this
image


#14

I think you may need to bear in mind that if

Door switch changes to on

is true when a piston executes then

Door switch is on

will always be true during the same execution. The event takes priority over the current state when evaluating an is condition.