[RELEASE] Shelly Device Manager App + Drivers

@daniel.winks Many thanks once more for this great work and the speedy response. one minor hitch on the install...

## v2.17.5 fails to install via HPM — manifest app name doesn't match the app's `definition()`

HPM rolls back the whole v2.17.5 update with a NullPointerException. All 67 drivers and the library bundle download fine; it fails on the last step, the Bluetooth Helper app.

``

app:44 22:13:54.766 info Downloading Shelly Switch Component

app:44 22:13:56.190 info Installing .../ShellyUSA_Driver_Library-v2.17.5.zip

app:44 22:13:58.806 info Upgrading Shelly Bluetooth Helper App

app:44 22:14:02.625 info Fatal error occurred, rolling back

app:44 22:14:02.720 error java.lang.NullPointerException: Cannot get property 'name' on null object on line 4325 (method performUpdates)

```

The cause looks like a name mismatch between the manifest and the app source:

```

PackageManifests/ShellyWebhookDrivers/packageManifest.json apps[0].name = "Shelly Bluetooth Helper App"

ShellyBluetoothHelper-v2.17.5.groovy definition(name: 'Shelly Bluetooth Helper')

installed on my hub 'Shelly Bluetooth Helper' (namespace ShellyUSA)

```

HPM logs the manifest name ("Upgrading Shelly Bluetooth Helper App"), then can't resolve an installed app by that name, and NPEs on the null result. Because the entry is `"required": true, "primary": true`, the failure is fatal and the whole package rolls back — so nobody can take 2.17.5.

Suggested fix: set `apps[0].name` to `"Shelly Bluetooth Helper"` so it matches the `definition()`.

### Environment

Hubitat C-7, platform 2.5.1.174, HPM app id 44. Hub Login Security off, 243 MB free memory, and all 69 file URLs in the manifest return 200 — so it isn't a permissions, memory, or missing-file problem.

Workaround for anyone who needs the library fixes now: import the bundle zip directly via Hubitat → Bundles → Import ZIP, bypassing HPM.

Odd... I tested it on my C7 and didn't notice that. I updated it and pushed out a new version, so 2.17.6 should have it fixed.

@daniel.winks Thanks for turning the manifest fix around so quickly. I can confirm `apps[0].name` is now "Shelly Bluetooth Helper" in the 2.17.6 manifest and matches the `definition()` — but the HPM install still fails identically, and I think I've worked out why my original report pointed you at the wrong thing. Sorry about that. Same disclosures as before: I'm fairly new to Hubitat and had help from an AI assistant reading through the code, but everything below is from my own hub.

### 1. The real install failure is being hidden by an HPM bug (not yours)

The NPE isn't in your package — it's in HPM's rollback, and it destroys the error message that would tell us what actually went wrong. In `Package_Manager.groovy`, the update path does this:

```groovy

for (bundle in manifest.bundles) {

def location = getItemDownloadLocation(bundle)

if (!installBundle(location)) { return rollback(...) }

else

    completedActions\["bundleInstalls"\] << bundleToInstall     // loop var is \`bundle\`

}

```

`bundleToInstall` belongs to the install/modify flows and is never assigned during an update, so a null is pushed. Then in `rollback()`:

```groovy

for (installedBundle in completedActions["bundleInstalls"])

uninstallBundle(installedBundle.name)      // line 4325 -> NPE on null

```

So for any package that contains a bundle, if anything fails during an update, rollback dies on that null and the real reason is swallowed. That matches my log exactly — "Upgrading Shelly Bluetooth Helper", then "Fatal error occurred, rolling back", then `NullPointerException: Cannot get property 'name' on null object on line 4325 (method performUpdates)`. The underlying `upgradeApp` returned false, but its message never surfaced. I'll report that one to the HPM maintainers separately; flagging it here mainly because it means neither of us can see the true failure until it's fixed.

For what it's worth I ruled out the usual suspects: Hub Login Security was off, 243 MB free memory, all 69 file URLs in the 2.17.6 manifest return 200, and the installed Bluetooth Helper (v2.17.4) differs from v2.17.6 by only the version comment line — so there's nothing obviously wrong with the app being upgraded.

### 2. Library 2.17.6 needs a driver that isn't in the package

To get moving I imported the library bundle directly via Bundles → Import ZIP, bypassing HPM. That leaves me in a split state — library v2.17.6 with v2.17.4 drivers — so please discount this if it doesn't reproduce on a clean install. But the manifest gap looks real regardless.

`ShellyUSA.ShellyUSA_Driver_Library.groovy` v2.17.6 line 5344, in `createChildVoltmeter()`:

```groovy

