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

Then the code is not deleted if it found it again....

HPM still only 'clicks the buttons" for you. The remove clicks were sent to the hub and the hub said no... due to in use.

You should get the same message if you use Delete from the Device Code section.

Find that device and change it to use a different driver (device) and HPM can delete it too.

3 Likes




I really appreciate your time.
If you have time to look; do you see anything?

Unfortunately, I can delete the driver just fine from the drivers device code section.

I deleted the driver from the drivers section, which let me delete.
Then I go back to HPM, and view packages:


.. and it is still being shown there.

I am not sure if HPM will let you delete it once the code is deleted manually. It might be getting jammed up at that point trying to delete something that is not there. You may need to run a "Repair" on that package first, then try deleting it.

Or delete the entire HPM app and install it fresh, a new matchup should not find it if the code is deleted.

This is expected. HPM still believes it's managing the code for you. This is where UnMatch helps to align HPM with your actual installed code.

2 Likes

I am in idiot. I'm sorry guys. I was confusing two issues.
Okay, for the power monitoring driver... it is NOT in my list of drivers.
When I run repair on the 3rd reality from HPM, it says the package was repaired.
If I go back to my drivers, it is NOT listed there.

HPM doesn't know it's deleted, it's still in the in-memory cached manifest. However, it soon asks for the list of App or Driver code from the hub and finds it missing. Deleting code is by number, not name. If you edit the code of any App or Driver, you'll see it's ID or number at the end of the URL:

/driver/editor/675

In this example, 675 is the hub's ID for that Virtual Valve example above, on my specific hub. HPM would then be trying to build the click that lives behind the Remove button on that page. IF 675 doesn't exist anymore due to manual delete, HPM gracefully quits. This is why UnMatch became such a useful tool.

Now you have me doing that... :smiley:

HPM deals in "Packages" -- especially when a Package contains multiple components, a Repair is expected to re-import every component. Manually deleting one component doesn't stop HPM from finding other components within the Package.

1 Like

Thank god.. I'm so glad it's not just me!
I'm thoroughly confused on this one, but what you said makes sense about the id's.

Doesn't this error mean something thinks a device is still using that driver (which isn't listed under my drivers tab)?

An error occurred while installing the package: Failed to uninstall driver Third Reality Power Meter Plug. Please delete all instances of this device before uninstalling the package..

Let me try again, if that's okay.

  1. The third reality driver is not listed in my drivers tab.
  2. HPM thinks third reality driver is installed.
  3. If I try to delete from HPM, I get the error it is in use by a device.
  4. I have no devices set to use the third reality driver.
  5. If I run a matchup from HPM, I get:

Match Up Complete

No matching packages were found, click Next to return to the Main Menu.

  1. Click "next", then "view apps and drivers". Third reality is listed in HPM, but there is still not a driver in my drivers list.

If I then "repair" the third reality... HPM tells me "the package was successfully repaired"... but I still do not see a new driver in my drivers tab.

OHHHHHHH..... "UNMATCH".
I did not see that setting under "Package Manager Settings".... towards the very bottom.
I though "unmatch" was something to be used in the "match" part of the settings.

Okay, I "unmatched" and it is no longer showing.

Why didn't you just say so from the beginning! :wink:

2 Likes

Let me go into a bit more detail on how Repair works...

Via values stored in HPM it will find the code ID for the App or Driver that it installed. Then it verifies it's still there, downloads a fresh copy from the Internet and replaces the code. In other words if a code ID is "1789" then it wants to put the code back into (overwrite) code ID's as 1789. BUT, that code has been manually deleted, "1789" doesn't exist any more. There's nowhere to overwrite with the fresh copy. So HPM just moves on to the next component. (In this example, there's one Driver in the package so 'next' = finished and it displays the 'repair complete' message, having done nothing. :smiley: UnMatch to the rescue.

4 Likes

Got it, Got it.
Yes, a graceful failure... it's beautiful.

And thank you for providing a tool to do just exactly what I needed.
So, always delete from HPM for managed apps/drivers.. and not from your app/driver code list :slight_smile:

Yea... pick a path. If you tell HPM to manage a Package, stick with it. If you change your mind, no problem, UnMatch and enjoy Manual management... If you are using Manual, and change your mind, MatchUp is the answer.

2 Likes

I modified my development HPM to do a repair for manually deleted Drivers:

app:897 2024-01-21 10:22:55.241 AM debug Repair complete
app:897 2024-01-21 10:22:47.338 AM info  Installing Third Reality Power Meter Plug
app:897 2024-01-21 10:22:47.095 AM info  Downloading Third Reality Power Meter Plug because it is missing
app:897 2024-01-21 10:22:46.313 AM debug Executing repair

BUT Dominic specifically excluded this case. Instead, he looks at "required" in the PackageManifest.json and only installs missing code when the developer marked it required.

Looking at the manifest for that Third Reality driver:

  "required": false

So I think, since Dominic's HPM code handles missing (aka manually deleted) code, I'll leave it as is. :smiley:

I'm certain that the documentation might be vague on this point but I also think that at least ONE of the components of a Package needs to be Required = true. The result of Required = false is that it will be an option in the Modify path, which is there to add and subtract optional components of a Package. But even that doesn't recover from manual deletion. This Package contains only one component.. and it's set as optional via "required": false

2 Likes

Very nice!

Completely agree.

I appreciate your transparency when dealing with your code and explanations!

2 Likes

Hi @csteele

Does Hubitat Package Manager v1.9.2 resolve the time out issue for the updating of Webcore?

I am still seeing the timeout with the latest version so may be hit or miss