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...

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