Ok I think I’m getting closer to what I want to do but I’m running into some more trouble I can’t figure out. I tried editing the piston given to me by @whoismoses (which I understand WHY it works, thank you
) to incorporate the variable aspects of the sample I posted and I can’t understand why it’s not working correctly. Here’s what happens:
From an everything off state, turning Workout on turns all three lights on, but the stairway does not timeout. Then, turning Workout off does nothing. With all three lights still on from the initial turn on, turning Workout on again does nothing to the Gym and Studio (as expected), but now the Stairway does properly timeout. Turning Workout off from here behaves properly (Stairway turns on and everything times out after 5 seconds)
I think it’s an order of operations or something not being set correctly but I’ve been at it a few hours and can’t see where the problem is. @Cozdabuch I’ll take you up on your advice now
Hopefully exactly WHAT I’m trying to do is a little clearer seeing my attempt:
https://imgur.com/fBeljCt
And I found logs! Here’s me turning the Workout virtual switch on, waiting a minute, then turning it off. Stairway light timeout broke and I can’t see why, and something (state not properly changing?) is preventing it from shutting off properly.
10/3/2017, 11:12:00 PM +256ms
+1ms ╔Received event [Workout].switch = off with a delay of 57ms
+106ms ║RunTime Analysis CS > 14ms > PS > 46ms > PE > 46ms > CE
+114ms ║Runtime (40538 bytes) successfully initialized in 46ms (v0.2.0ec.20170927) (111ms)
+114ms ║╔Execution stage started
+124ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+125ms ║║Condition #10 evaluated false (6ms)
+125ms ║║Condition group #1 evaluated false (state did not change) (6ms)
+132ms ║║Comparison (enum) off changes_to (string) off = true (1ms)
+133ms ║║Cancelling condition #21’s schedules…
+133ms ║║Condition #21 evaluated true (6ms)
+136ms ║║Comparison (boolean) false is (boolean) true = false (1ms)
+136ms ║║Condition #23 evaluated false (3ms)
+137ms ║║Condition group #11 evaluated false (state did not change) (10ms)
+153ms ║║Condition #27 evaluated false (14ms)
+154ms ║║Condition group #24 evaluated false (state did not change) (16ms)
+155ms ║╚Execution stage complete. (41ms)
+162ms ╚Event processed successfully (162ms)
10/3/2017, 11:10:02 PM +752ms
+2ms ╔Received event [Studio Lights].switch = on with a delay of 710ms
+10015ms ║RunTime Analysis CS > 20ms > PS > 9952ms > PE > 43ms > CE
+10022ms ║Piston waited at a semaphore for 9905ms
+10024ms ║Runtime (40620 bytes) successfully initialized in 9952ms (v0.2.0ec.20170927) (10022ms)
+10024ms ║╔Execution stage started
+10039ms ║║Condition #10 evaluated false (10ms)
+10039ms ║║Condition group #1 evaluated false (state did not change) (10ms)
+10048ms ║║Condition #21 evaluated false (7ms)
+10048ms ║║Condition group #11 evaluated false (state did not change) (7ms)
+10061ms ║║Comparison (enum) on changes_to (string) off = false (0ms)
+10062ms ║║Condition #27 evaluated false (12ms)
+10063ms ║║Condition group #24 evaluated false (state did not change) (13ms)
+10064ms ║╚Execution stage complete. (40ms)
+10071ms ╚Event processed successfully (10071ms)
10/3/2017, 11:10:02 PM +614ms
+0ms ╔Received event [Gym Lights].switch = on with a delay of 717ms
+80ms ║RunTime Analysis CS > 14ms > PS > 29ms > PE > 38ms > CE
+91ms ║Runtime (40536 bytes) successfully initialized in 29ms (v0.2.0ec.20170927) (89ms)
+91ms ║╔Execution stage started
+101ms ║║Cancelling condition #10’s schedules…
+102ms ║║Condition #10 evaluated false (6ms)
+102ms ║║Cancelling condition #1’s schedules…
+103ms ║║Condition group #1 evaluated false (state changed) (7ms)
+110ms ║║Condition #21 evaluated false (5ms)
+110ms ║║Condition group #11 evaluated false (state did not change) (6ms)
+119ms ║║Comparison (enum) on changes_to (string) off = false (0ms)
+120ms ║║Cancelling condition #27’s schedules…
+120ms ║║Condition #27 evaluated false (8ms)
+121ms ║║Cancelling condition #24’s schedules…
+121ms ║║Condition group #24 evaluated false (state changed) (9ms)
+123ms ║╚Execution stage complete. (32ms)
+132ms ╚Event processed successfully (132ms)
10/3/2017, 11:10:02 PM +197ms
+0ms ╔Received event [Workout].switch = on with a delay of 50ms
+75ms ║RunTime Analysis CS > 10ms > PS > 30ms > PE > 36ms > CE
+84ms ║Runtime (40535 bytes) successfully initialized in 30ms (v0.2.0ec.20170927) (83ms)
+84ms ║╔Execution stage started
+91ms ║║Comparison (enum) on changes_to (string) on = true (0ms)
+92ms ║║Cancelling condition #10’s schedules…
+93ms ║║Condition #10 evaluated true (4ms)
+93ms ║║Cancelling condition #1’s schedules…
+93ms ║║Condition group #1 evaluated true (state changed) (5ms)
+95ms ║║Cancelling statement #8’s schedules…
+110ms ║║Executed physical command [Gym Lights].on() (13ms)
+111ms ║║Executed [Gym Lights].on (15ms)
+125ms ║║Executed physical command [Studio Lights].on() (13ms)
+125ms ║║Executed [Studio Lights].on (13ms)
+145ms ║║Comparison (datetime) 1507086602146 is_between (datetime) 1507070820000 … (datetime) 1507028940000 = true (2ms)
+146ms ║║Condition #7 evaluated true (19ms)
+146ms ║║Condition group #2 evaluated true (state did not change) (19ms)
+148ms ║║Cancelling statement #3’s schedules…
+164ms ║║Executed physical command [Stairway Light].on() (14ms)
+164ms ║║Executed [Stairway Light].on (15ms)
+166ms ║║Executed virtual command [Stairway Light].wait (0ms)
+167ms ║║Requesting a wake up for Tue, Oct 3 2017 @ 11:10:07 PM EDT (in 5.0s)
+171ms ║╚Execution stage complete. (86ms)
+172ms ║Setting up scheduled job for Tue, Oct 3 2017 @ 11:10:07 PM EDT (in 4.996s)
+191ms ╚Event processed successfully (191ms)
Thank you for any and all help. Really enjoying playing around with this.