Zigbee with gen4 Shelly work?

Looks like Shelly is asking ("Request Key") the coordinator for the Trust Center Link Key:

Z2MQTT responds (Transport Key) with a random key (not the Network Key), and Shelly continues with "Verify Key", etc...:


Whereas Hubitat responds with the Default Trust Center Link Key (ZigBeeAlliance09):

And shortly thereafter Shelly leaves the network, probably because it does not like being served the ZigBeeAlliance09 key encrypted using thee same ZigBeeAlliance09 key (see Zigbee Security Header).

Maybe my trusted C-7 is beginning to show its true age...

2 Likes

So I've now tried changing the driver to the 'Generic Zigbee Switch' but it doesn't seem to work. In the logs I have this:

dev:1652025-06-09 20:45:11.797errorjava.lang.RuntimeException: java.sql.SQLException: NULL not allowed for column "DEVICE_NETWORK_ID"; SQL statement:
dev:1652025-06-09 20:45:01.244errorjava.lang.NullPointerException: Value to convert cannot be null. on line 1375 (method parse)
dev:1652025-06-09 20:45:01.179errorjava.lang.RuntimeException: java.sql.SQLException: NULL not allowed for column "DEVICE_NETWORK_ID"; SQL statement:
dev:1652025-06-09 20:44:53.824errorjava.lang.NullPointerException: Value to convert cannot be null. on line 1375 (method parse)
dev:1652025-06-09 20:44:53.670errorjava.lang.RuntimeException: java.sql.SQLException: NULL not allowed for column "DEVICE_NETWORK_ID"; SQL statement:
dev:1652025-06-09 20:44:32.788errorjava.lang.NullPointerException: Value to convert cannot be null. on line 1375 (method parse)
dev:1652025-06-09 20:44:32.701errorjava.lang.RuntimeException: java.sql.SQLException: NULL not allowed for column "DEVICE_NETWORK_ID"; SQL statement:
dev:1652025-06-09 20:44:20.829errorjava.lang.NullPointerException: Value to convert cannot be null. on line 1375 (method parse)
dev:1652025-06-09 20:44:10.473errorjava.lang.NullPointerException: Value to convert cannot be null. on line 1375 (method parse)
dev:1652025-06-09 20:44:10.353errorjava.lang.RuntimeException: java.sql.SQLException: NULL not allowed for column "DEVICE_NETWORK_ID"; SQL statement:

This is wired into a fuse spur for outside lights and doesn't have a physical switch I can change unfortunately.

I have managed to get it working using a custom driver I found in HPM (Shelly 1) but this requires me to have the Shelly device on wifi and to give it the IP address. Inevitably, the IP changed at some point and it all stopped working and I could probably give it a fixed IP but I'd really rather just use Zigbee alone if possible.

Any suggestions at all? I've got 5 of them to set up currently and I've heard really good things so would be keen to get them working via Hubitat if it's viable!

I've also noticed that when I connect a new out-of-the-box Shelly 4, it is detected as Zemismart ZigBee Wall Switch Multi-Gang which seems odd?

Also tried with the custom Tuya Zigbee Metering Plug driver which was mentioned above, but no luck unfortunately

dev:1992025-06-10 15:12:07.594infoKitchen light switch Round-trip time : timeout
dev:1992025-06-10 15:12:07.586warnKitchen light switch no response received (sleepy device or offline?)
dev:1992025-06-10 15:12:01.605debugKitchen light switch off() sending [he cmd 0x5143 0x01 6 0 {}, delay 2000]
dev:1992025-06-10 15:12:01.500debugKitchen light switch Switching Kitchen light switch Off

Went back to the generic Zigbee Switch and got this:

dev:1992025-06-10 15:15:44.903debugoff()
dev:1992025-06-10 15:12:07.594infoKitchen light switch Round-trip time : timeout
dev:1992025-06-10 15:12:07.586warnKitchen light switch no response received (sleepy device or offline?)
dev:1992025-06-10 15:12:01.605debugKitchen light switch off() sending [he cmd 0x5143 0x01 6 0 {}, delay 2000]
dev:1992025-06-10 15:12:01.500debugKitchen light switch Switching Kitchen light switch Off

Tried flicking the switch connected and it shows nothing in the logs. Feel like maybe I'm doing something wrong at this point...

Switch to the HE inbuilt ‘Device’ driver first. Click on the ‘Get Info’ button. Anything in the live logs?

Only this:

2025-06-10 15:37:06.555debuggetting info for unknown Zigbee device...

Gave it a minute to get info, but no more info appeared. How quickly should it appear?

I'm using a Shelly 1 Gen4 (not PM) since it arrived without any issues.
Paired on the first attempt with a C8-Pro (regular pairing, no special options)
I had forgotten, it pairs but doesn't work as expected, you have to pair using "Double Luck Voodoo" then it works perfectly with Tuya Zigbee Switch driver by @kkossev.

