Button Pushed vs. Held


#21

With the latest version, when I push the button, the lights will go OFF, and then a few seconds later they come back ON.

I’ve noticed that this happens if something else changes the state of the lights sometime during the day, before the button is used. I didn’t think this would matter, since it’s looking at the state of the light before taking action. I can test this now, by telling Alexa to turn these lights on, and then trying to use the button to turn them off. Again, lights go off, a few seconds later they come back on. Or vice-versa… Lights will come on, a few seconds later they go off.


#22

himmmmm
I had never used a button for this purpose before,
lets test a couple of things if you don’t mind…
a) Lets make sure NO other automation and/or piston is meddling with these dimmers and lights?
b) Lets get rid off the IF block (line 29 to 38) for now and just turn them ON lets see if they come back ON


#23

Lights turned OFF, then turned back ON

2/16/2019, 11:46:34 PM +712ms
+2ms ╔Received event [Neal Button].button = pushed with a delay of 689ms
+128ms ║RunTime Analysis CS > 24ms > PS > 67ms > PE > 37ms > CE
+131ms ║Runtime (41145 bytes) successfully initialized in 67ms (v0.3.109.20181207) (128ms)
+132ms ║╔Execution stage started
+143ms ║║Comparison (enum) pushed gets (string) pushed = true (2ms)
+145ms ║║Cancelling condition #2’s schedules…
+146ms ║║Condition #2 evaluated true (8ms)
+148ms ║║Cancelling condition #1’s schedules…
+149ms ║║Condition group #1 evaluated true (state changed) (11ms)
+176ms ║║Comparison (enum) on is (string) on = true (2ms)
+179ms ║║Condition #4 evaluated true (26ms)
+180ms ║║Condition group #16 evaluated true (state did not change) (28ms)
+183ms ║║Cancelling statement #17’s schedules…
+199ms ║║Executed physical command [Neal Lamp 1].off() (11ms)
+200ms ║║Executed [Neal Lamp 1].off (13ms)
+213ms ║║Executed physical command [Neal Lamp 2].off() (11ms)
+214ms ║║Executed [Neal Lamp 2].off (13ms)
+228ms ║║Executed physical command [Neal Lamp 3].off() (10ms)
+229ms ║║Executed [Neal Lamp 3].off (13ms)
+242ms ║║Executed physical command [Neal Lamp 4].off() (11ms)
+243ms ║║Executed [Neal Lamp 4].off (13ms)
+247ms ║╚Execution stage complete. (116ms)
+249ms ╚Event processed successfully (248ms)
2/16/2019, 11:46:10 PM +807ms
+1ms ╔Starting piston… (v0.3.109.20181207)
+338ms ║╔Subscribing to devices…
+350ms ║║Subscribing to Neal Button.button…
+450ms ║║Subscribing to Neal Lamp 1…
+452ms ║║Subscribing to Neal Lamp 2…
+453ms ║║Subscribing to Neal Lamp 3…
+455ms ║║Subscribing to Neal Lamp 4…
+456ms ║╚Finished subscribing (132ms)
+520ms ║Comparison (enum) on is (string) on = true (2ms)
+534ms ╚Piston successfully started (533ms)


#24

Waited a little bit. Pushed button. Lights turned OFF, and stayed OFF.

2/16/2019, 11:51:06 PM +189ms
+2ms ╔Received event [Neal Button].button = pushed with a delay of 743ms
+184ms ║RunTime Analysis CS > 25ms > PS > 138ms > PE > 21ms > CE
+187ms ║Runtime (41142 bytes) successfully initialized in 138ms (v0.3.109.20181207) (184ms)
+188ms ║╔Execution stage started
+199ms ║║Comparison (enum) pushed gets (string) pushed = true (1ms)
+201ms ║║Condition #2 evaluated true (6ms)
+202ms ║║Condition group #1 evaluated true (state did not change) (8ms)
+230ms ║║Comparison (enum) on is (string) on = true (2ms)
+233ms ║║Condition #4 evaluated true (27ms)
+234ms ║║Condition group #16 evaluated true (state did not change) (29ms)
+237ms ║║Cancelling statement #17’s schedules…
+254ms ║║Executed physical command [Neal Lamp 1].off() (11ms)
+255ms ║║Executed [Neal Lamp 1].off (14ms)
+268ms ║║Executed physical command [Neal Lamp 2].off() (11ms)
+269ms ║║Executed [Neal Lamp 2].off (13ms)
+284ms ║║Executed physical command [Neal Lamp 3].off() (13ms)
+285ms ║║Executed [Neal Lamp 3].off (15ms)
+299ms ║║Executed physical command [Neal Lamp 4].off() (11ms)
+300ms ║║Executed [Neal Lamp 4].off (14ms)
+304ms ║╚Execution stage complete. (116ms)
+305ms ╚Event processed successfully (305ms)


#25

Changed the piston (to turn them on):

Lights came ON, stayed ON.

So, it’s definitely when something else changes the the lights ON/OFF.

But, this doesn’t make since, if the piston is looking at the state of the bulb before taking action.

