I’m not sure what’s happening here. It seems the held
and released
events are triggering the piston for both up and down, which works for my purposes. They’re all being caught via the Test 1 case because the light is on, but that’s ok (I think) as long as it causes my Test 6 or Test code to run.
So I made a stripped-down version that goes right to the hold checks, and it doesn’t even fire, though it appears to be subscribed to the same switch and shows the lightning bolt (I confirmed the switch itself is still on).
What did I miss here?
This works (I think):
6/10/2022, 6:18:27 PM +444ms
+1ms ╔Received event [Carport light new].button = down_released with a delay of 39ms
+54ms ║RunTime Analysis CS > 14ms > PS > 5ms > PE > 35ms > CE
+57ms ║Runtime (50133 bytes) successfully initialized in 5ms (v0.3.109.20181207) (55ms)
+58ms ║╔Execution stage started
+70ms ║║Comparison (enum) on is (string) on = true (1ms)
+72ms ║║Condition #2 evaluated true (9ms)
+73ms ║║Condition group #1 evaluated true (state did not change) (10ms)
+75ms ║║Cancelling statement #3's schedules...
+80ms ║║test 1
+81ms ║║Executed virtual command log (1ms)
+90ms ║║Calculating (string) "device: + (string) Carport light new >> (string) "device: Carport light new
+93ms ║║Calculating (string) "device: Carport light new + (string) , value: >> (string) "device: Carport light new, value:
+96ms ║║Calculating (string) "device: Carport light new, value: + (string) down_released >> (string) "device: Carport light new, value: down_released
+98ms ║║Calculating (string) "device: Carport light new, value: down_released + (string) " >> (string) "device: Carport light new, value: down_released"
+102ms ║║"device: Carport light new, value: down_released"
+103ms ║║Executed virtual command log (1ms)
+109ms ║║Calculating (string) "command: + (string) down_released >> (string) "command: down_released
+112ms ║║Calculating (string) "command: down_released + (string) " >> (string) "command: down_released"
+116ms ║║"command: down_released"
+117ms ║║Executed virtual command log (2ms)
+130ms ║║Comparison (enum) on is (string) off = false (2ms)
+132ms ║║Condition #7 evaluated false (11ms)
+133ms ║║Condition group #6 evaluated false (state did not change) (12ms)
+138ms ║║Comparison (enum) down_released gets (string) pushed = false (1ms)
+139ms ║║Condition #19 evaluated false (4ms)
+140ms ║║Condition group #18 evaluated false (state did not change) (5ms)
+146ms ║║Comparison (enum) down_released gets (string) pushed = false (0ms)
+147ms ║║Condition #25 evaluated false (4ms)
+148ms ║║Condition group #24 evaluated false (state did not change) (6ms)
+153ms ║║Comparison (enum) down_released gets (string) held = false (1ms)
+154ms ║║Condition #31 evaluated false (4ms)
+155ms ║║Condition group #30 evaluated false (state did not change) (5ms)
+161ms ║║Comparison (dynamic) down_released is (string) up_hold = false (1ms)
+163ms ║║Condition #37 evaluated false (5ms)
+164ms ║║Condition group #36 evaluated false (state did not change) (7ms)
+170ms ║║Comparison (dynamic) down_released is (string) down_hold = false (2ms)
+171ms ║║Cancelling condition #41's schedules...
+172ms ║║Condition #41 evaluated false (6ms)
+173ms ║║Cancelling condition #40's schedules...
+174ms ║║Condition group #40 evaluated false (state changed) (8ms)
+176ms ║╚Execution stage complete. (117ms)
+177ms ╚Event processed successfully (176ms)
6/10/2022, 6:18:26 PM +719ms
+1ms ╔Received event [Carport light new].button = down_hold with a delay of 39ms
+45ms ║RunTime Analysis CS > 16ms > PS > 4ms > PE > 25ms > CE
+49ms ║Runtime (50140 bytes) successfully initialized in 4ms (v0.3.109.20181207) (46ms)
+50ms ║╔Execution stage started
+63ms ║║Comparison (enum) on is (string) on = true (1ms)
+65ms ║║Condition #2 evaluated true (10ms)
+66ms ║║Condition group #1 evaluated true (state did not change) (12ms)
+68ms ║║Cancelling statement #3's schedules...
+73ms ║║test 1
+74ms ║║Executed virtual command log (2ms)
+82ms ║║Calculating (string) "device: + (string) Carport light new >> (string) "device: Carport light new
+85ms ║║Calculating (string) "device: Carport light new + (string) , value: >> (string) "device: Carport light new, value:
+88ms ║║Calculating (string) "device: Carport light new, value: + (string) down_hold >> (string) "device: Carport light new, value: down_hold
+90ms ║║Calculating (string) "device: Carport light new, value: down_hold + (string) " >> (string) "device: Carport light new, value: down_hold"
+94ms ║║"device: Carport light new, value: down_hold"
+94ms ║║Executed virtual command log (1ms)
+101ms ║║Calculating (string) "command: + (string) down_hold >> (string) "command: down_hold
+103ms ║║Calculating (string) "command: down_hold + (string) " >> (string) "command: down_hold"
+107ms ║║"command: down_hold"
+108ms ║║Executed virtual command log (1ms)
+118ms ║║Comparison (enum) on is (string) off = false (1ms)
+120ms ║║Condition #7 evaluated false (8ms)
+121ms ║║Condition group #6 evaluated false (state did not change) (10ms)
+126ms ║║Comparison (enum) down_hold gets (string) pushed = false (1ms)
+127ms ║║Condition #19 evaluated false (4ms)
+128ms ║║Condition group #18 evaluated false (state did not change) (5ms)
+133ms ║║Comparison (enum) down_hold gets (string) pushed = false (1ms)
+135ms ║║Condition #25 evaluated false (4ms)
+135ms ║║Condition group #24 evaluated false (state did not change) (5ms)
+141ms ║║Comparison (enum) down_hold gets (string) held = false (1ms)
+143ms ║║Condition #31 evaluated false (5ms)
+144ms ║║Condition group #30 evaluated false (state did not change) (6ms)
+150ms ║║Comparison (dynamic) down_hold is (string) up_hold = false (1ms)
+151ms ║║Condition #37 evaluated false (5ms)
+152ms ║║Condition group #36 evaluated false (state did not change) (6ms)
+159ms ║║Comparison (dynamic) down_hold is (string) down_hold = true (1ms)
+160ms ║║Cancelling condition #41's schedules...
+161ms ║║Condition #41 evaluated true (6ms)
+162ms ║║Cancelling condition #40's schedules...
+163ms ║║Condition group #40 evaluated true (state changed) (9ms)
+165ms ║║Cancelling statement #42's schedules...
+170ms ║║test 7 - down_hold detected
+171ms ║║Executed virtual command log (2ms)
+173ms ║╚Execution stage complete. (124ms)
+174ms ╚Event processed successfully (174ms)
6/10/2022, 6:18:24 PM +948ms
+1ms ╔Received event [Carport light new].button = up_released with a delay of 42ms
+55ms ║RunTime Analysis CS > 19ms > PS > 4ms > PE > 32ms > CE
+58ms ║Runtime (50128 bytes) successfully initialized in 4ms (v0.3.109.20181207) (56ms)
+59ms ║╔Execution stage started
+72ms ║║Comparison (enum) on is (string) on = true (2ms)
+73ms ║║Condition #2 evaluated true (10ms)
+74ms ║║Condition group #1 evaluated true (state did not change) (11ms)
+76ms ║║Cancelling statement #3's schedules...
+81ms ║║test 1
+82ms ║║Executed virtual command log (1ms)
+91ms ║║Calculating (string) "device: + (string) Carport light new >> (string) "device: Carport light new
+94ms ║║Calculating (string) "device: Carport light new + (string) , value: >> (string) "device: Carport light new, value:
+98ms ║║Calculating (string) "device: Carport light new, value: + (string) up_released >> (string) "device: Carport light new, value: up_released
+101ms ║║Calculating (string) "device: Carport light new, value: up_released + (string) " >> (string) "device: Carport light new, value: up_released"
+104ms ║║"device: Carport light new, value: up_released"
+105ms ║║Executed virtual command log (1ms)
+112ms ║║Calculating (string) "command: + (string) up_released >> (string) "command: up_released
+114ms ║║Calculating (string) "command: up_released + (string) " >> (string) "command: up_released"
+118ms ║║"command: up_released"
+119ms ║║Executed virtual command log (1ms)
+129ms ║║Comparison (enum) on is (string) off = false (1ms)
+131ms ║║Condition #7 evaluated false (9ms)
+132ms ║║Condition group #6 evaluated false (state did not change) (10ms)
+137ms ║║Comparison (enum) up_released gets (string) pushed = false (0ms)
+138ms ║║Condition #19 evaluated false (4ms)
+139ms ║║Condition group #18 evaluated false (state did not change) (5ms)
+144ms ║║Comparison (enum) up_released gets (string) pushed = false (1ms)
+145ms ║║Condition #25 evaluated false (4ms)
+146ms ║║Condition group #24 evaluated false (state did not change) (5ms)
+152ms ║║Comparison (enum) up_released gets (string) held = false (1ms)
+154ms ║║Condition #31 evaluated false (4ms)
+155ms ║║Condition group #30 evaluated false (state did not change) (6ms)
+160ms ║║Comparison (dynamic) up_released is (string) up_hold = false (1ms)
+162ms ║║Cancelling condition #37's schedules...
+163ms ║║Condition #37 evaluated false (5ms)
+164ms ║║Cancelling condition #36's schedules...
+165ms ║║Condition group #36 evaluated false (state changed) (7ms)
+170ms ║║Comparison (dynamic) up_released is (string) down_hold = false (1ms)
+172ms ║║Condition #41 evaluated false (5ms)
+173ms ║║Condition group #40 evaluated false (state did not change) (6ms)
+175ms ║╚Execution stage complete. (115ms)
+176ms ╚Event processed successfully (175ms)
6/10/2022, 6:18:24 PM +464ms
+1ms ╔Received event [Carport light new].button = up_hold with a delay of 47ms
+43ms ║RunTime Analysis CS > 15ms > PS > 4ms > PE > 24ms > CE
+46ms ║Runtime (50144 bytes) successfully initialized in 4ms (v0.3.109.20181207) (45ms)
+47ms ║╔Execution stage started
+59ms ║║Comparison (enum) on is (string) on = true (1ms)
+61ms ║║Condition #2 evaluated true (10ms)
+62ms ║║Condition group #1 evaluated true (state did not change) (10ms)
+64ms ║║Cancelling statement #3's schedules...
+69ms ║║test 1
+70ms ║║Executed virtual command log (1ms)
+78ms ║║Calculating (string) "device: + (string) Carport light new >> (string) "device: Carport light new
+81ms ║║Calculating (string) "device: Carport light new + (string) , value: >> (string) "device: Carport light new, value:
+83ms ║║Calculating (string) "device: Carport light new, value: + (string) up_hold >> (string) "device: Carport light new, value: up_hold
+86ms ║║Calculating (string) "device: Carport light new, value: up_hold + (string) " >> (string) "device: Carport light new, value: up_hold"
+89ms ║║"device: Carport light new, value: up_hold"
+90ms ║║Executed virtual command log (1ms)
+97ms ║║Calculating (string) "command: + (string) up_hold >> (string) "command: up_hold
+99ms ║║Calculating (string) "command: up_hold + (string) " >> (string) "command: up_hold"
+102ms ║║"command: up_hold"
+103ms ║║Executed virtual command log (1ms)
+114ms ║║Comparison (enum) on is (string) off = false (1ms)
+115ms ║║Condition #7 evaluated false (9ms)
+116ms ║║Condition group #6 evaluated false (state did not change) (11ms)
+122ms ║║Comparison (enum) up_hold gets (string) pushed = false (0ms)
+123ms ║║Condition #19 evaluated false (4ms)
+124ms ║║Condition group #18 evaluated false (state did not change) (6ms)
+133ms ║║Comparison (enum) up_hold gets (string) pushed = false (0ms)
+135ms ║║Condition #25 evaluated false (6ms)
+136ms ║║Condition group #24 evaluated false (state did not change) (9ms)
+143ms ║║Comparison (enum) up_hold gets (string) held = false (1ms)
+144ms ║║Condition #31 evaluated false (4ms)
+145ms ║║Condition group #30 evaluated false (state did not change) (6ms)
+152ms ║║Comparison (dynamic) up_hold is (string) up_hold = true (2ms)
+153ms ║║Cancelling condition #37's schedules...
+154ms ║║Condition #37 evaluated true (6ms)
+155ms ║║Cancelling condition #36's schedules...
+156ms ║║Condition group #36 evaluated true (state changed) (8ms)
+158ms ║║Cancelling statement #38's schedules...
+163ms ║║test 6 - up_hold detected
+164ms ║║Executed virtual command log (2ms)
+170ms ║║Comparison (dynamic) up_hold is (string) down_hold = false (1ms)
+171ms ║║Condition #41 evaluated false (4ms)
+172ms ║║Condition group #40 evaluated false (state did not change) (6ms)
+174ms ║╚Execution stage complete. (127ms)
+175ms ╚Event processed successfully (175ms)
This doesn’t:
Logs
The log is empty