Button Pushed vs. Held


#41

We would need to see a fresh green snapshot, with TRACE turned on to be able to make sense of your logs


#42

Lights turn off, and then came back on:

2/18/2019, 5:24:51 PM +570ms
+1ms ╔Received event [Neal Button].button = pushed with a delay of 436ms
+125ms ║RunTime Analysis CS > 23ms > PS > 68ms > PE > 33ms > CE
+127ms ║Runtime (42967 bytes) successfully initialized in 68ms (v0.3.109.20181207) (125ms)
+129ms ║╔Execution stage started
+140ms ║║Comparison (enum) pushed gets (string) pushed = true (1ms)
+142ms ║║Condition #2 evaluated true (7ms)
+167ms ║║Comparison (enum) on is (string) off = false (2ms)
+170ms ║║Condition #4 evaluated false (27ms)
+171ms ║║Condition group #1 evaluated false (state did not change) (36ms)
+174ms ║║Cancelling statement #20’s schedules…
+192ms ║║Executed physical command [Neal Lamp 1].off() (13ms)
+194ms ║║Executed [Neal Lamp 1].off (16ms)
+210ms ║║Executed physical command [Neal Lamp 2].off() (12ms)
+212ms ║║Executed [Neal Lamp 2].off (15ms)
+226ms ║║Executed physical command [Neal Lamp 3].off() (12ms)
+228ms ║║Executed [Neal Lamp 3].off (14ms)
+242ms ║║Executed physical command [Neal Lamp 4].off() (11ms)
+244ms ║║Executed [Neal Lamp 4].off (15ms)
+258ms ║║Comparison (enum) pushed gets (string) held = false (1ms)
+261ms ║║Condition #23 evaluated false (11ms)
+263ms ║║Condition group #22 evaluated false (state did not change) (12ms)
+268ms ║║Cancelling statement #25’s schedules…
+279ms ║║Skipped execution of physical command [Neal Ceiling 1].off([]) because it would make no change to the device. (3ms)
+280ms ║║Executed [Neal Ceiling 1].off (7ms)
+288ms ║║Skipped execution of physical command [Neal Ceiling 2].off([]) because it would make no change to the device. (2ms)
+290ms ║║Executed [Neal Ceiling 2].off (5ms)
+298ms ║║Skipped execution of physical command [Neal Ceiling 3].off([]) because it would make no change to the device. (3ms)
+300ms ║║Executed [Neal Ceiling 3].off (6ms)
+304ms ║╚Execution stage complete. (176ms)
+306ms ╚Event processed successfully (306ms)


#43

According to this log, when the button was pressed, there was at least one dimmer on. So it jumped to the ELSE at lines 28-32, and turned off all 4 lights. This piston did exactly what you wanted it to do.

There was absolutely no “on” command sent from this piston…

You definitely have some old programming still in play controlling whatever lights came back on… You said it was not an Alexa Routine, but it could be another piston, or a SmartApp in SmartThings, just to name a few.

(this is why I recommend doing all your programming in webCoRE, whenever possible)


Side Note:
Lines 45-49 also executed because either lines 35 or 37 were false.
I do not think you want this part to happen. (we can blame the ELSE on line 44 for this)


#44

Changed the piston.

I can’t find anything else interfering.

So, this is what is happening:

If something else changes the state of the light switches, the piston turns on/off the lights, and then the lights turn right back on/off.

The something else right now is me telling Alexa to turn on/off the lights some time during the day.

If nothing changes the state of the light switches, the piston works fine.

I’ve checked everything: Pistons, SmartThings, Alexa, all SmartApps, Event listings, timers…etc…nothing else is interfering.

If the piston is the only thing turning on/off the lights, everything is fine…but, this isn’t logical in a smart home.

I don’t know what to do at this point, so I guess I’ll just live with it.

