Hubitat Developer VSCode Plugin

Thanks for all testing Jeff. I sure do appreciate the support. Let's give it a little mileage, then I say we push it to the extension marketplace.

Next release maybe ill update the timeout to 20secs. I think I oringinaly reduced it, just to more quickly give the user quicker feedback when the hub couldn't connect.

1 Like

If you go to the extension settings, from the extension menu, you get no results:


image

But just navigating to the extension from the Settings tree shows up just fine.

Aside from that, the few things I've pushed have worked without an issue. A nice to have for later would be the ability to more easily switch between hubs...though I'm not sure what that would look like. Use-case is that I have two hubs and, from time to time, like pushing code to both hubs before publishing. I do most dev work and initial testing on my hub with no zigbee/z-wave devices. Depending on the app, I'll push it over to my main production hub with all my z-stuff for a little more testing before publishing to github.

How about adaptable time based on the number of lines in the code or num of characters + some user selectable time (1-5 seconds) via settings as a buffer, then display this timeout time when sending the code to the hub?

Just wanted to follow-up to say I've been using this extensively over the last few days and it is such a HUGE time saver. Thank you very much for this!!!

1 Like

Me also, was working on a driver and it was so nice to just push updates quick without having to copy and paste! You even get the error messages back in the app if your code is invalid and wont publish.

TIP: make sure you set a hotkey for it also, I landed on CTRL-ALT-P (for publish), could probably do H also for Hubitat. Seems like CTRL-ALT are widely available, CTRL-SHIFT everything I tried was taken already.

1 Like

Guys, thank you all.. It made my day to hear this. It ended up taking more time than thought it would take, but I am happy to be able to contribute back to the Hubitat community. I hope something like this might the HE team to support the publish API officially, as it stands now, it was reverse engineered from the web-app. I am actually surprised, they haven't officially published something yet. Seems to me that have a real IDE option set of development would really improve the developer buy in and overall code quality and consistency of the drivers and apps out there.

Anything else before I push it out to the VS Code marketplace? Do we think it's ready???

1 Like

This is just cosmetic really but someone else pointed out the settings only show if you navigate to them manually. I do not use a lot of extensions but on the spell checker I have, these steps bring up its settings. On your extension it just comes up blank. Click the gear > Extension Settings. I would expect to see the settings.

Other than that, the occasional time out is the only other issue I have found, which I think you were going to make longer.

1 Like

Just getting this set up. How does this work exactly - can VSCode download the current apps and drivers from HE, to sync the files onto a local folder? Or is the plugin one-way upload to HE from a local folder?

Its a one way upload, so if you do not have local copies you would want to download the files you are interested in working on to a local folder (or something cloud synced if you prefer, I use dropbox). Then ideally you will want to open that folder as a workspace in VS Code.

I would then suggest setting a hotkey such as CTRL-ALT-P to the publish command. When you search for the command in VS Code you will see a gear by it, if you click that you can set a hotkey.

Once you do that you just open the file from the workspace, and press your hot key. It will ask you for the ID number the first time publishing it. If you go to the code list on the hub and hover over the driver, you will see the ID number in the URL (or click on it to open it if the hover does not work). Put in that ID number and it will replace it with whats in VS Code. If you dont give an ID number it will create a new entry in the code list and remember the ID number assigned.

3 Likes

Jeff, did you add the extension to VSCode marketwhatevertheycallit ?

I am not the author of this great extension, I do not think he has added it yet. It is pretty easy to grab it from GitHub and install it manually though. The only remaining issue is the timeout is not long enough and sometimes it will time out on me, but a second push and it goes. Still better than manually loading the code in!

1 Like

Sorry, for some reason I was under the impression (I'm way overworked), lol

@lparks, did you ever release the extension on VSCode market?

1 Like

not yet. wanted to fix the few issues and push it, but ran out of time and didn't hear enough people clamoring for it yet. Also, was hoping a little more mileage might flush out more bugs.

1 Like

The only issue that's been pretty consistent is that the first push of the day seems to always result in a timeout. So, I just push the update again and then get the alert that the versions don't match. My guess is that the push is finishing but whatever response the extension is waiting for isn't happening within the 10 second timeout.

1 Like

Ah, blast. I got this all set up only to get the message that it doesn't work for hubs with login security. Wonder how hard that would be to add....

Current version does work with security, I use it.

In VS Code bottom left, click the gear, then Settings.
Expand Extensions, Go to Hubitat section, fill in your username and password.

For some reason if you click the extension and hit settings it says no settings found, but if you go in that way I described above you can get at the settings.

1 Like

At first it did not support it, but now it does and I turned back security on my development hub and all works perfectly, Check just above this post for how to get it setup!

1 Like

Yup, thanks got it working. I think I saw some documentation still saying that it doesn't work. Might hvae been on the extension page or github - can't remember offhand, but it might need updating

Hi All! I was back writing some drivers and decided to finally go ahead and publish this extension to the VS Marketplace. Please give it a whirl when you get a chance. Version 0.0.16 is the latest. No big changes, but I needed to update the publisher name to get the settings to work properly from the installed extensions gear icon. It should work with your existing meta datafile, but you might need to re-enter the address and credentials for the hub.

I am curious if folks have still been using this last year and if it has been helpful. Also, we can start a list of things that folks would like to see in added to it. Perhaps some basic driver/app templates? better support for for multiple hubs. Let me know!

2 Likes

Yes I have been using it, love it. I will update tomorrow and see how it goes.

Support for multiple hubs would be a great upgrade for me, I push code to my production hub sometimes.

Also, having the timeout configurable would be nice. I had one the other day which would push but kept getting the time out error, was a very large app that took a while to save.

2 Likes