2/16/2019, 11:54:55 PM +584ms
+1ms ╔Received event [Neal Button].button = pushed with a delay of 731ms
+118ms ║RunTime Analysis CS > 18ms > PS > 63ms > PE > 38ms > CE
+121ms ║Runtime (41324 bytes) successfully initialized in 63ms (v0.3.109.20181207) (119ms)
+122ms ║╔Execution stage started
+134ms ║║Comparison (enum) pushed gets (string) pushed = true (1ms)
+136ms ║║Cancelling condition #2’s schedules…
+137ms ║║Condition #2 evaluated true (8ms)
+138ms ║║Cancelling condition #1’s schedules…
+139ms ║║Condition group #1 evaluated true (state changed) (11ms)
+168ms ║║Comparison (enum) off is (string) off = true (2ms)
+171ms ║║Condition #4 evaluated true (28ms)
+172ms ║║Condition group #16 evaluated true (state did not change) (30ms)
+176ms ║║Cancelling statement #17’s schedules…
+191ms ║║Executed physical command [Neal Lamp 1].on() (10ms)
+192ms ║║Executed [Neal Lamp 1].on (13ms)
+205ms ║║Executed physical command [Neal Lamp 2].on() (10ms)
+206ms ║║Executed [Neal Lamp 2].on (13ms)
+218ms ║║Executed physical command [Neal Lamp 3].on() (9ms)
+219ms ║║Executed [Neal Lamp 3].on (11ms)
+231ms ║║Executed physical command [Neal Lamp 4].on() (10ms)
+232ms ║║Executed [Neal Lamp 4].on (12ms)
+246ms ║║Executed physical command [Neal Lamp 1].setLevel([100]) (9ms)
+247ms ║║Executed [Neal Lamp 1].setLevel (11ms)
+260ms ║║Executed physical command [Neal Lamp 2].setLevel([100]) (10ms)
+261ms ║║Executed [Neal Lamp 2].setLevel (13ms)
+275ms ║║Executed physical command [Neal Lamp 3].setLevel([100]) (11ms)
+276ms ║║Executed [Neal Lamp 3].setLevel (14ms)
+287ms ║║Executed physical command [Neal Lamp 4].setLevel([100]) (8ms)
+288ms ║║Executed [Neal Lamp 4].setLevel (11ms)
+292ms ║╚Execution stage complete. (170ms)
+294ms ╚Event processed successfully (293ms)


#26

someone with better Webcore (behind the scenes) knowledge can explain why it is happening… I agree, it doesn’t make sense.

Well we still have a solution, variables are our best friends:))


#27

Just tested this again, by asking Alexa to turn the lights OFF.

Pushed the button, with the last piston setup. Lights turned ON, then a few seconds later turned OFF.


#28

You mean, you tested without line 29-38 and lights turned OFF few seconds later?

If so, I bet you something else is interfering with the lights…


#29

No.

Please look through the above posts. I placed the piston and logs of each test.

1st Test: Changed piston - If lights are ON, turn them OFF. Running this test, the lights turned OFF, then came back ON. But, this was because Alexa turned them ON first.

2nd Test: No change to piston - If lights are ON, turn them OFF. Running this test, the lights turned OFF, and stayed OFF. (Alexa did not do anything)

3rd Test: Changed piston - If lights are OFF, turn them ON. Running this test, the lights turned ON, and stayed ON. (Alexa did not do anything)

4th Test: No change to piston - If lights are OFF, turn them ON. Running this test, the lights turned ON, then turned OFF. But, this was because I had Alexa turn the lights OFF before pushing the button.


#30

I agree with Ike. You likely have some old coding or automation still controlling that light.

From the looks of your last post, maybe an Alexa Routine is doing something?


On an unrelated note, I would condense these 5 lines:

temp

… into these 3 lines…

IF Button gets pushed
Then With Dimmer 7, 8, 9 and 10
    Set level to 100%
END IF

The logic being:

  • I dropped line 26 because “Set level” also turns on the light, so why send out two commands?

  • I dropped line 21 because webCoRE is smart enough to not send an on command to a device that is already on.


#31

This was only PART of the Piston for testing.

The entire piston will look at the state of the bulb, and then do the opposite.

If lights are on, turn them off - OR - if lights are off, turn them on.

There is no Alexa routine interfering, as Alexa does not even see the button as a device, so it cannot control it.

There are no SmartThings automation with the button.

The button has nothing setup for ‘Pressed’, ‘Held’ or ‘Double Pressed’ in the SmartThings App.


#32

Sorry, I should have embellished a bit. Here is both sides:

IF Button gets pushed
Then
    IF ALL four bulbs are on
    Then
        Turn off all bulbs
    Else
        Set level to 100% on all bulbs
    END IF
END IF

Most buttons cannot be controlled… They initiate commands.

What I meant was, the old coding or automation could be an Alexa Routine (or another piston or SmartApp)… which can be monitoring any device, and controlling Dimmer 7, 8, 9 or 10.

Sometimes you can find the offender by going to the:
IDE > My Devices > MisbehavingLight > List Events


#33

I believe this is the version he is testing:

I am running out of options but my question is, how fast are you testing?
Lets say you said Alexa turn the lights ON? and after that how many seconds are you waiting to press the button?


#34

I am pretty sure my last post will do the trick.

Ike, piston vf2e from your link has two IFs inside the main IF, so there could easily be sequential conflict.

The piston snippet I made only uses one IF inside, so only one of the commands is allowed to execute.


#35

Waiting at least a minute or two between each.


#36

Please see my first piston post above. This is how it was first setup.


#37

Not exactly. The missing key from your first post is it should have said ALL instead of ANY.


#38

Ok… I’m going to try this setup and see what happens.


#39

I’ll finish testing tomorrow… just realized how late it is.

Thanks for looking all of this over.


#40

The exact same thing is still happening. Been through all logs, automation, pistons, routines… it doesn’t make sense.