SmartThings button double tap


#21

Your PUSH command (lines 26 & 27) does three things:

  • First, it turns on the lights
  • Then it sets the levels to 1%
  • Then it turns the lights off

Any further troubleshooting we’d need to see a full log at the time of an error.


#22

I see what you mean. I like the behavior, but it does seem redundant now.
So, confirming… Set Level to > 0 turns ON a light?


#23

Usually:

  • Set level to 0% is seen as a Turn off command. (the level will not actually change)
  • Set level to 1-99% is seen as a level change, and will adjust a moment after it turns on
  • Set level to 100% is seen as a Turn on command

To add a bit of clarity, most bulbs remember their previous level, and when first turned on, will initially return to their previous level.


#24

That’s interesting. I’m still not sure it explains why my two lamps come on with a single push, and then go off with a second push if my code is:

Set Level to 1%
Turn Off

Like in this shorter example that does the same thing.


#25

Any further troubleshooting we’d need to see a full log at the time of an error.


#26

There’s no “error”… that’s what I’m saying. Appears to be operating as designed. No complaints.However, thanks to your prompting, I have now learned something new!

Turning logging level to full revealed that when the lights are off, it sets the level to 1% (and turns on) followed by:

Skipped execution of physical command [Lamp].off([]) because it would make no change to the device.

With the lights on, it turns them off and says:

Skipped execution of physical command [Lamp].setLevel([1]) because it would make no change to the device.

Mystery solved! Thank you!!


#27

Well, since you are trying to send two opposite & contradictory commands back to back (turn on, turn off), perhaps a better solution is to add a 1 or 2 second WAIT between the two commands…

Set level to 1%
Wait 1 second
Turn off

This should give enough time for the first command to go thru, before it sends out the second command. Each button press should then be identical…


Pro Tip:
If the level is currently at 1%, and the bulb is currently off, then “Set level to 1%” won’t do anything, since it is already at 1%


#28

Thank you! :slight_smile:
I got one of these recently.
I was sorta dumb-struck when I finally got around to doing something with it in webCoRE and noticed only two options lol


#29

Hi Everyone, I followed this thread but found that on my webcore, I don’t have a “gets” option. I have an “is” but that doesn’t work. I’m being stupid I am sure, any ideas?


#30

Most “switches” can be either on or off… and can linger in either position for many hours…

Most “buttons” can be “pressed” or “held”… (some allow “double”)… but all of these are only momentary events… (99.9% of the time, they will all be false)

It sounds like you are trying to use “button” logic on a “switch”.


#31

Ah yes. I guess I am trying to do the object of this post using a switch, basically my goal is that when a light switch is double tapped on, it switches on light and play music. Does anyone have any idea on how to do this? I remember there used to be a switch automation called “Double Tap”.


#32

As far as I know, a switch is either on or off.

With network delays as they are, I would not even attempt your goal with a switch.
(it would take at least 4 seconds to be reliable)
IE: Push on, wait a moment, push off, wait a moment, push on, cross fingers

You’d have much more success with a dedicated button or some other alternative way to trigger this.


#33

This may help future puzzlers over multi-state buttons. I’ve been running two pistons like this for over a year that detects three types of button press: pushed, double, and held. This allows three On states, plus off. One push is On dim, Held is bright, and Double is 50%. It very rarely fails, and when it does, just try it again. Enjoy.