Virtual Button Device Handler

Does anyone know where I can get a simple virtual button device handler? I have virtual switches and dimmers but I cant find a simple single-fire button.

This is really needed as part of Automation triggers (IF) or in the available devices list.

Any help would be great.

Mr.smith

In the new app? Not possible

1 Like

Seriously?!?! Why not?

1 Like

There is no momentary button capability.
Instead, make a virtual switch and use smart lighting to reset it after 1 minute.

2 Likes

No no…stop thinking like a physical button.
Just a single throw DH that repeats ā€˜On’ when activated would work perfectly. Buttons are a crucial part of any iot ecosystem. So this must be possible. Without it, ST has lost some value.

You may need to create the handler yourself. Despite what you might hear, the Momentary capability works fine with the ā€˜new’ app to display a tile that fires the ā€˜push()’ command when pressed. So you could add a button or switch capability to that to give you an attribute you can work with.

The standard Momentary Button Tile handler might even do the job (that turns a switch attribute on and off) though you might need to run it in the Classic app first to initialise the switch state. The new app likes capability attributes to have values and the handler hasn’t been updated to initialise them.

I have my own custom DTH but haven’t really played with it enough to see if there are any deficiencies. However, if you are interested, it is this:

1 Like

I tried the momentary button tile. Works great in the old app, just a blank tile in the new app.

Thanks for writing this DTH, I’m giving it a try.

It’s close to what I need. Basically I’m looking to replicate the ability to execute my ā€œgoodbyeā€ and ā€œI’m backā€ routines manually. There doesn’t appear to be any other way to do this in the new app. I’m finding that your button doesn’t respond when I push it in the app… it just spins and goes to ā€œChecking statusā€¦ā€

Annotation 2020-08-21 115622

See the community FAQ. (The topic title is a clickable link)

Basically, use a regular on/off virtual switch and then turn the switch off again each time after you’ve used it. I know it’s ugly, but it works.

1 Like

That’s rather annoying. I can’t replicate that behaviour but that doesn’t mean a lot. I’ve added a ā€˜vid’ to the device handler to see if being told what to do helps the app out. It has the useful side effect of enabling the momentary action in the dashboard tile.

Thanks. It looks like Option 8 is what I’m after. Seems like pretty obvious functionality to be missing from the new app, though…

2 Likes

(Not sure if jpeg upload worked so here’s a link to the product on Amazon just in case!) https://www.amazon.co.uk/Leepesx-Wireless-Emergency-Caregiver-Disabled/dp/B088BK9XSY

Hi Graham,
I have the above zigbee SOS button. It worked with my old hub but since moving to Smartthings I cant quite get it to work. I am very new to this and while I can find my way around the code, I struggle to write it! The device initially just showed as ā€˜Thing’ so I tried your virtual button code - I can now see the device’s battery status (edit: actually, no, Batt status was with some other code I tried) on my phone app. I can see the device is online. If I click the button then the hub interface will tell me that the device was active a few seconds ago. BUT… I don’t get a button press shown on the app so I cant get it to preform any actions. What do I need to add to your code to make this function work? I suspect it might be as simple as adding the device model but I’m not sure of the syntax. Any help (but particularly in the form of code!) would be much appreciated. Patrick

you need to write a new device handler for a Zigbee device

Okay, I’m really not sure how to do that. I have tried for so long but without success. There must be something out there that’s close and that I can perhaps modify? The logs on the hub can see the button press but that’s as far as I get. I can’t get it to control a device.

For example; using Type: ā€˜Zigbee Button’, the live logs say:

10:14:49 PM: debug Parse returned [:]

10:16:34 PM: debug description is catchall: 0104 0501 01 01 0000 00 E361 01 00 0000 02 00

It’s not that simple, so I recommend you buy a button that already works with smartthings as there are many available and they are cheap

Can you or anyone recommend one? (Zigbee and suitable or an elderly person to call for help)

I think the ikea ones are pretty good

What exactly are you trying to do? I use virtual switches to be able to trigger scenes, and as part of the scene, that particular virtual switch is turned off so it’s only ā€œonā€ very briefly.