It didn't work perfectly with the native driver. It would turn on an off, but the status wouldn't update.
That might have been with the regular pairing, before using "Double Luck Voodoo".

I like the Tuya Zigbee Switch better anyway :grin:

It should respond immediately (less than 100 milliseconds) to the GetInfo command)

Try to pair it again .

1 Like
1 Like

Hi There

I didn't found an answer to my following question, if I have missed something, please excuse and point me to it. Thanks.

Which driver do I need to add a shelly 2pm Gen4

for using via Zigbee?
(I tried generic Zigbee switch, but there are no childdevices, since it's just a normal switch driver)

and for using via Wifi?
(I tried Shelly Plus/pro xpm, by [Custom Drivers (by Dmytro Rozovyk)]) but also not working.

Thanks for your support.

Hi,

I'm testing a Zigbee driver for Shelly 2PM Gen 4 made with Claude AI. It’s in test (beta). There are some codes for tests that will be removed later. The device has two modes of operation (curtain/cover/motor and switch) and depending on the mode it is paired it has different clusters. The default is curtain, Hubitat recognizes it as a curtain controller and configures it with a native driver. To pair as a switch I needed to change in the web interface from curtain(cover) to switch and put it in pairing mode there, in the zigbee section, because I was not able to activate pairing mode using the button without resetting. But it ended up working.


Curtain mode


Switch mode

These are the steps I followed to get the device working:

1 – Pair the device using “Double Luck Voodoo” (the device will be recognized as curtain)

2 – Pair the device in the Shelly app and check the IP address assigned to it

3 – Change the operating mode of the device from curtain (cover) to switch in the Settings/Device Profile option in the web interface

4 – Repair the device. Enable pairing in the Zigbee option of the web interface. Start pairing by clicking the Start Pairing button of the web interface.

Here is the driver code in case you want to test it.

https://raw.githubusercontent.com/joaomf/hubitat/refs/heads/master/Shelly%202PM%20Gen4%20Zigbee%20Driver.groovy

1 Like

I have two shelly 2PM Gen4 modules, trying to get them working in Zigbee mode wit a C7

Tried all drivers that could work, I even had Manus AI write a new one, but the problem is not in the Hubitat.

There is a bug in the shelly firmware for the 2PM Gen4. The in-built diagnostic for the module says "Zigbee BDB error"

I made a ticket @ shelly, now we wait.

1 Like

Ok, please keep us informed on Shelly support response.

1 Like

This was the reply I received for my C-7:

2 Likes

Well,

I made a ticket, they asked for teh device log, both with the stable and beta software, and made me try an RPC command, but Shelly.ZigbeeClaer,
all of which got me nowhere.
Shelly support is quite confident that the problem is in the C7 hub. So I mailed them that my C7 works fine with zigbee devices from 5+ different brands, and that I was postponing the issue till later. (hoping either Shelly or the Hubitat community comes up with something)

And got this reply :

Dear Marc

You can also check our Zigbee connection methods, here:

https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Zigbee

Also, please check this article:

Best Regards,

Shelly Support Team

2 Likes

I wouldn't get my hopes up on this matter.

  • Hubitat seems to have lost interest in the Zigbee ecosystem: install codes, green power, pairing issue with IKEA battery devices, etc. Also, if you complain a Zigbee 3 device does not work with C-7 (e.g. Shelly Gen4 devices), you'll probably get back a response along the lines of "Zigbee 3 devices should be backwards-compatible with ZHA 1.2, so it's the device fault".
  • Shelly has no reason to invest time and money in supporting a ZHA 1.2 device; I wouldn't if I were them :slight_smile:

Anyway, I recently jumped ship to Z2M and I'm shiny! Maybe Hubitat will put Z2M into C-9 like they did with Z-Wave JS (if they keep a Zigbee antenna, that is).

2 Likes

Seems a little edgy and negative toward Hubitat.

1 Like

Dan is absolutely right — Hubitat’s primary focus is clearly on devices and technologies that are popular in the U.S. market.

That’s perfectly understandable, considering that the majority of their revenue likely comes from U.S. customers.

If I were in their position, I probably wouldn’t prioritize projects that generate limited financial return either.

2 Likes

Yet, I am not seeing the problem with the current devices.

1 Like

Right, thanks. So next option :

I'm with hubitat because it's all local. So I want to stay. Also avoid any hussle with re-doing every automation etc when I move to something else.

A C8 or C8pro has Zigbee 3.0, and Matter, and can be placed anywhere. That should solve my problem with the Gen 4 Shelly and give me better coverage.

And as the whole reason for buying the Gen4 is because of poor Wifi coverage in the attic and garage, if I buy a C8 I solve more problems than I have.

1 Like