Hubitat Developer VSCode Plugin

added a configurable network timeout to the settings, default is 15000ms (version 0.0.17)
enjoy!

leave a good review if you like it!

New Install instructions..

  1. While in VSCode, type in Control-Shift-P (Command-Shift-P) and then start typing “Install Extensions”.
  2. Select “Extensions: Install Extensions”.

  1. Search for Hubitat in the Extension Marketplace
  2. Click on install

  1. After the extension is installed, click on the gear icon as select "Extension Settings"

  1. Enter the hub address and credentials if hub security is enabled

  1. With a driver or app open type Control-Shift-P and this time type in Hubitat - Publish. You will be prompted to enter the current id of the driver or create a new one. After hitting enter you driver will be published and reloaded on the hub.

2 Likes

I updated to the new version through VSCode. I installed the new one first then removed the old version and my hub settings even carried over so that was nice.

Also, wanted to point out for anyone new, when you go to run the publish action from the menu I HIGHLY suggest clicking the little gear by it and setting a special Hot Key, I have used Ctrl-Alt-P myself for publish. So I can work on my drivers, hit the hotkey and then within seconds the code is pushed to my hub!

Oh, and I left a 5* review on it for you.

1 Like

@anon47916022 can you see if this is resolved now with the marketplace version?

thanks,
louis

Looks like it's good now. I can see the settings from the extension itself. I don't have Hubitat setup anymore though so I can't fully test.

1 Like

Is this only available in the Microsoft version (vs the open source version)?

I only use the free one

Make sure you are in vs code and not visual studio

Sorry, I wasn't clear. The question was about VSCode (the Microsoft proprietary variant) vs VSCodium (the open source community variant). Microsoft does not allow the VSCode marketplace to be used by the community version, so there is a separate marketplace for the open source version.

1 Like

Ah I see, Im not super interested in publishing to another marketplace, but the github build jobs do build a .vsix bundle that should install in the opensource build.

Yes, install by hand still works.

This add-on in an absolute game-changer for anyone doing development on Hubitat. The ability to rapidly iterate on drivers and apps is just plain amazing. The addition of a setting for adjusting timeout is a welcome change, as I've noticed that my "production" C8 was often timing out on the older version of that add-on.

3 Likes

Thanks Daniel!

Rapid deployment was the main inspiration of the extension, there are three other huge benefits to developing with this tool.

  1. .groovy files remain local, this means they are really easy to version control and stick in git.
  2. The vscode editor is a top notch IDE for this use. searching, copying/paste, shortcuts all make it more enjoyable to write these.
  3. The ability to easy lint and auto format the files really makes for much more readable and idiomatic groovy code. and I think will result in a better code base for all those that use it.

I am really curious what the Hubitat team things about this tool and perhaps we could get some actual published/supported API's for the code/driver management and authorization. How its done currently its a bit of a reversed engineered hack.

1 Like

Thanks @lparks, just installed it from the market place and all settings carried over from the old manual install. 5 star review left!

Would like to +1 vote for an option to have more than 1 hub so that we can publish to our production hub when needed.

1 Like

I have been using this (with VSCodium) for the last week, and let me tell you, this thing is amazing! :star_struck: Thank you for the effort you put in to it!

I have a feature request: can you add a command to publish all drivers at once (everything from .hubitat/metadata.json) ?

1 Like

I've been using this plugin for maybe 6+ months or so. It's been awesome! Will have to check out the new version.

1 Like

Does this auto-complete the functions and classes that Hubitat defines?

no, sorry, not that fancy yet,

Just a thought, not sure how hard it would be to implement...

I've got multiple Hubs. I can swap the IP address in the VS Code settings, which works, but causes issues with the app/driver ID match up.

Would it be possible to add an "ipAddress" entry on metadata.json, and have the extension prompt for not only the "id" of the app/driver when publishing if there's nothing in metadata.json that matches up, but also the address of the hub?

Maybe have the "hubitat.hub.hostname" setting be pulled in as a "default" on the prompt, so everyone doesn't need to type in their hub hostname every time they publish a new file. But that way I could switch between hubs, and the extension would be able to have a different "id" for each hostname.

Or even more amazing would be adding the ip address to the metadata.json and adding "hubitat.hub.hostnameSecondary" to the settings (or something similar) and having a second VS Code command for "Hubitat - Publish to Secondary Hub". That would allow for folks with 2 hubs to not even swap VS Code settings at all. I've got "Hubitat - Publish" set up on a macro keypad for 1-key publishing. Being able to push to my "dev" hub with a single key press would be a wonderful addition.

It's not a big deal, as the extension works great as is, but removing some of the friction for using 2 hubs would be excellent. Not sure how many people have 3+ hubs, so just a "primary/secondary" type setup would likely cover 90+ % of people with a "prod" and "dev" hub, which seems pretty common.

Yea totally what everyone wants. I’ve got some free time I’ve the holidays so I
Might be able to get something to support multiple hubs. I’ve actually been toying with the idea of defining a Hubitat bundle (group of drivers, apps, lib, files) and being able to push that to another hub in one shot. That would help my workflow

2 Likes