Synchronizing Lights/Switches -- One Switch Doesn't Trigger Event


#1

1) Give a description of the problem
I’m trying to synchronize two switches. It works when I use one switch, but not the other.

2) What is the expected behavior?
When one is on, it turns the other one on. When one is turned off, the other is turned off.

3) What is happening/not happening?
If I use the one switch (Porch Light), everything works as expected. If I used the other switch (Garage Lights), the switch operates as if independent of the other switch. It appears that a trigger event is not being received by webCoRE when the Garage Lights switch is PHYSICALLY changed. If I change the Garage Lights switch from the app, it operates correctly. The logs show the switches being physically adjusted except during the 6:14 time. At that time, the garage lights were turned on and off with the ST app.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
1/28/2018, 6:14:56 PM +123ms
+1ms ╔Received event [Porch Light].switch = off with a delay of 87ms
+109ms ║RunTime Analysis CS > 14ms > PS > 30ms > PE > 65ms > CE
+111ms ║Runtime (37322 bytes) successfully initialized in 30ms (v0.2.101.20171227) (109ms)
+112ms ║╔Execution stage started
+123ms ║║Comparison (enum) off changes_to (string) on = false (0ms)
+125ms ║║Condition #2 evaluated false (8ms)
+126ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+132ms ║║Comparison (enum) off changes_to (string) off = true (1ms)
+133ms ║║Condition #8 evaluated true (6ms)
+134ms ║║Condition group #3 evaluated true (state did not change) (8ms)
+136ms ║║Cancelling statement #6’s schedules…
+141ms ║║Skipped execution of physical command [Garage Lights].off([]) because it would make no change to the device. (3ms)
+142ms ║║Executed [Garage Lights].off (4ms)
+144ms ║║Skipped execution of physical command [Porch Light].off([]) because it would make no change to the device. (0ms)
+145ms ║║Executed [Porch Light].off (2ms)
+147ms ║╚Execution stage complete. (35ms)
+148ms ╚Event processed successfully (148ms)
1/28/2018, 6:14:55 PM +685ms
+2ms ╔Received event [Garage Lights].switch = off with a delay of 74ms
+121ms ║RunTime Analysis CS > 15ms > PS > 39ms > PE > 67ms > CE
+124ms ║Runtime (37318 bytes) successfully initialized in 39ms (v0.2.101.20171227) (121ms)
+124ms ║╔Execution stage started
+135ms ║║Comparison (enum) off changes_to (string) on = false (0ms)
+137ms ║║Cancelling condition #2’s schedules…
+138ms ║║Condition #2 evaluated false (9ms)
+139ms ║║Cancelling condition #1’s schedules…
+139ms ║║Condition group #1 evaluated false (state changed) (10ms)
+146ms ║║Comparison (enum) off changes_to (string) off = true (1ms)
+147ms ║║Condition #8 evaluated true (7ms)
+148ms ║║Condition group #3 evaluated true (state did not change) (8ms)
+150ms ║║Cancelling statement #6’s schedules…
+154ms ║║Skipped execution of physical command [Garage Lights].off([]) because it would make no change to the device. (0ms)
+154ms ║║Executed [Garage Lights].off (2ms)
+177ms ║║Executed physical command [Porch Light].off() (21ms)
+177ms ║║Executed [Porch Light].off (22ms)
+180ms ║╚Execution stage complete. (55ms)
+181ms ╚Event processed successfully (180ms)
1/28/2018, 6:14:09 PM +149ms
+2ms ╔Received event [Garage Lights].switch = on with a delay of 79ms
+128ms ║RunTime Analysis CS > 17ms > PS > 43ms > PE > 68ms > CE
+130ms ║Runtime (37318 bytes) successfully initialized in 43ms (v0.2.101.20171227) (128ms)
+131ms ║╔Execution stage started
+147ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+149ms ║║Condition #2 evaluated true (12ms)
+149ms ║║Condition group #1 evaluated true (state did not change) (14ms)
+151ms ║║Cancelling statement #4’s schedules…
+155ms ║║Skipped execution of physical command [Garage Lights].on([]) because it would make no change to the device. (0ms)
+156ms ║║Executed [Garage Lights].on (2ms)
+159ms ║║Skipped execution of physical command [Porch Light].on([]) because it would make no change to the device. (2ms)
+160ms ║║Executed [Porch Light].on (4ms)
+162ms ║╚Execution stage complete. (31ms)
+163ms ╚Event processed successfully (163ms)
1/28/2018, 5:55:28 PM +665ms
+1ms ╔Received event [Porch Light].switch = on with a delay of 66ms
+123ms ║RunTime Analysis CS > 15ms > PS > 37ms > PE > 71ms > CE
+125ms ║Runtime (37322 bytes) successfully initialized in 37ms (v0.2.101.20171227) (123ms)
+126ms ║╔Execution stage started
+138ms ║║Comparison (enum) on changes_to (string) on = true (0ms)
+139ms ║║Cancelling condition #2’s schedules…
+140ms ║║Condition #2 evaluated true (9ms)
+141ms ║║Cancelling condition #1’s schedules…
+141ms ║║Condition group #1 evaluated true (state changed) (11ms)
+144ms ║║Cancelling statement #4’s schedules…
+176ms ║║Executed physical command [Garage Lights].on() (30ms)
+177ms ║║Executed [Garage Lights].on (31ms)
+179ms ║║Skipped execution of physical command [Porch Light].on([]) because it would make no change to the device. (0ms)
+180ms ║║Executed [Porch Light].on (2ms)
+183ms ║╚Execution stage complete. (57ms)
+184ms ╚Event processed successfully (183ms)
1/28/2018, 5:53:48 PM +879ms
+1ms ╔Received event [Garage Lights].switch = off with a delay of 64ms
+117ms ║RunTime Analysis CS > 15ms > PS > 36ms > PE > 67ms > CE
+119ms ║Runtime (37324 bytes) successfully initialized in 36ms (v0.2.101.20171227) (117ms)
+120ms ║╔Execution stage started
+132ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+134ms ║║Condition #2 evaluated false (8ms)
+135ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+141ms ║║Comparison (enum) off changes_to (string) off = true (1ms)
+142ms ║║Condition #8 evaluated true (6ms)
+143ms ║║Condition group #3 evaluated true (state did not change) (8ms)
+145ms ║║Cancelling statement #6’s schedules…
+149ms ║║Skipped execution of physical command [Garage Lights].off([]) because it would make no change to the device. (1ms)
+150ms ║║Executed [Garage Lights].off (1ms)
+154ms ║║Skipped execution of physical command [Porch Light].off([]) because it would make no change to the device. (3ms)
+155ms ║║Executed [Porch Light].off (4ms)
+157ms ║╚Execution stage complete. (37ms)
+158ms ╚Event processed successfully (158ms)
1/28/2018, 5:53:44 PM +44ms
+1ms ╔Received event [Porch Light].switch = off with a delay of 74ms
+120ms ║RunTime Analysis CS > 14ms > PS > 39ms > PE > 67ms > CE
+122ms ║Runtime (37318 bytes) successfully initialized in 39ms (v0.2.101.20171227) (120ms)
+123ms ║╔Execution stage started
+135ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+137ms ║║Cancelling condition #2’s schedules…
+138ms ║║Condition #2 evaluated false (9ms)
+138ms ║║Cancelling condition #1’s schedules…
+139ms ║║Condition group #1 evaluated false (state changed) (11ms)
+146ms ║║Comparison (enum) off changes_to (string) off = true (0ms)
+148ms ║║Cancelling condition #8’s schedules…
+149ms ║║Condition #8 evaluated true (8ms)
+150ms ║║Cancelling condition #3’s schedules…
+150ms ║║Condition group #3 evaluated true (state changed) (10ms)
+152ms ║║Cancelling statement #6’s schedules…
+181ms ║║Executed physical command [Garage Lights].off() (27ms)
+182ms ║║Executed [Garage Lights].off (27ms)
+184ms ║║Skipped execution of physical command [Porch Light].off([]) because it would make no change to the device. (0ms)
+185ms ║║Executed [Porch Light].off (2ms)
+188ms ║╚Execution stage complete. (64ms)
+189ms ╚Event processed successfully (188ms)
1/28/2018, 5:53:42 PM +12ms
+1ms ╔Received event [Garage Lights].switch = on with a delay of 76ms
+119ms ║RunTime Analysis CS > 15ms > PS > 37ms > PE > 68ms > CE
+121ms ║Runtime (37320 bytes) successfully initialized in 37ms (v0.2.101.20171227) (119ms)
+122ms ║╔Execution stage started
+134ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+135ms ║║Condition #2 evaluated true (9ms)
+136ms ║║Condition group #1 evaluated true (state did not change) (10ms)
+138ms ║║Cancelling statement #4’s schedules…
+142ms ║║Skipped execution of physical command [Garage Lights].on([]) because it would make no change to the device. (0ms)
+142ms ║║Executed [Garage Lights].on (2ms)
+145ms ║║Skipped execution of physical command [Porch Light].on([]) because it would make no change to the device. (2ms)
+146ms ║║Executed [Porch Light].on (3ms)
+148ms ║╚Execution stage complete. (26ms)
+149ms ╚Event processed successfully (149ms)
1/28/2018, 5:53:37 PM +641ms
+0ms ╔Received event [Porch Light].switch = on with a delay of 61ms
+106ms ║RunTime Analysis CS > 11ms > PS > 24ms > PE > 71ms > CE
+108ms ║Runtime (37324 bytes) successfully initialized in 24ms (v0.2.101.20171227) (107ms)
+109ms ║╔Execution stage started
+120ms ║║Comparison (enum) on changes_to (string) on = true (0ms)
+122ms ║║Cancelling condition #2’s schedules…
+123ms ║║Condition #2 evaluated true (8ms)
+124ms ║║Cancelling condition #1’s schedules…
+124ms ║║Condition group #1 evaluated true (state changed) (11ms)
+126ms ║║Cancelling statement #4’s schedules…
+152ms ║║Executed physical command [Garage Lights].on() (24ms)
+153ms ║║Executed [Garage Lights].on (25ms)
+155ms ║║Skipped execution of physical command [Porch Light].on([]) because it would make no change to the device. (0ms)
+156ms ║║Executed [Porch Light].on (2ms)
+158ms ║╚Execution stage complete. (50ms)
+159ms ╚Event processed successfully (160ms)


