Piston fires even when restriction should prevent it - Part II


#1

1) Give a description of the problem
Statements in piston execute though they should be blocked by restriction.

2) What is the expected behaviour?
Statements should NOT execute.

3) What is happening/not happening?
See 1 & 2 above

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full – Sorry for the poor line spacing

Fourth run for scheduled trigger

Location mode is currently DAY

Turns lights off

6/19/2024, 5:40:06 AM +446ms

+6ms

╔Received event [Shoe’s].time = 1718793606388 with a delay of 58ms, canQueue: true, calledMyself: false

+24ms

║Runtime (16497 bytes) initialized 18 LockT > 1ms > r9T > 2ms > pistonT > 0ms (first state access 9 m:6 7 11) (v0.3.114.20240115_HE)

+32ms

║╔Execution stage started

+46ms

║║Condition #24 evaluated true (2ms)

+85ms

║║Comparison (enum) closed did_not_change = true (34ms)

+86ms

║║Condition #25 evaluated true (38ms)

+88ms

║║Condition group #23 evaluated true (condition changed) (43ms)

+90ms

║║Condition group #18 evaluated true (condition changed) (46ms)

+98ms

║║Command optimization: Skipped execution of device command [Cabinet Lights].off() because it would make no change to the device. (2ms)

+101ms

║║Command optimization: Skipped execution of device command [Fireplace Lights].off() because it would make no change to the device. (0ms)

+110ms

║║Calculating (string)Wed 6/19 5:40:06 + (string) - >> (string)Wed 6/19 5:40:06 -

+112ms

║║Calculating (string)Wed 6/19 5:40:06 - + (string)Bedroom Sensor >> (string)Wed 6/19 5:40:06 - Bedroom Sensor

+113ms

║║Calculating (string)Wed 6/19 5:40:06 - Bedroom Sensor + (string) triggered OFF :black_circle: >> (string)Wed 6/19 5:40:06 - Bedroom Sensor triggered OFF :black_circle:

+118ms

║║Piston state changed

+119ms

║║Executed virtual command [Cabinet Lights, Fireplace Lights].setState (1ms)

+123ms

║║Calculating (string)Bedroom Sensor + (string) triggered OFF :black_circle: >> (string)Bedroom Sensor triggered OFF :black_circle:

+126ms

║║Bedroom Sensor triggered OFF :black_circle:

+130ms

║║Executed virtual command [Cabinet Lights, Fireplace Lights].log (3ms)

+134ms

║╚Execution stage complete. (103ms)

+139ms

╚Event processed successfully (135ms)

Third run for scheduled triggers

Location mode is currently DAY

Sets new timed trigger for Wed, Jun 19 2024 @ 5:40:06 AM CDT

6/19/2024, 5:36:06 AM +170ms

+6ms

╔Received event [Shoe’s].time = 1718793366145 with a delay of 25ms, canQueue: true, calledMyself: false

+22ms

║Runtime (16365 bytes) initialized 17 LockT > 1ms > r9T > 2ms > pistonT > 0ms (first state access 8 m:6 7 10) (v0.3.114.20240115_HE)

+30ms

║╔Execution stage started

+45ms

║║Condition #21 evaluated true (2ms)

+157ms

║║Found matching value, duration 161521ms for is < 240000ms threshold = true

+158ms

║║Comparison (enum) inactive was (string) inactive = true (109ms)

+192ms

║║Found matching value, duration 32738752ms for is < 240000ms threshold = false

+193ms

║║Comparison (enum) inactive was (string) inactive = false (35ms)

+194ms

║║Condition #22 evaluated false (149ms)

+195ms

║║Condition group #20 evaluated false (condition did not change) (153ms)

+205ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+207ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+208ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+210ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+220ms

║║Adding a timed trigger schedule stays result true scheduling timer for condition 24 wake up at Wed, Jun 19 2024 @ 5:40:06 AM CDT (in 239998ms) for 24 (st:24)

+222ms

║║Condition #24 evaluated false (25ms)

+223ms

║║Condition group #23 evaluated false (condition did not change) (26ms)

+223ms

║║Condition group #18 evaluated false (condition did not change) (181ms)

+228ms

║╚Execution stage complete. (198ms)

+234ms

║Processing timer time = 1718793366149

+235ms

║╔Execution stage started

+247ms

║║Condition #21 evaluated true (0ms)

+289ms

║║Found matching value, duration 161658ms for is < 240000ms threshold = true

+290ms

║║Comparison (enum) inactive was (string) inactive = true (38ms)

+319ms

║║Found matching value, duration 32738879ms for is < 240000ms threshold = false

+320ms

║║Comparison (enum) inactive was (string) inactive = false (30ms)

+321ms

║║Condition #22 evaluated false (73ms)

+322ms

║║Condition group #20 evaluated false (condition did not change) (76ms)

