[RELEASE] Hubitat App/Device Code Update Manager

Ok. With @csteele and @srwhite prompting me I took another look at my settings and was able to make Import work... so now I am looking forward to your Update App even more!

1 Like

I've released my app! You can find the details in the OP.

2 Likes

This is a fabulous initiative. But I absolutely agree with your comment. This should be part of the main platform functionality. To have to run this on another device is really not ideal (as nice as it is!). I noticed some app developers had included similar functionality directly into their apps. So I was hoping their approach would be adopted more widely. Now having a single way to check and update all apps/devices is awesome. But it should really not rely on a separate device/system IMO.

I totally agree that this should be part of the main platform. My app uses undocumented APIs and could be easily be broken by an update. I hope that the Hubitat devs can take inspiration from my app and bake this type of updater directly into the platform. I look forward to the day I no longer need a separate app for this.

7 Likes

@richardpeng Sorry but not sure how to load this. Not a dev. Thanks

It's not hard. you need an RPi, and copy paste a bunch of stuff, type some commands. It's fun and sometimes...it even works for me.

1 Like

You're not a dev and you use hubitat....which requires you to set up rules and install all kinds of code to do anything? :smiley:

Ditto for me too to be honest. I looked at the git and decided quite quickly I'd likely end up exhausting a whole stack of time getting this to work. And I have 2 hubs, have loads of rules set up, have 3 rPi's (doing real easy stuff) as a non-developer but keen amateur techi. I might try it when more people provide feedback and I can find comprehensive instructions for how to set it up.

@xamindar @Angus_M What operating systems are you guys running? I'm working on embedding my app in Electron so it can also run as a standalone native app. Perhaps you guys can help me test that.

OMG! YES! PLEASE! Such a wonderful idea!

1 Like

I haven't got around to setting this up yet (probably tonight). I have a couple PIs already running; arch linux (alarm), and another just running standard raspbian (pihole). I have an unused pi4 sitting around that I can mess with if you had a specific OS in mind.

If I use your docker, I'll probably just set it up on my local arch linux server which already has other dockers running on it.

Just standard Raspian. Happy to test whatever I can that's not too complicated (with the caveat that I usually don't know what the heck I'm doing lol)...

1 Like

A windows app would be great! Chromebook would be amazing. :wink:

There's an assumption that people wanting to use this understand NodeJS and the variances of it.

It's probable the Docker version works as is... never tried it. But for those of us just using Node...

There's instructions for Homebridge that uses NodeJS. I wrote instructions for building a NodeJS instance ready for HubConnect v2.0. Yet neither of those methods work for this product. There are other methods, but what I found worked was:

git clone GitHub - richardpeng/hubitat-update-manager: Check and update Hubitat Custom Apps and Drivers
cd hubitat-update-manager

The above SHOULD create a copy of the ENTIRE github release into a hubitat-update-manager subdirectory. From there, the GitHub instructions should work.

npm install
HUB_URL=http://myhubitat npm start

Where "myhubitat" is the IP address of your Hub.

For experimenting and keeping up to date with any pushes to the code, this is probably OK. It's a bit too 'programmerish' to me. But then again, the paint isn't even dry. :smiley:

1 Like

How about adding support for HE with authentication?

1 Like

@csteele That's strange that you need to create a new Git repo to run my app. You should be able to skip the git init step and just directly clone my repo to run the app. The reason I created the Docker container was so I could throw the app on there and have it running all the time.

I'm definitely a programmer so the initial release has a pretty high setup cost for non-programmers. However, it's helpful to hear how folks are trying to run things so I know what kinds of releases are helpful. Sounds like cloning the repo is helpful for development, but not great because it's not standalone or a persistent process.

I may look into this at some point. I don't personally use authentication so I'd have to set that up in order to test this. If the hub uses Basic auth, then it should be pretty easy.

I updated my post...

git init

isn't needed for Clone. I think it's likely I tried Checkout first... and then just blended the steps.

I'm a programmer too, but it's still a bit of a mind reading trick to determine how each creator of an app/package uses Node.

Because this is new, cloning github is acceptable BUT my reason for writing was to help others who didn't have as much luck with the mind reading trick. :smiley: :smiley:

I assume, that like most, at the right time, you'll publish to NPM and then the instructions will be familiar to non-programmers, who might have already setup Homebridge.

This is the first time I've released a project with such a wide profile of user types so it would be helpful for me to understand what users are used to setting up, especially non-programmers.

Do you have any suggestions or example projects you can link me to to refine my release? Would publishing to NPM be a good first step? What details are helpful in a publish and what could be clearer in my README?

Most HE users know how to install drivers/app and should be pretty comfortable with it. However once you start talking about setting up a node server or docker a number of them will start to feel intimidated.

That being said, this project is interesting for a lot because it adds a highly wanted feature. If you know groovy you should be able to convert it over into a native app. It seems to be pretty much reading/parsing the html. I haven't dug into the actual updating code to take a look at how it works though.

I wanted to see if it was possible and created a method to grab the app list by scraping the html and was able to put this together. It creates a map of the installed app code. I use regex to parse the data, there may be better ways but this was more of an experiment. It could easily be modified to get the driver list and probably other api calls that you use to check and update the codes. But maybe somebody will find it useful and run with it.

def getAppList() {
    def params = [
    	uri: "http://${location.hubs[0].getDataValue("localIP")}:8080/app/list",
        textParser: true,body: [:],headers:[:]
      ]
    try {
        httpGet(params) { resp ->
            log.debug "response.status: ${resp.status}"            
            state.appList = []
            def matcherText = resp.data.text.replace("\n","").replace("\r","")
            def matcher = matcherText.findAll(/(<tr class="app-row" data-app-id="[^<>]+">.*?<\/tr>)/).each {
                def href = it.find(/href="([^"]+)/) { match,h -> return h }
                def title = it.find(/title="([^"]+)/) { match,t -> return t }
                state.appList += [title:title,href:href]
            }
        }
    } catch (e) {
        log.debug "e: ${e}"
    }
    return state.appList
}
2 Likes

I had considered building a native app, but I really wanted to get a proof-of-concept working first to see if I could indeed hit the hub REST APIs to do everything I wanted. I'll have to put together a proof-of-concept native app to see if such an app would work well. Things I'd want to validate are:

  • Make requests to GitHub to download source for comparison
  • Make requests asynchronously and show loading indicators for each row
  • Make AJAX requests on button click without reloading the page

If anyone has done either before, I'd love to know your experiences with it.