Button that utilizes HE virtual button

Good day,
I would like to request that a button be implemented in Sharptools that will activate a button in Hubitat.
case usage/example - I wish to create a dashboard that has controls for volume through Harmony driver ( I could also control through the Denon amp driver) instead of using a switch with auto off set to 500 ms. While this works you have to press and release for each volume step up or down. A pushed button will react the same but a held button would continuously raise the volume until released.

thank you

Thanks for the submitting the feature request, @Robert_C – be sure to scroll up to the top of the thread and cast a vote.

And thanks for sharing the clarifying use case. I can see how the delay from the ‘auto off’ on a Hubitat Virtual Switch might not work as well here as you would have to wait to tap between each press.

Hubitat buttons can be authorized to SharpTools and used to trigger SharpTools rules. Historically, buttons were considered sensor devices within Hubitat – meaning they only reported their state when a button was physically actuated. It seems like the concept of virtual buttons as actuators has become more popular in the HE community though, so I can certainly see the use case here!

Workaround: SharpTools Rule

As something of a workaround, you could use a SharpTools rule to run the device commands and add that rule directly to your dashboard. For example, I might create a rule with just a device command in the Flow (no Triggers):

Then in my dashboard, I would directly add the rule as a tile to my dashboard. So each time I tap on that tile, it would send the device command (or multiple device commands if there were multiple in the flow):

Variables in Rules

For the Denon Amp driver, I imagine you might even be able to set the volume to a specific value/level. If so, you could potentially even use a numeric variable on your dashboard and then use that numeric variable changing as the trigger for your rule and as a parameter in the device command in the flow.

1 Like

Thanks for the speedy reply and I will try the rule within sharptools, You have mentioned that before in other posts people have raised this issue in before. It is an effective work around but much like you mentioned it seems HE folks (myself included) are using the button as more of an actuator then a contact sensor. I am not sure if Sharptools can employ the features that the virtual button in HE gives. A question, how does Sharptools utilize a zigbee button? not sure of the use of one via a dashboard but, give a man a rock and he will use it in ways you never dreamed of.

Thanks
B

A zigbee button follows the original design paradigm. It’s a physically actuated button, so it’s only reporting it’s state/events to the hub (and to SharpTools). There’s no command to ‘push’ a physical button in the original design.

And when I mention ‘Historically’ above, I mean the original ‘Button’ and ‘PushableButton’ capabilities literally did not have commands as part of the specification at all.

Old Documentation Screenshots

image

image

And I wanted to post a copy of an alternative approach from our PMs for anyone else who finds this thread: (Please still feel free to cast a vote for Virtual Button support too!)


I forgot to mention in the other threads that we also support the Momentary capability from Hubitat.

My apologies! It totally slipped my mind that this was a better option and would act more like a button for you (once you change it to the Momentary Tile Layout).

I put together a Virtual Momentary Switch driver that is a Switch, Momentary, and Button. That probably provides the best compatibility between Rule Machine and SharpTools for a ‘button’ type of functionality.

1 Like

I am out of votes so will have to look through the other ones to see if I want to move a vote over to this. But figured I would post anyway. I get around the lack of hubitat button support by creating Rule Engine routines that then call Hubitat JSON requests. It works fine but it has a lot of moving parts. So a native button controller would be fabulous!

Check out the Virtual Momentary Switch mentioned above. It implements the Momentary capability, so once you add it to your dashboard, you can change it to the Momentary Tile Layout and it acts just like a button.

Alternatively, you can use the Virtual Switch in Hubitat and configure it to automatically turn itself off after 1 second, but the virtual momentary is a cleaner solution in my opinion.

Thanks Josh. As usual, I should have been clearer! I use the button controller with virtual buttons a lot in Hubitat to control certain events. For example I have one setup for every zone in my whole house audio with 6 buttons defining the source. So then I can push button 3 on Zone Button 4 and it switches Zone 4 to source 3. I use these a lot in my Sharptools screens.

But the Sharptools Hubitat app doesn’t recognize buttons so I have to create rules to fire behind tiles to push these buttons using JSON calls to Hubitat. I am looking into making groups of momentary switches in Hubitat using an app that someone created which would then expose all of the switches to Sharptools and I could just put them in dashboards. But it would be nice if the Hubitat button object could be added to the Sharptools app in Hubitat and then could be placed on the dashboard without any additional work.

Ah, I understand now. This first section is mostly my analysis and opinion the subject, but you can scroll to the bottom if you are looking for alternative approaches that might work for you.

Button Capabilities: Sensor vs Command

It’s unfortunate that Hubitat moved away from the Button capability which was a sensor only capability and aligned very clearly with real world physical buttons.

The new PushableButton and other xxxButton capability variants would be reasonable to me if they were distinctly used for Virtual Buttons as it makes sense to include commands in that case.

But there was already a Momentary capability that supports the push() command and could have easily been extended to support passing a button number.

Personally, I find it odd that the base PushableButton capability, which is one of Hubitat’s few departures from the original SmartThings capability model, includes a push() command as when it’s used with drivers for a physical button device it doesn’t make sense as you can’t send push() to the physical button device.

Voting

That being said, I’m fine with leaving the feature request open. It hasn’t picked up many votes, so it won’t be prioritized at the moment, but sometimes these things pick up traction over time.

Dynamic Run Rule with Parameters

In the meantime, also keep in mind that you could create a single SharpTools Rule which sends the push() command to your button device and uses a Context Variable for which button to press.

You can then use any tile with a hyperlink action along with the special $.runRule() hyperlink syntax wherein you can easily adjust which button number is passed as a parameter:

Call REST API / JSON Directly

Alternatively, the thread that discusses the special $.runRule() syntax also mentions a special REST API Hyperlink syntax that you could use if you already have a Hubitat Rule setup or find the Hubitat Maker API more intuitive to use:

$.get("https://your.cool.url/?button=1")

I am actually using the proposed approach in Rule Engine. It’s just a little cumbersome so looking for a simpler solution. After investing in the use of virtual buttons in Hubitat I am actually not very happy with them because you can’t name the buttons. So this makes it difficult to interact with in Hubitat Rules because you have to constantly check the button app to understand what pushing button 1 does vs, button 2, etc.

So I think I may switch over to groups of momentary switches as I could just place these on dashboards and not have to use rule engine.

1 Like