String driverName = "Shelly Autoconf Voltmeter"

```

v2.17.4 has no reference to that name. I searched all 67 drivers in the 2.17.6 Webhook/Websocket manifest and there's no Voltmeter driver in it, so nothing in the package can satisfy that lookup. My Shelly Plus Uni (which has an analog voltmeter input for a rainwater tank level sensor) logs `Rainwater Tank: Shelly Autoconf Voltmeter driver not found` on every attempt. The "Shelly Autoconf" prefix is Device Manager naming rather than this project's, which made me wonder whether some code moved across between the two projects.

### 3. NumberFormatException on the voltmeter value

Alongside the above, every reading throws:

```

java.lang.NumberFormatException: For input string: "0.68"

```

0.68 is the voltmeter reading in volts. Over a 4-minute log capture I get this every ~60s (my report interval), plus a burst every ~90s of seven "Preference retrieved from child device (counts / in_locked / freq_rep_thr / xcounts / count_rep_thr / freq_window / xfreq) does not have config available in device driver" warnings followed by the driver-not-found error and a "Connection reset" — 28 error/warn lines in 240 seconds. Net effect is that the tank voltage never reaches Hubitat. It looks like the same class of problem as issue #98 (Shelly Flood Gen4 NumberFormatException), so possibly one shared fix.

### Environment

Hubitat C-7, platform 2.5.1.174. Shelly Plus Uni, `SNSN-0043X`, firmware 2.0.0, driver "Shelly Plus Uni (Websocket)" v2.17.4, library v2.17.6 (hand-imported). I'm rolling the library back to 2.17.4 for now to get a consistent install.

Happy to test any of this — the device is easy for me to power off and on, so I can reproduce on demand. And thanks again for the quick fixes yesterday; the paginated webhook discovery sorted out my 2PM Gen4 nicely.

hi @daniel.winks on Shelly Device Manager v1.0.84 I have no devices detected anymore, did a new install of the app (delete driver) but still "No devices discovered yet. Discovery is running..."
Any idea?

logs

app:36022026-09-02 19:56:22.352traceRecording reachability for 192.168.178.140: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:56:21.766traceRPC reachability probe succeeded for 192.168.178.140
app:36022026-09-02 19:56:21.526traceDispatching RPC reachability probe to 192.168.178.140
app:36022026-09-02 19:56:21.043traceRecording reachability for 192.168.178.57: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:56:20.536traceRPC reachability probe succeeded for 192.168.178.57
app:36022026-09-02 19:56:20.230traceDispatching RPC reachability probe to 192.168.178.57
app:36022026-09-02 19:56:19.594traceRecording reachability for 192.168.178.164: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:56:19.268traceRPC reachability probe succeeded for 192.168.178.164
app:36022026-09-02 19:56:18.979traceDispatching RPC reachability probe to 192.168.178.164
app:36022026-09-02 19:56:17.626traceprocessShellyHelperDiscovery: processing 30 ShellyHelper entries
app:36022026-09-02 19:56:17.075traceprocessMdnsDiscovery: no mDNS entries found
app:36022026-09-02 19:56:16.681traceprocessMdnsDiscovery: _shelly._tcp returned 0, _http._tcp returned 0 entries
app:36022026-09-02 19:56:10.338traceRecording reachability for 192.168.178.140: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:56:10.020traceRPC reachability probe succeeded for 192.168.178.140
app:36022026-09-02 19:56:09.766traceDispatching RPC reachability probe to 192.168.178.140
app:36022026-09-02 19:56:09.091traceRecording reachability for 192.168.178.57: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:56:08.845traceRPC reachability probe succeeded for 192.168.178.57
app:36022026-09-02 19:56:08.536traceDispatching RPC reachability probe to 192.168.178.57
app:36022026-09-02 19:56:08.000traceRecording reachability for 192.168.178.164: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:56:07.680traceRPC reachability probe succeeded for 192.168.178.164
app:36022026-09-02 19:56:07.346traceDispatching RPC reachability probe to 192.168.178.164
app:36022026-09-02 19:56:05.954traceprocessShellyHelperDiscovery: processing 30 ShellyHelper entries
app:36022026-09-02 19:56:05.314traceprocessMdnsDiscovery: no mDNS entries found
app:36022026-09-02 19:56:05.010traceprocessMdnsDiscovery: _shelly._tcp returned 0, _http._tcp returned 0 entries
app:36022026-09-02 19:56:00.263traceInstalled reachability sweep:
app:36022026-09-02 19:55:58.893traceRecording reachability for 192.168.178.140: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:55:58.654traceRPC reachability probe succeeded for 192.168.178.140
app:36022026-09-02 19:55:58.391traceDispatching RPC reachability probe to 192.168.178.140
app:36022026-09-02 19:55:57.793traceRecording reachability for 192.168.178.57: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:55:57.461traceRPC reachability probe succeeded for 192.168.178.57
app:36022026-09-02 19:55:57.204traceDispatching RPC reachability probe to 192.168.178.57
app:36022026-09-02 19:55:56.885traceRecording reachability for 192.168.178.164: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:55:56.407traceRPC reachability probe succeeded for 192.168.178.164
app:36022026-09-02 19:55:56.094traceDispatching RPC reachability probe to 192.168.178.164
app:36022026-09-02 19:55:54.730traceprocessShellyHelperDiscovery: processing 30 ShellyHelper entries
app:36022026-09-02 19:55:54.296traceprocessMdnsDiscovery: no mDNS entries found
app:36022026-09-02 19:55:53.892traceprocessMdnsDiscovery: _shelly._tcp returned 0, _http._tcp returned 0 entries
app:36022026-09-02 19:55:46.928traceRecording reachability for 192.168.178.140: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:55:45.989traceRPC reachability probe succeeded for 192.168.178.140
app:36022026-09-02 19:55:45.457traceDispatching RPC reachability probe to 192.168.178.140
app:36022026-09-02 19:55:44.686traceRecording reachability for 192.168.178.57: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:55:43.525traceRPC reachability probe succeeded for 192.168.178.57
app:36022026-09-02 19:55:42.596traceDispatching RPC reachability probe to 192.168.178.57
app:36022026-09-02 19:55:41.824traceRecording reachability for 192.168.178.164: discoveryEntry=false, cacheEntry=true
app:36022026-09-02 19:55:40.470traceRPC reachability probe succeeded for 192.168.178.164

I think I somehow ended up pushing more to master branch than I intended. I've been busy at work tightening up the reliability of the Shelly discovery and device creation, and (more so) working to reduce the overall CPU usage. I meant to push up just the scripts and child drivers I was working on, since the way the app pulls them straight from github... but I must have also pushed a partway modified SDM app code.

I just pushed up all of my recent changes, it looks MUCH better on my testing. Much lower CPU usage, cuts the app state down from 150,000+ to under 25,000 (on my system, a lot of this is cache, so more devices means yours might end up higher, or lower if you have fewer than I do).

App opens quite a bit faster. Uses less CPU while doing discovery. Queues operations better so it doesn't overload the hub. A bunch of improvements.

Anyway, the latest version should be all patched up. Let me know if you run into any issues.

HPM Error

The update to v1.0.86 did the job, all my Shelly's are visible now.

But I think there is a password issue.
When I use a password protection I have those errors, I am sure the password was correct, I copy and pasted it:-)

When I try to add a 2PM Gen4, the device is not created, this is the log


When I try to add a Plus2pm Gen2, this is the error:


Appreciate your efforts here @daniel.winks , i get the same Download error as TArmna. HPM is looking for 2.17.6, which i think needs incrementing?

Maybe this can help you
I did not used HPM because the app updates itself.
I just imported the app using this link:
https://raw.githubusercontent.com/ShellyUSA/Hubitat-Drivers/refs/heads/master/Apps/ShellyDeviceManager.groovy
and paste it here:
Drivers/refs/heads/master/Apps/ShellyDeviceManager.groovy


image

It take some time to save, lots of code:-)

If it's already on your system you can overwrite it:-)

Yes, you're right, thx to Daniel for the efforts:-)

Looks like it was couple of issues, here... one with the URL on the HPM manifest, fixed that. Then noted an issue with having a method signature duplicated between the library and the driver file. Fixed that too. Checked on my C7 "test" hub. Had to load up a Shelly Uni on it to get the driver in use so I could be sure, but it updated in my test so I think it's good now.

Thanks for reporting this. I don't have any devices using auth, so when the Gen4 devices needed an update on how auth is handled I didn't catch it. Looks like even the gen2/3 auth had gotten broken at some point as well, since it failed when I tested it.

Both should be working now.

Daniel, still an issue when I try to add a password protected device
image

for the shelly2pmg4 I get this:

When I reinstalled the app I got this when try in to add the first device