+332ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+333ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+335ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+337ms

║║Comparison (enum) inactive stays (string) inactive = true (0ms)

+343ms

║║Doing nothing found timed trigger schedule stays result true found timer for condition 24

+344ms

║║Condition #24 evaluated false (21ms)

+345ms

║║Condition group #23 evaluated false (condition did not change) (22ms)

+346ms

║║Condition group #18 evaluated false (condition did not change) (100ms)

+350ms

║╚Execution stage complete. (115ms)

+356ms

║Processing timer time = 1718793366152

+357ms

║╔Execution stage started

+368ms

║║Condition #21 evaluated true (1ms)

+410ms

║║Found matching value, duration 161780ms for is < 240000ms threshold = true

+411ms

║║Comparison (enum) inactive was (string) inactive = true (38ms)

+441ms

║║Found matching value, duration 32739000ms for is < 240000ms threshold = false

+442ms

║║Comparison (enum) inactive was (string) inactive = false (30ms)

+443ms

║║Condition #22 evaluated false (73ms)

+444ms

║║Condition group #20 evaluated false (condition did not change) (76ms)

+453ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+455ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+456ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

Second run when motion sensor goes inactive

Location mode is currently DAY

3 timed triggers for Jun 19 2024 @ 5:36:06 AM CDT still in queue

6/19/2024, 5:33:24 AM +827ms

+4ms

╔Received event [Bedroom Sensor].motion = inactive with a delay of 30ms, canQueue: true, calledMyself: false

+21ms

║Runtime (16487 bytes) initialized 16 LockT > 0ms > r9T > 2ms > pistonT > 1ms (first state access 9 m:5 5 11) (v0.3.114.20240115_HE)

+23ms

║╔Execution stage started

+29ms

║║Comparison (enum) :32e164a2e42f34f83c6d5126248c9a8d: is (string) :db51cd17b1529242205547665623a183: = false (1ms)

+32ms

║║Condition #2 evaluated false (5ms)

+34ms

║║Condition group #1 evaluated false (condition changed) (7ms)

+38ms

║║Comparison (enum) :32e164a2e42f34f83c6d5126248c9a8d: is (string) :db51cd17b1529242205547665623a183: = false (0ms)

+40ms

║║Condition #19 evaluated false (6ms)

+41ms

║║Condition group #18 evaluated false (condition did not change) (7ms)

+46ms

║╚Execution stage complete. (23ms)

+140ms

║Setting up scheduled job for Wed, Jun 19 2024 @ 5:36:06 AM CDT (in 161243ms), with 2 more jobs pending

+142ms

╚Event processed successfully (138ms)

Hubitat log excerpt

App:1486 2024-06-19 05:31:06.548 AMinfo ║ Mode became Day from Night

App:946 2024-06-19 05:31:06.338 AMdebugReleased Lock and exiting

App:946 2024-06-19 05:31:06.177 AMwarn ║║ stays check stays isStays: true result: false options: [devices:[matched:[:e04d2faf96053e5556c56dd9a74dcde0:, :a50b8367be761b616503f003406c4554:, :bea7c04616599daf50d95a6459622cb3:], unmatched:[:c5302f51c1357b383e65b5c3b074dc1c:]], matches:true, forceAll:true]

App:946 2024-06-19 05:31:06.137 AMwarn ║║ stays check stays isStays: true result: true options: [devices:[matched:[:249f4ceacaed26fcec0f1c3da97f266d:, :635085f5f83511ac85d2722896cb5858:, :40dd9a4b70f5fd0d062af7de56919ea0:], unmatched:[]], matches:true, forceAll:true]

App:946 2024-06-19 05:31:06.085 AMinfo ║║ Bedroom Sensor triggered DAY mode 🟡

Dev:1496 2024-06-19 05:31:05.877 AMinfoBedroom Sensor motion became active

First run changes the location mode from NIGHT to DAY

Sets 3 timed triggers for Jun 19 2024 @ 5:36:06 AM CDT

6/19/2024, 5:31:05 AM +931ms

+7ms

╔Received event [Bedroom Sensor].motion = active with a delay of 51ms, canQueue: true, calledMyself: false

+24ms

║Runtime (16458 bytes) initialized 18 LockT > 1ms > r9T > 2ms > pistonT > 1ms (first state access 7 m:8 8 10) (v0.3.114.20240115_HE)

+25ms

║╔Execution stage started

+33ms

║║Comparison (enum) :db51cd17b1529242205547665623a183: is (string) :db51cd17b1529242205547665623a183: = true (1ms)

+36ms

║║Condition #2 evaluated true (7ms)

+38ms

║║Condition group #1 evaluated true (condition changed) (10ms)

+47ms

║║Comparison (enum) active changes_to (string) active = true (1ms)

+48ms

║║Condition #3 evaluated true (8ms)

