Hubitat Developer VSCode Plugin

new version 0.0.10 is out..

  • Hides Hubitat status bar for non .groovy files
  • Fixed progress spinner when updating code
  • Logged better error messages when failing to add a NEW code(driver,app,library)

0.0.11 published
this adds back the ability to specify an existing id on a new publish

1 Like

Ok this looks amazing, I was all exited to try it out but then saw it needs Hub Security off :frowning:

I may turn it off just to test it out, I honestly could probably leave it off but logging in is not a big deal for me so I just feel better with it on to keep anyone else out.

1 Like

Yes, to get settings to work, but still getting this error even with Hub Security disabled.

image

Tried clearing the settings and deleting the .hubitat\metadata.json, then restarting VS Code. Still getting that error. Also tried publishing as a new driver and to an existing id.

Thanks for testing it. It really goes a long way to a get to viable MVP that I can put in the extension marketplace.

To save some time can you please send me the exact driver file you were trying to export?

Hub security wasn’t in my original MVP just because I don’t have it turned it on on my development hub. I can revisit that.

I also need to see if restarting is common on installing a new plugin to get the settings work or there is some trick.

Thanks again.

Here is the driver I was trying to publish:
https://raw.githubusercontent.com/jtp10181/Hubitat/main/Drivers/zooz/zooz-zen-dimmer.groovy

I tested it again this morning with a very simple driver and got it to work. So then I thought what the heck I tried it with this dimmer driver again as well, and that works now. Maybe something with the hub security was cached and it just had to clear out? I had tried it once before I shut off security on accident.

Both drivers did get this timeout error once and then on the second try they installed.

image

Hi all, again thanks for testing this with me! Just want to confirm, that the settings were showing in the extension tab, but they just were not taking effect until a restart. Is that correct? If so, i found the issue and it will go in the next build.

1 Like

I could not even see the extension in the extension tab until I restarted VSCode.

I think I was in the wrong settings, in the Ctrl-Shift-P menu when searching for it, I clicked the little gear, which brought up a settings page that was blank. After restarting VSCode I had the option to set a hotkey for the plugin.

I now see the settings you have a screenshot of up above and I have a red warning on mine.

image

Hostname is null for some reason, I will fix it manually.
image

I think this is the linter you are talking about? GitHub - nvuillam/vscode-groovy-lint: VSCode extension to lint , correct and format groovy and Jenkinsfile
Also, your groovylintrc.json file link does not work, can you re-post it?

I noticed there was a 0.12 version so I updated to that. When I try to publish a file for the first time and it asks for the id #, I put that in but it creates a new file anyway. I went back in and edited the metadata file to correct the id number, deleted the duplicate driver created, and after that it publishes to the correct place. I tested it twice.

I reverted back to 0.11 and it works correctly, despite the error saying not published the first go around it stores the id number and works.

This plugin really is going to be awesome when I start working on something more heavily!

I’ll double check that. I’ve Been off on vacation this last week. I have version 13 almost ready to go should be in the next few days. It should also have support for security enabled hubs.

Thanks for sticking with it team. It’s going to be great. I’ll publish it to the extension marketplace so it’s super easy to install and upgrade

2 Likes

i just pushed 0.0.13.

This should have fixed the manual id prompt and also it should now support security enabled hubs. username and password are in the settings.

1 Like

I am constantly getting this error now. You may need to up the timeout to like 10-15 seconds (or make it a setting?). Drivers can take a long time to post on my hub possibly because I have so much custom code on it. With like 5 attempts I got it to fully work once.

image

They are however uploading, just the plugin is not waiting long enough to get the OK back.

EDIT: Have found it only happens with my really complex drivers which take an extra long time to save. Most other stuff it works great on.


In the settings can you set the password field as a password somehow so it will mask the password once it is inputted? Its not really a big deal for me but I am sure other people will think it is less secure because it is visible. Also may want a warning that it is saved in plain text (I assume it is).


Can confirm the bug with the inputting driver id does seem to be fixed and also the hub security is working! Thanks.

Thanks for testing. I’ll increase the timeout. There is no password masking in the settings. It was the first think I looked for. Best I can do is hide it entirely in settings and make users edit it directly in the settings file.

Not sure what would be better there with the password. Its easier if its right in the settings obviously.

Could you re-post your .groovylintrc.json file? The link on your first post is not working. Might be worth mentioning the exact lint plugin your are using as well, although I think I found the correct one.

2 Likes

0.0.14 released with increased timeout

1 Like

This is the groovy linter I use. With the above lint file you should be able to produce a clean driver and app for hubitat. I will warn you. It's fairly opinionated, and will take a while to take an existing file and refactor it to be compliant., but if you do take the time to get your code to zero warnings/errors, the results are some good looking code following some very basic groovy idioms. If you are starting a new app/driver.

2 Likes

Working great now, I got one timeout on the first try but then tested on around 5 drivers I had not published yet with your plugin and they all worked. Looks like my more complex stuff takes about 7-8 seconds to post so the 10 second timeout seems to be working.

1 Like