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?
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.
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
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
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
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 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.
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)
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
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.