[RELEASE] Hubitat Package Manager (HPM) -- HubitatCommunity

Me too, Has 2 HPM's showing.

I ran repairs of all apps in HPM including HPM, ran update, 1.8.5 showed up and updated. Hopefully settled now.

I got this too.

Being the impatient type I just deleted HPM from Apps and its code from Apps Code, reinstalled the code using the link and added HPM back to the Apps list. A quick "Match Up" and it's as good as new.

Just did the same, all good now. Current version v1.8.5

It's strictly a cosmetic thing. I understand using "the big hammer" to fix it, but nothing but a display got fixed :slight_smile: But yes, that big hammer does the trick :smiley:

Be careful, and don't hit your thumb. :smiley:

Remember, HPM can only get HPM code from the single repository. There aren't two copies.

3 Likes

Always with the big hammer here. :joy:

Sorry for the dumb question, but for some time I've quite liked the idea of using the Libraries code feature to reduce duplication (and maintenance!) in my drivers, but I've always assumed distributing those would require a bundle. Is this right?

If so, do I need to go through this manual process of creating a .zip? That seems like it would be a pretty laborious process, moreso than just copy-pasta-ing the "library" block at the end of each driver and updating the repo directly via GitHub.

If not, how do I use HPM to install both driver and library code? Could I simply make the library code mandatory using the existing "required" tag in packageManifest.json under a libraries block, something like this:

"libraries": [
    {
      "id": "blah",
      "name": "Some MegaLibrary",
      "namespace": "BirdsLikeWires",
      "location": "https://raw.githubusercontent.com/birdslikewires/hubitat/master/libraries/megalibrary.groovy",
      "required": true,
      "version": "1.01"
    }

?

1 Like

NO.. NO... NO... LOL

You build a Bundle right on the Hub.

Click Bundles:New Bundle and get that screen. Just select the pieces. Give it a name, give it a namespace and click Save and export. Bingo. You're all done.

Like so:

Or like this if you have a mix of components:

https://hubitatpackagemanager.hubitatcommunity.com/bundles.html

Mmmm, that was what I feared. I have a bunch of drivers split by manufacturer and don't necessarily want to force the end user into installing all of them when they may only have one device from that brand. Looking at this I would need to clickety-click through this process for each driver and its associated library to keep that granularity.

Would adding the library as a requirement in the manifest not work? I haven't checked if this is a supported thing to do, but I figured apps and drivers land in the right place with HPM anyway, so perhaps the same would be true of libraries..?

I did something like that for HubConnect... I built a "Server" bundle, a "Remote" bundle and then a bundle for all the drivers.

Screen Shot 2022-06-06 at 4.52.53 PM

In that example, I'd be suggesting that everyone install the drivers and then pick either of the others depending on intention. :slight_smile:

1 Like

Thanks, I shall have a think on it. See what pans out the best for my workflow, such as it is. :laughing:

The final item I have on my HPM wish list is what others have called "Un Match" -- it's a mechanism for allowing a package to be "rediscovered" during the Match Up process. In other words, you'd Un-Match a package, then do a Match Up to cache the latest Package Manifest. I think this would be used when a Developer relocates or restructures their Manifests.

This is a tease of what I have built:

Let's start with a slightly familiar instance, I need to clear out the existing cached Manifests...
Screen Shot 2022-06-06 at 10.16.37 PM

I begin here:
Screen Shot 2022-06-06 at 10.24.09 PM

I select the Package Manifests that need to be cleared from cache:
Screen Shot 2022-06-06 at 10.24.39 PM

Then proceed through the familiar screens:
Screen Shot 2022-06-06 at 10.24.55 PM

Screen Shot 2022-06-06 at 10.25.01 PM

Screen Shot 2022-06-06 at 10.25.08 PM

Resulting in what I expected to see:
Screen Shot 2022-06-06 at 10.25.28 PM

Cool, right?

11 Likes

I'm seeing similar. For a few days I was getting prompts to say there were updates available but then when I ran the update it says everything is up to date.

I ran a repair and it installed 1.8.5. However this morning the banner is there again 'updates available'. When I've ran the update, it's telling me that the latest version is 1.8.5 and that 1.8.3 is currently installed? The image below shows this and the screen also indicates that the current version is 1.8.5 already. I've checked and there is only one instance of HPM installed:

1 Like

Looks like I have all my hubs up to date on HPM. On each hub I repaired which added the banner saying it was at 1.8.5 but generated an error and rolled the code back to 1.8.3. I then did an update and the code was back to 1.8.5 and had the banner.

Except for my last C7 hub it did not generate an error during the repair but it still rolled the version back to 1.8.3. Doing an update then brought it up to the current revision as well.

As long as it's only displaying 2 HPMs and not actually running 2 HPMs, I'm okay to leave it like that until that display issue is resolved. I'm not a big fan of uninstalling / reinstalling if I can avoid it. I feel like i'll lose all my configurations if I did so.

You shouldn't need to. Doing a repair then update should fix the double issue for now. You won't lose any config options. Those aren't touched.

1 Like

@csteele with the issues above just want to share some anecdotal information that might be relevant.

I had has issues with random debugs in my log for ages in HPM long before your changes but just ignored them. With your changes and knowing I had migrated I went nuclear to give a clear out.

I uninstalled HPM and then looked at the code and clicked the import button in the app code page. What I then spotted was the code jumped from 1.8.4 to 1.8.3.

I copied the URL from the code and pasted it in the import and then tried again and it grabbed the latest.

I then installed, matched up and logs are clean and updates are smooth.

So I was thinking, my understanding of HPM is basically it goes out and clicks that import button? So maybe this is why some are having issues because that button is not taking the change in the "import URL" in the code. Then it's going backwards then the update pulls it forward and so on.

It's not the first time I have seen that button string not get updated.

I don't think it's exactly an Import. HPM reads in the code from a repo and then asks the Hub to save it. It looks more like a Paste of the code into the code window followed by a Save click, to my eyes.

2 Likes

I'm just about to dive into some driver updates again but was wondering... does HPM have the ability to install Libraries Code right now? Reading back I saw @dman2306 mentioning it with the same caveat on time I usually flag up!

I can't see anything in the documentation about it, but before I go nailing some JSON together I thought it was worth a quick ask here.

As mentioned in another post, I have tried to not touch any of the code related to Apps and Drivers for Install, Update, Modify, Repair, Uninstall, and so on. Libraries are found at {Your IP}/library/list and similar: /library/editor

The word "library" does not appear in the code. If I remember right, he said Libraries would be a better fit than Bundles.

On the other hand /fileManager/ does appear.

1 Like

Thank you, yes, I've just had a search too and it looks as though the time was never found. I know that feeling. Maybe I could try "bundling" only the library in the first instance... ignore me, thinking out loud now.

Ta.