Make ST Switch check light on or off before executing comand


#21

12/8/2019, 12:19:38 PM +684ms
+1ms ╔Received event [Grayden Lamp].button = pushed with a delay of 178ms
+87ms ║RunTime Analysis CS > 21ms > PS > 51ms > PE > 16ms > CE
+89ms ║Runtime (37330 bytes) successfully initialized in 51ms (v0.3.110.20191009) (87ms)
+90ms ║╔Execution stage started
+95ms ║║Comparison (enum) pushed gets (string) pushed = true (0ms)
+97ms ║║Condition #2 evaluated true (3ms)
+97ms ║║Condition group #1 evaluated true (state did not change) (4ms)
+109ms ║║Comparison (enum) off is (string) on = false (1ms)
+110ms ║║Condition #4 evaluated false (11ms)
+111ms ║║Condition group #3 evaluated false (state did not change) (12ms)
+113ms ║║Cancelling statement #5’s schedules…
+131ms ║║Executed physical command [Bedside Lamp 1].on() (14ms)
+132ms ║║Executed [Bedside Lamp 1].on (16ms)
+134ms ║╚Execution stage complete. (44ms)
+135ms ╚Event processed successfully (134ms)
12/8/2019, 12:19:27 PM +848ms
+1ms ╔Received event [Grayden Lamp].button = pushed with a delay of 174ms
+89ms ║RunTime Analysis CS > 22ms > PS > 53ms > PE > 15ms > CE
+91ms ║Runtime (37327 bytes) successfully initialized in 53ms (v0.3.110.20191009) (89ms)
+92ms ║╔Execution stage started
+97ms ║║Comparison (enum) pushed gets (string) pushed = true (0ms)
+99ms ║║Condition #2 evaluated true (3ms)
+99ms ║║Condition group #1 evaluated true (state did not change) (4ms)
+110ms ║║Comparison (enum) off is (string) on = false (1ms)
+112ms ║║Cancelling condition #4’s schedules…
+112ms ║║Condition #4 evaluated false (11ms)
+113ms ║║Cancelling condition #3’s schedules…
+114ms ║║Condition group #3 evaluated false (state changed) (13ms)
+116ms ║║Cancelling statement #5’s schedules…
+134ms ║║Executed physical command [Bedside Lamp 1].on() (14ms)
+135ms ║║Executed [Bedside Lamp 1].on (15ms)
+137ms ║╚Execution stage complete. (45ms)
+138ms ╚Event processed successfully (138ms)


#22

The last log you posted, turned on the light because it was seen as off.

12:19:27 PM
║║Condition #4 evaluated false
║║Executed physical command [Bedside Lamp 1].on()

12:19:38 PM
║║Condition #4 evaluated false
║║Executed physical command [Bedside Lamp 1].on()


In all the logs you posted, this issue is nowhere to be found… We need to see the issue to be able to troubleshoot it… Perhaps you have some other programming controlling that light?!?


#23

Would a video of the issue help do you think? Or based on the fact that the logs don’t show any issue would I be better off going back through my WC setup and re adding my devices and retrying the piston from there do you think?

Cheers


#24

Ok so I went back over everything and realised the reason I was probably having an issue was I had accidently left a previous piston running.

However after deleting all the pistons connected to that switch and re-installing your piston it is not effecting the light at all. When the light is turned on via Lifx app and I press the ST button to turn it off nothing happens until I press the ST button a second time and then it will turn off.

Below is the log:

