How to start the development of a Hubitat device driver?

I am a beginner in the development of Hubitat device driver. I have just completed the development of DTH based on the Z-Wave platform. When I ported it to Hubitat, I discover that there are many differences between the two (although there are many similarities) platforms. The question now is, for the development of the Hubitat device driver, where can I find detailed guide about the capabilities and VIDs? Is there a CLI tool similar to "smartthings.exe"? Is there a IDE tool? Can a virtual device be created to facilitate test drives? Where can I create it?Thanks!

Hubitat does not use “vids” or “tiles”, or any of the ST user interface portions in its Drivers.

Capabilities are defined in the official Hubitat Developer Documentation.

https://docs.hubitat.com/index.php?title=Developer_Documentation

There is no CLI, no Web IDE. All development is performed directly on your hub, in the Drivers Code area.

Yea, you can create Virtual Device Drivers, but there is no simulator feature like in the ST Groovy IDE.

4 Likes

I was literally doing an install of VS Code to take tentative steps into seeing if I can move development off the hub. @ogiewon is right, the current practice is essentially developing on a hub, but I do remember one of the dev's I was talking to some time ago had started to try and setup a local development environment, so I'm interested to see if I could do something like that. The recent introduction of libraries and endpoints for uploading code also got me interested in writing my code locally in VS Code with Git installed, then having commands to upload the code to my hub.

I'd also suggest looking at using the Community developed Hubitat Package Manager (HPM) as a way to release and drivers or apps you make, if you intend to do that.

3 Likes

There are three major areas of porting difference (besides nomenclature "Driver" vs "DTH"). Then you can work out others by running the DTH (with an actual device) to ID other differences (I usually found none - but you may encounter some).

Metadata. Hubitat does not have all the metadata (vid particularly) that ST does.
Tiles in Metadata. Hubitat ignores - but you can delete.
HubAction communications:

  • ST uses: "new physicalgraph.device.HubAction"
  • Hubitat uses: "new hubitat.device.HubAction"

Welcome to the quagmire.

Dave

4 Likes

You may also find this WiKi Post helpful in porting code from ST to Hubitat.

4 Likes

Thank you very much! For me at this stage, this WiKi Post is too important!

Without CLI, how can I view the implementation process of capability?

If you're looking to understand the Standard Capabilities that Hubitat supports, you can find that in the Developer Documentation.

https://docs.hubitat.com/index.php?title=Driver_Capability_List

1 Like