Lights changing status when it should stay the same status


#1

1) Give a description of the problem
Lights are changing status when they should be staying the same when already on.

2) What is the expected behavior?
When my door unlocks i would like a few lights to turn on. If they are already on I would like them to keep the same status and not change or turn off.
3) What is happening/not happening?
Lights are turning on and turning off but the lights that are aready on are also turning off.
I did see this post to cancel the timer but then i run in to the issue of the lights not turning off.

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

5) Attach logs after turning logging level to Full
12/30/2020, 6:10:14 PM +752ms
+1ms â•”Received event [Living Room Switch].switch = off with a delay of 53ms
+61ms â•‘RunTime Analysis CS > 14ms > PS > 3ms > PE > 44ms > CE
+63ms â•‘Runtime (40342 bytes) successfully initialized in 3ms (v0.3.110.20191009) (61ms)
+64ms â•‘â•”Execution stage started
+76ms â•‘â•‘Comparison (enum) locked is (string) unlocked = false (1ms)
+77ms â•‘â•‘Condition #7 evaluated false (9ms)
+78ms â•‘â•‘Condition group #6 evaluated false (state did not change) (10ms)
+87ms â•‘â•‘Comparison (enum) locked is (string) unlocked = false (1ms)
+88ms â•‘â•‘Condition #16 evaluated false (8ms)
+89ms â•‘â•‘Condition group #15 evaluated false (state did not change) (9ms)
+98ms â•‘â•‘Comparison (enum) locked is (string) unlocked = false (1ms)
+99ms â•‘â•‘Condition #24 evaluated false (8ms)
+100ms â•‘â•‘Condition group #23 evaluated false (state did not change) (8ms)
+101ms â•‘â•šExecution stage complete. (37ms)
+102ms â•šEvent processed successfully (102ms)
12/30/2020, 6:02:14 PM +485ms
+2ms â•”Received event [Living Room Switch].switch = on with a delay of 69ms
+76ms â•‘RunTime Analysis CS > 17ms > PS > 5ms > PE > 54ms > CE
+79ms â•‘Runtime (40341 bytes) successfully initialized in 5ms (v0.3.110.20191009) (77ms)
+80ms â•‘â•”Execution stage started
+94ms â•‘â•‘Comparison (enum) locked is (string) unlocked = false (1ms)
+95ms â•‘â•‘Condition #7 evaluated false (12ms)
+96ms â•‘â•‘Condition group #6 evaluated false (state did not change) (13ms)
+105ms â•‘â•‘Comparison (enum) locked is (string) unlocked = false (1ms)
+107ms â•‘â•‘Condition #16 evaluated false (8ms)
+107ms â•‘â•‘Condition group #15 evaluated false (state did not change) (9ms)
+117ms â•‘â•‘Comparison (enum) locked is (string) unlocked = false (2ms)
+118ms â•‘â•‘Condition #24 evaluated false (8ms)
+119ms â•‘â•‘Condition group #23 evaluated false (state did not change) (10ms)
+121ms â•‘â•šExecution stage complete. (42ms)
+122ms â•šEvent processed successfully (122ms)


#2

It looks like your piston should work, but I’m not confident in adjustments to the execution policies.

Here is what I’d try, so I could avoid adjusting the execution policies:

Here are the logs from my test:

The timers are all set to 1 minutes for testing purposes.

Later ponderings: Instead of a single piston controlling all three bulbs, could we make 3 pistons that use a variable to decide which bulb to control? This has lots of duplicate code, and feels like it needs a for loop of some kind.


#3

Trying out what you put together, Thanks!
Just starting to get in to more complex pistons so I am sure there is a better way to do things. Separating them out could make sense too. Could make sure they run without tripping over the other variables.


#4

It’s like art - sometimes you just have to stop when it does what you need and say “It’s done.”