[PRERELEASE FEEDBACK WANTED] Shelly Device Manager App + Drivers

I've been working on a new "Shelly Device Manager" app, with a full suite of drivers. It's an app that displays all the "discovered" Shelly devices on your network. If you have one or more Shelly Devices installed, and you've enabled the "Bluetooth Gateway" functionality of the app, it'll autodiscover Shelly BLU devices as well. It runs mDNS and a subnet scan for Shelly devices, and you can manually specify an IP address or dns name for it to probe manually, too, if needed.

It's just a single stand-alone app. No drivers to install. When it discovers a device it'll grab the latest driver from the ShellyUSA GitHub repository where this project is hosted, install it on the fly, and create a device in Hubitat using that driver. If you remove a device and it's the last one using a driver, it'll clean up the installed drivers. The app auto-updates at 3AM, so once installed there's no further management needed on your part.

Looking for some community feedback to drive the direction of this development before I wrap things up and put out an official release.

Anything anyone want from their Shelly devices that doesn't work on Hubitat? Any missing features? Any devices lacking proper support?

So far I've added device support for practically every Shelly device made, WiFi and Bluetooth. There's even drivers for the Shelly Sense and the Shelly BLU TRV. So far this is what I've got put together:

7 Likes

Damn - that looks great! Thank you!

3 Likes

Kind of stuck at "Wow" and not sure where to go from there other than thank you! :smiley:

I'm pretty sure you're aware of the utility of Shelly plug LED controls and have included that. :slight_smile:

This sounds extremely cool.

1 Like

I’ve got some older (First Gen) Shelly Uni devices. Would they work with this app?

Thanks! I spent a fair bit of time getting this together.

I made a more or less complete suite of drivers, but there's a lot of "variants" for Shelly devices. You've got "Plug US", "Plug UK", "Plug EU" etc... they're all the same device, same driver. But when putting that on HPM do you just name the driver "Shelly Plug"? There'll always be folks going and looking for "Shelly Plug US" and being confused when they don't see the exact name available as one of the options. It gets muddier when dealing with the various "here's a Shelly with 2 inputs and 2 relays"... there's gen 2 and gen 3 versions of that, in normal, mini, Pro (DIN) formats. Internally they're the same, but they're very much different outside.

So even with putting 'no duplicates' on HPM, then install still presented the user with dozens of drivers to pick from. They'd have to go install the correct one, get the IP address of the Shelly, add that to the device preferences page and save it. They need to make DHCP reservations to keep that IP address stable.

This needs none of that. It finds the device. It figures out the correct driver, so you don't have to worry about picking the correct one. It doesn't need a separate "helper" app if you want a BLU device to work. Heck, you don't even need DHCP reservations. There's 2 different ways this app will auto-update the IP address of your Shelly if it ever changes. First, any time it's "discovered" again, if the IP address changed, it'll update it. Then almost every device sends packets to port 39501 when there's state changes, temp changed, scheduled 'check-in', etc. All of these will update the IP if it changes. DHCP reservations are still a good idea, but at the very least if your device changes IP it'll get fixed up in a relatively short time automagically.

If you have any BLE capable AC powered devices, there's an option to click on the UI to install the BLE Gateway script, which relays BLE packets back to Hubitat and sends them off to the BLU devices created on Hubitat. The BLU TRV even works, relayed through the Shelly BT USB gateway it's paired to.

The Shelly Wall Display has a driver, for the various sensors on board. The Shelly Sense also has a driver... admittedly I don't have one of these on hand since they're discontinued, but it should work, including issuing IR commands to devices, from Hubitat. So if anyone has one of these and wants to have a bit of back-and-forth to iron out any bugs in that driver, I'd be happy to.

All of the drivers are stand-alone in terms of their "parse()" not relying on the parent app, so all incoming state updates are rather low overhead. When sending commands, they all relay through the parent app, because the code needed to send commands to Shelly devices is rather complex, and I didn't want to duplicate it across the drivers, nor did I want to have a massive library that everything uses, since dealing with libraries on Hubitat is not very nice to do.

There's options to set power monitoring reporting interval, as well. I ended up crafting a Shelly Script that sends the power monitoring data to Hubitat at a user-specified interval with reasonable decimal precision and only sending changes when there's an actual change. That's much much less CPU load than using MQTT or Websocket, as neither of those have an option to set the reporting interval, and by default it's every 0.88 seconds.

3 Likes

Yes, I'm waiting on a Gen 4 to test out, but it'll have a driver with an optional child RGB device that should act like any other RGB in Hubitat, to control the LED. There was a bit of a shipping snafu so it'll be a couple more days before I have one in hand to test.

1 Like

Yes, every single Gen 1 device is covered. I've got the Uni Gen1 working on my other library, so it'll function much the same here. If there's anything in particular you need, let me know. I have one to test with, but I don't have a "use" for it presently, so I'm just testing basic functionality and not any particular use-case.

2 Likes

Ah, two question I forgot to ask...I'm new to Shelly devices so couple questions:

  1. For non-"BLU" devices, do the Shelly devices need to already be connected to the local network via Wi-Fi (or Matter over Wi-Fi) to be found & set up?
  2. If a Shelly device is already set up via Zigbee and it supports Wi-Fi/BLU, will discovery/setup via this manager find the device/proceed?
  1. For this app, yes. They need to be on the WiFi. This app doesn't do anything with Matter, and honestly, Matter is still half-baked. Quarter-baked, really. Maybe not even that. Maybe one day it'll be good, but for now it should be thought of as a last-resort option.

  2. Yes, if it's on WiFi, it'll set it up via WiFi. For some devices that have ZigBee, the ZigBee functionality is limited. For some things, it's fine and "good enough" and you have no real need to bother. If it's just a wall plug and all you ever want to do is just turn it on and off, then sure, no need to bother with anything else.

This app is focused on purely WiFi devices, and "BLU" ones. For the BLU devices to work, you need 1 or more Shelly devices that have BLE and Shelly Script components. This is most AC powered devices Gen 2+, so most likely already covered. But the BLU stuff works by installing and enabling a Shelly Script that relays the BLE packets from the Shelly WiFi device over to Hubitat. They arrive on port 39501 and get routed to the device matching the MAC address that sent it, ie, the Shelly WiFi device driver. That then forwards up the message to the app, which then reads it, matches the embedded BLE MAC address from inside the JSON body to a BLU device that has a driver on Hubitat and then that device gets updates from the Shelly Device Manager app. It doesn't use any of the new "C8 Pro Only" BT stuff, it purely relies on using a Shelly as a BT relay.

2 Likes

OK, count me in @ wow!

S.

Thanks for the deep dive/details, appreciate it.

Ah, I was initially thinking the BT stuff was related to the new C8-Pro/BT capabilities, thanks for clarifying that it runs on C7 & earlier hubs.

Yay - I'll be able to turn off/turn down the Shelly plug power reporting which I would rarely use.

Looking foward to playing with this!

You already can, with the color picker driver. :roll_eyes:

1 Like

Yup - using your excellent driver now, of course. :slight_smile: But there is the constant lure of new toys (devices, drivers, integrations, etc.) and I am going to take another look at Shelly devices in general based on my good experiences w/the plug. :wink: