Feature Request for developers - Import code from file on LAN

Would it be possible to add the possibility to import app/driver code from a local path like we can already do from a website.

e.g. file://host/path/drivename.groovy or something

This would allow us to code in an external editor like "VS Code" and then go to the hub and just hit import instead of having to copy paste the code?

This would basically mean adding CIFS or NFS support, correct?

I think this could just be on the browser/client side. There could be a browse button to the left of import. The browse could just pop up a file system window and let you pick a file. the import would still tell the the browser to fetch the file.

1 Like

Not sure what the best way to do it (not very literate at networking stuff), was just throwing a possibility to make it easier for all of us and for my CTRL, C and V buttons on my keyboard :slight_smile:

This could be a nice work around as long as the browser does not ask for the path each time of course.

1 Like

I am just finishing up testing on a VSCode extension that I wrote that allows for publishing to the Hubitat from within VSCode directly. This will allow you to edit the files locally in VSCode and will a single click publish them to Hubitat.

PM me if you want to help test it!

That being said, the real feature request should be for hubitat to codify the publishing api to publish apps/drivers/libraries. Currently its reversed engineered from the web interface


Here are some details on the plugin...

welcome some testers


I like this idea. I made a script for tampermonkey/greasemonkey.

change the hubname on line 5/6 to your hub's hostname or ip address.

@bravenel @bobbyD this should slip right into your code. Feel free to distribute it.

I've been testing @lparks VSCode extension, and I'm already loving it. Much better than my idea actually, never have to go into the the apps/driver code section during testing.

what if you have multiple hubs ??

well there's all sorts of match patterns.

easiest is just to copy/paste the three match lines for each hub.

// @match       *://hubname1/app/*
// @match       *://hubname1/driver/*
// @match       *://hubname1/library/*
// @match       *://hubname2/app/*
// @match       *://hubname2/driver/*
// @match       *://hubname2/library/*

or just change hubname to *. but that's ickier.

// @match       *://*/app/*
// @match       *://*/driver/*
// @match       *://*/library/*
1 Like