12/9/2019, 11:18:45 AM +523ms
+0ms ╔Received event [Grayden Lamp].button = pushed with a delay of 158ms
+45ms ║RunTime Analysis CS > 11ms > PS > 26ms > PE > 8ms > CE
+48ms ║Runtime (37172 bytes) successfully initialized in 26ms (v0.3.110.20191009) (46ms)
+48ms ║╔Execution stage started
+54ms ║║Comparison (enum) pushed gets (string) pushed = true (1ms)
+55ms ║║Condition #2 evaluated true (3ms)
+56ms ║║Condition group #1 evaluated true (state did not change) (5ms)
+64ms ║║Comparison (enum) on is (string) on = true (1ms)
+65ms ║║Cancelling condition #4’s schedules…
+67ms ║║Condition #4 evaluated true (8ms)
+68ms ║║Cancelling condition #3’s schedules…
+69ms ║║Condition group #3 evaluated true (state changed) (11ms)
+71ms ║║Cancelling statement #7’s schedules…
+2342ms ║║Executed physical command [Bedside Lamp 1].off() (2269ms)
+2343ms ║║Executed [Bedside Lamp 1].off (2271ms)
+2345ms ║╚Execution stage complete. (2297ms)
+2346ms ╚Event processed successfully (2346ms)
12/9/2019, 11:18:35 AM +146ms
+2ms ╔Received event [Grayden Lamp].button = pushed with a delay of 181ms
+82ms ║RunTime Analysis CS > 21ms > PS > 49ms > PE > 12ms > CE
+84ms ║Runtime (37170 bytes) successfully initialized in 49ms (v0.3.110.20191009) (81ms)
+85ms ║╔Execution stage started
+90ms ║║Comparison (enum) pushed gets (string) pushed = true (0ms)
+92ms ║║Condition #2 evaluated true (3ms)
+92ms ║║Condition group #1 evaluated true (state did not change) (4ms)
+101ms ║║Comparison (enum) off is (string) on = false (1ms)
+102ms ║║Cancelling condition #4’s schedules…
+103ms ║║Condition #4 evaluated false (8ms)
+103ms ║║Cancelling condition #3’s schedules…
+104ms ║║Condition group #3 evaluated false (state changed) (10ms)
+106ms ║║Cancelling statement #5’s schedules…
+2167ms ║║Executed physical command [Bedside Lamp 1].on() (2059ms)
+2168ms ║║Executed [Bedside Lamp 1].on (2061ms)
+2170ms ║╚Execution stage complete. (2086ms)
+2171ms ╚Event processed successfully (2171ms)
12/9/2019, 11:18:23 AM +21ms
+2ms ╔Received event [Grayden Lamp].button = pushed with a delay of 196ms
+85ms ║RunTime Analysis CS > 21ms > PS > 50ms > PE > 14ms > CE
+87ms ║Runtime (37150 bytes) successfully initialized in 50ms (v0.3.110.20191009) (84ms)
+88ms ║╔Execution stage started
+93ms ║║Comparison (enum) pushed gets (string) pushed = true (0ms)
+94ms ║║Cancelling condition #2’s schedules…
+95ms ║║Condition #2 evaluated true (4ms)
+96ms ║║Cancelling condition #1’s schedules…
+97ms ║║Condition group #1 evaluated true (state changed) (5ms)
+105ms ║║Comparison (enum) on is (string) on = true (1ms)
+106ms ║║Condition #4 evaluated true (8ms)
+107ms ║║Condition group #3 evaluated true (state did not change) (9ms)
+109ms ║║Cancelling statement #7’s schedules…
+2316ms ║║Executed physical command [Bedside Lamp 1].off() (2204ms)
+2316ms ║║Executed [Bedside Lamp 1].off (2206ms)
+2319ms ║╚Execution stage complete. (2230ms)
+2319ms ╚Event processed successfully (2319ms)

Clear

Full


#25

We’ve all done this at one point or another…


This sounds like the device is not reporting to the hub when the Lifx app changes the light. I would consider trying a different Device Handler.


As far as the latest logs, it looks like webCoRE is doing exactly as instructed:

11:18:23 AM
║║Condition #4 evaluated true
║║Executed physical command [Bedside Lamp 1].off()

11:18:35 AM
║║Condition #4 evaluated false
║║Executed physical command [Bedside Lamp 1].on()

11:18:45 AM
║║Condition #4 evaluated true
║║Executed physical command [Bedside Lamp 1].off()

All clues point towards the Lifx app is likely bypassing the ST hub, so the ST hub (and webCoRE) is unaware of any changes…


#26

Yeah I had that thought also. But it also happens with Google Assistant.

Do you think it’s just the lights not reporting to ST hub that they’re on/off when triggered by anything other than the ST button?

Thanks again for all your help WCmore I know its not always easy helping noobs as we just don’t get it. But even with the help you have given me I’ve learnt a lot so I really appreciate it. I see looking through the forums that you’re super active here so I’m happy if you want to put this one to bed and I’ll work on some other ways of working around this on my own and you can help others with their predicaments.

Thanks again :smiley:


#27

I think the general concept is, normally each device can only have one “master” hub… I suspect that Lixf took “claim” of that bulb, which is likely why the ST hub is not “in tune” with the current conditions.

(IE: Google Assistant is likely sending the command to Lifx, not SmartThings)


#28

Yeah I’d say that’s what’s happening as well. Thanks again WCmore.

Now go, return in to the forums, and be the hero we need. Where ever broken piston’s lurk or grumpy spouses and partners despair at a smart home… He is THERE.

:joy::rofl::joy: