Hubitat Publish Tools for Visual Studio

Hubitat Publish Tools, a Visual Studio extension for publishing Hubitat drivers and apps

Most recipes on this site use the apps that come with Hubitat. Sometimes a device has no good driver, or I want an app that does one job my way. Then I write my own in Groovy.

Hubitat’s built-in code editor works, but I spend my days in Visual Studio. So I built an extension that lets me write the code there and send it to my hub. It is called Hubitat Publish Tools and it is on the Visual Studio Marketplace.

Who it is for

This is for people who write their own Hubitat drivers, apps, or libraries and already use Visual Studio on Windows. If you only install community drivers, you do not need it. Hubitat Package Manager is the easier path for that.

What it does

The marker in the corner of the editor shows the publish state for your hub.

Editor status marker reading v7, 2 devices, today, in sync

Compare with the hub opens your local file and the hub version side by side.

Visual Studio diff view comparing a local away-lights.groovy file with the hub version, with one changed VERSION line highlighted

Getting started

  1. Install Hubitat Publish Tools from the Visual Studio Marketplace.
  2. Open Tools > Hubitat > Hub Connections and add your hub’s IP address and credentials.
  3. Open a Hubitat .groovy file, right-click it, and publish.

The Hubitat Connections window lists each hub with its status and host, and has fields for name, host, username, and password.

Hubitat Connections tool window listing three hubs as Connected, Testing, and Not connected, with a form for name, host, username, and password

With more than one hub set up, it asks which one to publish to.

Select Hubitat Connection dialog asking which hub to publish to, with three hubs listed and a Don't ask me again this session checkbox

The source code and issue tracker are on GitHub, in a repo called HubitatVS. Bug reports and pull requests are welcome.

Examples to look at

All of my own Hubitat code lives in my hubitat-drivers repository. It has drivers for devices like a Daikin WiFi thermostat, a Touchstone fireplace, and Fully Kiosk Browser tablets. It also has apps like Appliance Cycle Monitor, Away Lights, and Auto Away Mode. I build and publish all of them with Hubitat Publish Tools, so they are a good starting point if you want to see how a real driver or app is put together.