2/18/2019, 11:36:27 PM +147ms
+2ms ╔Received event [Neal Button].button = pushed with a delay of 382ms
+115ms ║RunTime Analysis CS > 19ms > PS > 73ms > PE > 22ms > CE
+117ms ║Runtime (43265 bytes) successfully initialized in 73ms (v0.3.109.20181207) (114ms)
+119ms ║╔Execution stage started
+129ms ║║Comparison (enum) pushed gets (string) pushed = true (0ms)
+131ms ║║Condition #2 evaluated true (6ms)
+132ms ║║Condition group #1 evaluated true (state did not change) (8ms)
+158ms ║║Comparison (enum) on is (string) off = false (2ms)
+161ms ║║Comparison (enum) on is (string) off = false (2ms)
+164ms ║║Comparison (enum) on is (string) off = false (2ms)
+167ms ║║Comparison (enum) on is (string) off = false (2ms)
+170ms ║║Condition #30 evaluated false (35ms)
+171ms ║║Condition group #29 evaluated false (state did not change) (37ms)
+174ms ║║Cancelling statement #20’s schedules…
+189ms ║║Executed physical command [Neal Lamp 1].off() (11ms)
+190ms ║║Executed [Neal Lamp 1].off (13ms)
+202ms ║║Executed physical command [Neal Lamp 2].off() (10ms)
+203ms ║║Executed [Neal Lamp 2].off (12ms)
+216ms ║║Executed physical command [Neal Lamp 3].off() (11ms)
+217ms ║║Executed [Neal Lamp 3].off (13ms)
+230ms ║║Executed physical command [Neal Lamp 4].off() (11ms)
+231ms ║║Executed [Neal Lamp 4].off (13ms)
+240ms ║║Comparison (enum) pushed gets (string) held = false (1ms)
+242ms ║║Condition #23 evaluated false (5ms)
+243ms ║║Condition group #22 evaluated false (state did not change) (8ms)
+245ms ║╚Execution stage complete. (127ms)
+247ms ╚Event processed successfully (246ms)


#45

This is interesting…
I had said, something else is interfering earlier but I wasn’t 100% sure but now @WCmore is saying the same thing, I am more convinced that is the case BUT
here is a test I would recommend:

Completely new piston. New piston only checks the status of your light bulbs (d’mmers) and reports as SMS or Piston status. If I am not mistaken, webcore doesn’t directly checks your devices, it gets the info from ST)

You turn them ON with alexa and check the status (I am trying to see if Smart things is not reporting the status properly to webcore)
You turn them OFF with alexa and check again…


#46

That new log also looks 100% perfect!! It is doing exactly what you want.
There is definitely something else controlling the lights.


Are you saying that if you ask Alexa to turn on or off the lights, that the lights behave, or are you saying that when using Alexa, the lights toggle twice?


#47

Oh, and at the risk of stating the obvious, if you have tried a few versions of this piston, make sure all except one of the test pistons are PAUSED


#48

@WCmore

If I use Alexa to turn on/off the lights any time during the day, then later use the button (piston), the lights toggle twice with the button (piston).


#49

It is the same piston being changed.

There are no other pistons.


#50

I would use a computer to log into the IDE.

  • Click on “My devices”
  • Click on one of the misbehaving lights
  • Click on “List Events”

Then scroll thru that list of events. Sometimes, we can pin point what controlled the light.
(anything except for this piston is a culprit)


#51

Unless you have different logs that I have not seen, it is most definitely not this piston doing the second toggle.


#52

I have been checking this, and everything looks good in the List Events.


#53

Not all programming shows up there… but it was worth a shot


#54

Keep in mind, the old programming can be centered around the button OR any of the problem lights


#55

When using Alexa to turn on/off the lights, SmartThings is reporting the correct switch state.

Just to be sure, I just checked it again, and SmartThings is reporting the correct switch state.


#56

Checked each of the bulbs in SmartThings IDE, went through all listed events, and all ‘In Use By’ apps…


#57

Just for clarity… I have dozens of pistons controlling the same lightbulb… This is fine…

What we must watch out for is “IF” statements here in webCoRE, and similar logic in other automations.

For example, if you have multiple instances of

IF Bulb-A does something

then all of those programmings will try to do something when that device changes.


#58

Would you be willing to post a screenshot of the “In Use By” section (in the IDE) for one of the mis-behaving bulbs so I can look a bit closer?


#59

I don’t have any pistons that do something if a BULB state changes. Haven’t had a need for this (yet).


#60

It doesn’t technically even have to be your programming… A smart app like SmartLighting (among others) could be doing this automatically.