Vacation Mode Piston Help


#1

1) Give a description of the problem
The Manage Vacation Mode piston is not waiting 4 hours when all presence detectors (iPhones) are listed as Not Present. The piston appears to execute when a presence detector state changes, but does not appear to correctly evaluate that all presence detectors are not present and thus begin the transition to vacation mode. That transition begins with a 4 hour wait to ensure presence detectors are not just running local errands, and then lowers/raises heating/cooling setpoints on the thermostats. From the logs, it appears the piston never correctly assesses all presence detectors not present, even when that condition is true (all presence detectors are not present).

2) What is the expected behaviour?
I expect the log to reflect some type of indication that the piston is waiting, possibly a scheduling message as to when the piston will be woken up, but certainly not messages that declare all conditions are false and the piston executed successfully.

3) What is happening/not happening?
Location mode never changes to Away after the required wait time, and thermostat setpoints don’t change to minimize energy usage.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
11/4/2019, 6:28:02 AM +426ms
+1ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 72ms
+10248ms â•‘RunTime Analysis CS > 23ms > PS > 10162ms > PE > 64ms > CE
+10249ms â•‘Piston waited at a semaphore for 10020ms
+10252ms â•‘Runtime (50204 bytes) successfully initialized in 10162ms (v0.3.10e.20190628) (10250ms)
+10253ms â•‘â•”Execution stage started
+10258ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+10259ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+10261ms ║╚Execution stage complete. (8ms)
+10262ms ╚Event processed successfully (10262ms)
11/4/2019, 6:28:02 AM +424ms
+2ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 69ms
+232ms â•‘RunTime Analysis CS > 22ms > PS > 151ms > PE > 58ms > CE
+234ms â•‘Runtime (50126 bytes) successfully initialized in 151ms (v0.3.10e.20190628) (232ms)
+235ms â•‘â•”Execution stage started
+240ms â•‘â•‘Condition group #6 evaluated false (state did not change) (1ms)
+241ms â•‘â•‘Condition group #1 evaluated false (state did not change) (1ms)
+242ms ║╚Execution stage complete. (7ms)
+243ms ╚Event processed successfully (243ms)
11/3/2019, 7:16:06 PM +28ms
+1ms ╔Received event [Andrew’s iPhone].presence = present with a delay of 72ms
+434ms â•‘RunTime Analysis CS > 28ms > PS > 351ms > PE > 56ms > CE
+437ms â•‘Runtime (50122 bytes) successfully initialized in 351ms (v0.3.10e.20190628) (435ms)
+439ms â•‘â•”Execution stage started
+444ms â•‘â•‘Condition group #6 evaluated false (state did not change) (1ms)
+445ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+447ms ║╚Execution stage complete. (8ms)
+448ms ╚Event processed successfully (448ms)
11/3/2019, 3:54:58 PM +736ms
+2ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 67ms
+229ms â•‘RunTime Analysis CS > 23ms > PS > 146ms > PE > 60ms > CE
+232ms â•‘Runtime (50126 bytes) successfully initialized in 146ms (v0.3.10e.20190628) (229ms)
+233ms â•‘â•”Execution stage started
+238ms â•‘â•‘Condition group #6 evaluated false (state did not change) (1ms)
+239ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+240ms ║╚Execution stage complete. (7ms)
+241ms ╚Event processed successfully (241ms)
11/3/2019, 2:04:38 PM +417ms
+2ms ╔Received event [Andrew’s iPhone].presence = present with a delay of 69ms
+227ms â•‘RunTime Analysis CS > 23ms > PS > 152ms > PE > 51ms > CE
+230ms â•‘Runtime (50122 bytes) successfully initialized in 152ms (v0.3.10e.20190628) (227ms)
+231ms â•‘â•”Execution stage started
+235ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+236ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+238ms ║╚Execution stage complete. (7ms)
+239ms ╚Event processed successfully (239ms)
11/3/2019, 9:55:23 AM +963ms
+1ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 254ms
+391ms â•‘RunTime Analysis CS > 38ms > PS > 295ms > PE > 59ms > CE
+394ms â•‘Runtime (50127 bytes) successfully initialized in 295ms (v0.3.10e.20190628) (392ms)
+395ms â•‘â•”Execution stage started
+400ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+401ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+403ms ║╚Execution stage complete. (8ms)
+404ms ╚Event processed successfully (404ms)
11/3/2019, 9:08:54 AM +945ms
+1ms ╔Received event [Andrew’s iPhone].presence = present with a delay of 73ms
+246ms â•‘RunTime Analysis CS > 20ms > PS > 175ms > PE > 52ms > CE
+249ms â•‘Runtime (50122 bytes) successfully initialized in 175ms (v0.3.10e.20190628) (247ms)
+250ms â•‘â•”Execution stage started
+255ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+256ms â•‘â•‘Condition group #1 evaluated false (state did not change) (1ms)
+257ms ║╚Execution stage complete. (7ms)
+258ms ╚Event processed successfully (258ms)
11/2/2019, 5:49:15 PM +273ms
+2ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 68ms
+218ms â•‘RunTime Analysis CS > 23ms > PS > 142ms > PE > 52ms > CE
+220ms â•‘Runtime (50126 bytes) successfully initialized in 142ms (v0.3.10e.20190628) (217ms)
+221ms â•‘â•”Execution stage started
+226ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+227ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+229ms ║╚Execution stage complete. (8ms)
+230ms ╚Event processed successfully (230ms)
11/2/2019, 4:51:04 PM +422ms
+2ms ╔Received event [Andrew’s iPhone].presence = present with a delay of 72ms
+375ms â•‘RunTime Analysis CS > 22ms > PS > 298ms > PE > 54ms > CE
+378ms â•‘Runtime (50122 bytes) successfully initialized in 298ms (v0.3.10e.20190628) (375ms)
+379ms â•‘â•”Execution stage started
+384ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+385ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+386ms ║╚Execution stage complete. (8ms)
+387ms ╚Event processed successfully (387ms)
11/2/2019, 4:04:54 PM +345ms
+2ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 99ms
+239ms â•‘RunTime Analysis CS > 31ms > PS > 156ms > PE > 56ms > CE
+242ms â•‘Runtime (50126 bytes) successfully initialized in 156ms (v0.3.10e.20190628) (239ms)
+243ms â•‘â•”Execution stage started
+248ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+249ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+251ms ║╚Execution stage complete. (8ms)
+252ms ╚Event processed successfully (256ms)
11/2/2019, 2:50:51 PM +66ms
+1ms ╔Received event [Andrew’s iPhone].presence = present with a delay of 73ms
+229ms â•‘RunTime Analysis CS > 24ms > PS > 153ms > PE > 53ms > CE
+232ms â•‘Runtime (50122 bytes) successfully initialized in 153ms (v0.3.10e.20190628) (230ms)
+233ms â•‘â•”Execution stage started
+238ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+239ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+241ms ║╚Execution stage complete. (8ms)
+242ms ╚Event processed successfully (243ms)
11/2/2019, 12:34:10 PM +89ms
+1ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 67ms
+234ms â•‘RunTime Analysis CS > 37ms > PS > 147ms > PE > 50ms > CE
+236ms â•‘Runtime (50126 bytes) successfully initialized in 147ms (v0.3.10e.20190628) (234ms)
+237ms â•‘â•”Execution stage started
+242ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+243ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+245ms ║╚Execution stage complete. (8ms)
+246ms ╚Event processed successfully (247ms)
11/1/2019, 1:46:40 PM +68ms
+1ms ╔Received event [Andrew’s iPhone].presence = present with a delay of 73ms
+240ms â•‘RunTime Analysis CS > 22ms > PS > 162ms > PE > 56ms > CE
+243ms â•‘Runtime (50122 bytes) successfully initialized in 162ms (v0.3.10e.20190628) (241ms)
+244ms â•‘â•”Execution stage started
+249ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+250ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+252ms ║╚Execution stage complete. (8ms)
+253ms ╚Event processed successfully (253ms)
11/1/2019, 6:35:14 AM +572ms
+2ms ╔Received event [Andrew’s iPhone].presence = not present with a delay of 76ms
+235ms â•‘RunTime Analysis CS > 24ms > PS > 152ms > PE > 59ms > CE
+238ms â•‘Runtime (50126 bytes) successfully initialized in 152ms (v0.3.10e.20190628) (236ms)
+239ms â•‘â•”Execution stage started
+244ms â•‘â•‘Condition group #6 evaluated false (state did not change) (0ms)
+245ms â•‘â•‘Condition group #1 evaluated false (state did not change) (2ms)
+247ms ║╚Execution stage complete. (8ms)
+248ms ╚Event processed successfully (248ms)