#2

Yeah, I’m not sure about this one… There’s all sorts of possibility here for this piston to loop back into itself and that can often cause issues. I actually do something similar to what you’ve got going here but I use the Smart Lighting app rather than a WC piston. However, if you want to continue down the WC path then maybe give what I’m showing below a try.

It’s a cleaner way…and saves you some code. However, if this does not work then I think you’ll need to figure out why your one switch is not sending events when it gets turned on physically. With this piston you could comment out one of them and then just try it against the one you’ve been having issues with. That way you can see if there’s a problem just getting the switch to send events. If the switch does not do that…then there’s nothing a WC piston is going to do to fix that.


#3

Thank you so much for the quick reply! I just imported your code and got the same results. I’m questioning if there is an issue with the switch at this point. I’m going to reach out to the manufacturer and see if they have any suggestions. Thanks again!


#4

Are they different kinds of switches? I have a GE and an Inovelli, but due to a problem(?) with the Inovelli device handler(?) it will not accept a level of 100. 99 appears to be the max. So if I was doing what you’re doing and trying to get the Inovelli to match the GE, where the GE was set to 100, it would fail to do anything.


#5

That’s a great thought, jsducote. They are both inoevlli switches, so I don’t have that concern. But that’s something I will keep an eye on in the future. I never would’ve thought of that! Thank you for your response!


#6

The issue was the handler used for the switch and the switch not being included properly. I excluded and included the switch, then changed the handler, and now all works as expected! Marking this as solved :slight_smile: