How you implement this would be up to you. You can create a driver that sends the hubaction based on one of it capabilities. For example, it your driver has the switch capability, you can have it send on "On".
You can also write an app that subscribes to a device and have the app send the hubAction based on...well..whatever you code to send on.
The driver approach would allow you to include the virtual device in any automation based on its capabilities.
The app approach might give you more flexibility...it all depends on what and how you intend to use the update command.
I’m stuck on where to begin. I see the developer documentation but it just lists all the commands. So far I haven’t seen any practical samples and literally would like to setup an app that only has an on button and an off button to get a feel for the system.
I copied a random driver into the custom section and started poking around. I tried to insert a HubAction but it failed. From the logs I found that this is a command for the apps (or so it seems).
It is a simple beginning but it isn’t clear how to proceed. Is there any example code anywhere? I can take other code and start hacking around but the little edit window drives me nuts.
Eventually I’ll sit down and pull apart somebody’s code but it would be helpful if there were a simple sample showing basic syntax and what is minimally required.
Perfect, that’s what I was looking for. There’s enough there to jump start the process and not too much to confuse the issue. Unfortunately the second example is returning a 404 but the first is enough to get me going.
Yes this is groovy. I'm not a programmer but I have learned groovy over the years making appd and drivers for Smarthings and now Hubitat. [:] references a map. Google "groovy map" and I think you will get what you need.
The second link doesn't work because of a new hiccup with Discourse not formatting url's correctly (@bobbyD any update on this).