In all above logs, Matt’s iPhone and Barbara’s iPhone were always AWAY. Andrew’s leaving should have triggered the WAIT for managing vacation mode.


#2

If you turn on Trace, then the following will make more sense:


#3

Sorry about that…


#4

Maybe delete the empty ONLY WHEN on lines 17-19… (condition group #6)


#5

I can’t figure out how to do that. I go to edit mode, but I can’t seem to edit what’s already there. I can’t even seem to add new code anywhere. Do I have to type the whole thing in again?


#6

Movement%20handle

Click on the handle of your IF and drag everything outside of your “only when”. Then you can click on the “only when” and delete it.


#7

Thank you. It was a little difficult trying to keep track of which blocks of code were moving where. I finally decided to just re-enter everything from scratch. I used the On Event to trigger the piston to run and then check for the condition where all three presence sensors are not present. So far, everything seems to be working. Here’s the new code:

11/4/2019, 1:29:24 PM +999ms
+2ms ╔Received event [Andrew’s iPhone].presence = present with a delay of 68ms
+218ms â•‘RunTime Analysis CS > 22ms > PS > 172ms > PE > 23ms > CE
+221ms â•‘Runtime (49766 bytes) successfully initialized in 172ms (v0.3.10e.20190628) (218ms)
+222ms â•‘â•”Execution stage started
+236ms â•‘â•‘Comparison (enum) not present is (string) not present = true (2ms)
+238ms â•‘â•‘Condition #6 evaluated true (8ms)
+246ms â•‘â•‘Comparison (enum) not present is (string) not present = true (1ms)
+247ms â•‘â•‘Condition #7 evaluated true (9ms)
+252ms â•‘â•‘Comparison (enum) present is (string) not present = false (2ms)
+253ms ║║Cancelling condition #8’s schedules…
+254ms â•‘â•‘Condition #8 evaluated false (6ms)
+255ms ║║Cancelling condition #5’s schedules…
+256ms â•‘â•‘Condition group #5 evaluated false (state changed) (28ms)
+263ms â•‘â•‘Comparison (dynamic) Home is (string) Away = false (1ms)
+264ms â•‘â•‘Condition #11 evaluated false (5ms)
+269ms â•‘â•‘Comparison (dynamic) Home is (string) Away-Extended Absence = false (1ms)
+270ms â•‘â•‘Condition #12 evaluated false (5ms)
+271ms â•‘â•‘Condition group #10 evaluated false (state did not change) (12ms)
+272ms â•‘â•‘Condition group #9 evaluated false (state did not change) (14ms)
+283ms â•‘â•‘Comparison (enum) off is (string) off = true (2ms)
+285ms â•‘â•‘Condition #14 evaluated true (9ms)
+286ms â•‘â•‘Condition group #13 evaluated true (state did not change) (11ms)
+288ms ║║Cancelling statement #20’s schedules…
+290ms â•‘â•‘Executed virtual command cancelTasks (1ms)
+344ms â•‘â•‘Executed virtual command setLocationMode (51ms)
+349ms â•‘â•‘Executed virtual command setVariable (1ms)
+353ms â•‘â•‘Executed virtual command setVariable (1ms)
+359ms ║╚Execution stage complete. (137ms)
+360ms ╚Event processed successfully (360ms)


#8

One trick to this is to first left click to the right of any text, and notice which code becomes highlighted in the margins… Once you have the right “block” selected, then grab the handles to drag to the new position.