SmartThings Button Weird Behaviour

Hi All,

I picked up a couple of SmartThings buttons and have them setup. To maximize the 3 options I created the automations below:

Single click - Toggle my Nightstand lamp
Double Click - Toggle Ensuite lights
Hold - Run bedtime automation

I figured I would use the toggle service to either turn the lights on or off dependent on their current state. What is actually happening is that if the nightstand is off and I single press the button the light turns on, turns off then turns on. The same happens if it is on, I press the button and it tuns off, turns on then turns off.

The same thing happens with the ensuite lights. I tried creating the automation from scratch but the same thing happens.

Does anyone have any ideas what I need to do to get the toggle to work properly?

Can you put up your current automation code, etc. so we can help diagnose?

Thank you,

Here you go. I did the automation through the “automations” section of HA

Easier if you were to copy and paste and format as code instead of a screenshot… but the one thing that leaps out at me right away is the extra “-” all over the place.

I was looking at the code I have for my SmartThings button (using zha events) and I have no “-” before event data (after trigger), no “-” before entity_id, etc.

Here’s an example of what I mean (below). I wonder if getting rid of those extraneous characters helps.

- id: Master
  alias: Master Bedroom
  trigger:
    platform: event
    event_type: zha_event
    event_data:
      device_ieee: xx:xx:xx:xx:xx:xx:xx:xx
      command: button_single
  action:
    service: light.toggle
    entity_id: light.bedroom_1

Also… in your line 624… I’m pretty sure “alias” shouldn’t be there.

Thanks for the help,

I did a screenshot as quite often the formatting seems to get lost when I copy & paste the text.

As I mentioned I created these automation’s with the built in editor. When I get home I will delete them and build one using the format you posted directly in the automations.yaml

No worries.

I’m leaning towards that “alias” in a weird spot being the culprit. (Maybe the “data” on line 625 as well.)

Hope that helps!

I am still having the same issue,
I did one automation at a time and checked, everything seemed ok. All of a sudden the issue re appeared, below is from my automations.yaml

  • id: RC2
    alias: RC Button Double
    trigger:
    platform: event
    event_type: zha_event
    event_data:
    device_ieee: xx.xx.xx.xx.xx.xx.xx.xx
    command: button_double
    action:
    service: light.toggle
    entity_id: group.bathroom_lights

Not sure what the heck is going on (Not sure why the formatting got lost but it is correct)

OK there is something weird going on with using the toggle function with this button. Last night I figured out how to setup the button using Node Red and it exhibits the exact same behavior.

Currently the only way I can make it work is use a single click to turn the light on and a double click to turn it off. It kinda defeats what I am trying to achieve though

That is strange.

I came across this post and I wonder if one of the suggestions might work for you…

I’ll see if I can figure out anything else.

Well I figured out what the problem is but I don’t have a fix. The issue is that each time you press the button it cycles 3 times this causing the the light to toggle on, off & back on or vice versa. I saw what was happening when I placed a debug node right after the output in Node Red, I even watched the zha_event and saw the same thing.

I ended up having to use the turn_on & turn_off service instead of the toggle service. Maybe my 2 buttons need a firmware update but I do not have a smarthings hub so have no way of doing this

I found the solution, it was actually quite easy.

I used Node Red to set up the flow for the button pushes and inserted a delay node so only q message was sent every 4 seconds. This fixed the problem with the button sending multiple messages.

I actually learnt a lot about Node Red in the last few days and have transitioned most of my automations. It really is very powerful.

Hope this helps for anyone having the same issue.

1 Like

I have several of these buttons and they all seem to start having this issue after a few months of use (the more heavily used buttons seem to start sending multiple events sooner)

Looking for a not work around solution…

Look at my post above,

This has worked perfectly in my situation and it is completely customizable

I was just going to reply back, the button was reporting 51% battery - I was just out and picked up a new CR2450 and replaced the battery and now it’s working as expected

Thanks for the reply,

My wife’s button was a little older than mine, her battery was showing around 60% and mine was at a 100%. Both did exactly the same. Since I set them up in Node Red with a delay node they have worked perfectly.