+69ms

║║Comparison changes_to = false (event device/attr eXcluded)

+70ms

║║Comparison changes_to = false (event device/attr eXcluded)

+71ms

║║Comparison changes_to = false (event device/attr eXcluded)

+72ms

║║Comparison changes_to = false (event device/attr eXcluded)

+73ms

║║Condition #4 evaluated false (24ms)

+74ms

║║Condition group #1 evaluated true (condition did not change) (34ms)

+95ms

║║Comparison (time) 19866000 is_between (time) 19800000 … (time) 23100000 = true (8ms)

+97ms

║║Time restriction check passed

+98ms

║║Condition #6 evaluated true (24ms)

+100ms

║║Condition group #5 evaluated true (condition did not change) (25ms)

+111ms

║║Executed virtual command cancelTasks (6ms)

+115ms

║║Executed virtual command setVariable (3ms)

+128ms

║║Calculating (string)Wed 6/19 5:31:05 + (string) - >> (string)Wed 6/19 5:31:05 -

+132ms

║║Calculating (string)Wed 6/19 5:31:05 - + (string)Bedroom Sensor >> (string)Wed 6/19 5:31:05 - Bedroom Sensor

+134ms

║║Calculating (string)Wed 6/19 5:31:05 - Bedroom Sensor + (string) triggered DAY mode 🟡 >> (string)Wed 6/19 5:31:05 - Bedroom Sensor triggered DAY mode 🟡

+137ms

║║Piston state changed

+139ms

║║Executed virtual command setState (2ms)

+147ms

║║Calculating (string)Bedroom Sensor + (string) triggered DAY mode 🟡 >> (string)Bedroom Sensor triggered DAY mode 🟡

+152ms

║║Bedroom Sensor triggered DAY mode 🟡

+157ms

║║Executed virtual command log (6ms)

+174ms

║║Comparison (enum) :db51cd17b1529242205547665623a183: is (string) :db51cd17b1529242205547665623a183: = true (2ms)

+178ms

║║Condition #19 evaluated true (17ms)

+183ms

║║Condition group #18 evaluated true (condition changed) (21ms)

+199ms

║║Comparison (enum) closed stays (string) closed = true (2ms)

+202ms

║║Comparison (enum) closed stays (string) closed = true (1ms)

+205ms

║║Comparison (enum) closed stays (string) closed = true (2ms)

+217ms

║║Adding a timed trigger schedule stays match in list scheduling timer for device :249f4ceacaed26fcec0f1c3da97f266d: for condition 21 wake up at Wed, Jun 19 2024 @ 5:36:06 AM CDT (in 299998ms) for 21 (st:21 / :249f4ceacaed26fcec0f1c3da97f266d:)

+220ms

║║Adding a timed trigger schedule stays match in list scheduling timer for device :635085f5f83511ac85d2722896cb5858: for condition 21 wake up at Wed, Jun 19 2024 @ 5:36:06 AM CDT (in 299999ms) for 21 (st:21 / :635085f5f83511ac85d2722896cb5858:)

+224ms

║║Adding a timed trigger schedule stays match in list scheduling timer for device :40dd9a4b70f5fd0d062af7de56919ea0: for condition 21 wake up at Wed, Jun 19 2024 @ 5:36:06 AM CDT (in 299999ms) for 21 (st:21 / :40dd9a4b70f5fd0d062af7de56919ea0:)

+226ms

║║Condition #21 evaluated false (40ms)

+228ms

║║Condition group #20 evaluated false (condition did not change) (43ms)

+238ms

║║Comparison (enum) active stays (string) inactive = false (1ms)

+240ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+242ms

║║Comparison (enum) inactive stays (string) inactive = true (0ms)

+244ms

║║Comparison (enum) inactive stays (string) inactive = true (1ms)

+252ms

║║Cancel any timed trigger schedule stays result false cancel any timers for condition 24

+255ms

║║Condition #24 evaluated false (26ms)

+257ms

║║Condition group #23 evaluated false (condition changed) (29ms)

+260ms

║║Condition group #18 evaluated false (condition changed) (76ms)

+265ms

║╚Execution stage complete. (240ms)

+341ms

║Setting up scheduled job for Wed, Jun 19 2024 @ 5:36:06 AM CDT (in 299929ms), with 2 more jobs pending


#2

I don’t use “Only When” much. I would take that out and put “location mode is night” in your IF statements as a non-triggered condition.

IF
any of unknown
or
any of unknown
and
location mode is night


#3

Something to consider

  • this article describes:

  • This also means that mixing stays with other conditions like
    • if a is true and/or b stays open
    • is generally not a good idea, because on resume from the timer, some of the additional conditions may not be true any longer due to the wait for the timer

#4

Yes, I meant the first IF. I did not read further down and notice the “stays” in the second IF.