IntelliJ plugin to install or update apps / drivers

Like the title says this is a new IntelliJ plugin which will update or install an app or device driver to the Hub.

This was started initially as a way to learn how to write an IntelliJ plugin. I wanted to see if I could extend the functionality of the official IntelliJ plugin to be more flexible.

The basic idea is you can work on an app or driver in IntelliJ and then publish it to the Hubitat Hub without having to copy and paste the code into the web editor.

The official plugin does this but requires you to add a little header to each file:

// hubitat start
// hub: 192.168.0.200
// type: device
// id: 1782
// hubitat end
  1. I wanted to see if the same logic could be done but without needing the header.

  2. I also wanted to see if the plugin could install a new app/driver that didn't already exist first. The official plugin works great but you still have to do the copy/paste thing to create the app or driver in the first place.

  3. Lastly, I had some issues a while back where the official plugin didn't support the latest version of IntelliJ.. I wanted to make sure every version is supported but worst-case it's open source so anyone can update it too in the future

The existing header is fully supported if it's present. But, if one or more of the fields don't exist the plugin will try to figure out the details for you.

  • the 'app' or 'driver' is determined by the contents of the file. You can still manually change this though.
  • the 'ID' field is found by looking up the app or driver on the Hub to find a match. It uses the name and namespace fields to do this
    name: 'HD+ Companion App', namespace: 'jpage4500',

image


The plugin looks at the code to try and determine app/driver. The Hub IP only has to be entered one time when the plugin is first run and will be saved for future use.

This isn't there today but probably not too hard to add.. without adding more UI fields I'd just make the Hubitat IP field accept multiple IP addresses separated by a comma (ie: "192.168.0200, 192.168.0.201, etc"). Then, just do the same logic for each IP listed

I don't believe this will work today. But, it's also something that can be supported - it'll require a second prompt for username/password though that would show up if Hub security is enabled.

3 Likes