Koenkk / zigbee-herdsman-converters

Collection of device converters to be used with zigbee-herdsman
MIT License
896 stars 2.99k forks source link

Switch Bticino / Legrand K4003C/L4003C/N4003C/NT4003C #7973

Open CodeForLove83 opened 1 month ago

CodeForLove83 commented 1 month ago

Hi,

unfortunately the device cannot successfully pair with z2m. A few of them complete with success but many others, with the same firmware version, does not complete. z2m completes interview and configuration but then the light on the device is red and after a few seconds become unresponsive and is not possibile to refresh interview/configuration or publish any Zigbee message.

Pairing with Legrand Gateway and Deconz complete with success and the devices can operate without any issue.

I guess fixing Legrand pairing with this device will fix also other issues, that I have and read in other posts, related to Legrand devices (e.g., shutter).

Digging into the problem I noticed there's an issue in handling attribute 0xf000 during pairing, but even with the fix this is not a solution (link).

@Koenkk can you help me here? Attached you can find Wireshark pcaps of deconz (success) e and z2m (failure). Archive.zip If you need I can sniff traffic with Legrand gateway.

Thanks for your precious support.

Koenkk commented 1 month ago

What the network key for the Deconz sniff?

CodeForLove83 commented 1 month ago

What the network key for the Deconz sniff?

45:60:60:af:e5:86:d3:d0:ab:26:2e:ae:f2:bf:2c:e8

Koenkk commented 1 month ago

For some reason, with Deconz it does the read to a Legrand device, with z2m it doesn't do the read at all:

Screenshot 2024-09-13 at 13 49 16

Does it help when only permitting join on a Legrand device when joining it to z2m?

CodeForLove83 commented 1 month ago

It doesn't work. The only thing I haven't tried yet is resetting the coordinator and the network, basically starting from scratch. Not sure it makes any sense. Do you have any suggestion?

Koenkk commented 1 month ago

Could you check if the issue also happens with z2m 1.34.0? (https://github.com/Koenkk/zigbee2mqtt/discussions/22734#discussioncomment-10646999)

CodeForLove83 commented 1 month ago

Hi @Koenkk, I need to google to find an easy way to downgrade without backup. If you already have the solution, please share :D Conversely, I need to install and configure z2m without HA to test it.

Koenkk commented 1 month ago

I think it would be the easiest to setup z2m on a laptop, follow e.g. https://www.zigbee2mqtt.io/guide/installation/01_linux.html

CodeForLove83 commented 1 month ago

Could you check if the issue also happens with z2m 1.34.0? (https://github.com/Koenkk/zigbee2mqtt/discussions/22734#discussioncomment-10646999)

Hi @Koenkk, unfortunately it doesn't work :( same as latest version. It unpairs right after successful configuration.

Any idea? Next week I'll try sniffing pairing with legrand gateway.

Koenkk commented 1 month ago

@CodeForLove83 no clue yet, lets see if there is anything in the gateway sniffs

CodeForLove83 commented 4 weeks ago

@CodeForLove83 no clue yet, lets see if there is anything in the gateway sniffs

Hi @Koenkk , attached you can find the fresh sniffing from Legrand Gateway and device. legrand-garage-pairing-OK-onoff.pcapng.zip

I edited this post to add a pcap of the pairing with Z2M of another device but same model. fail-foto-z2m-latest.pcapng.zip

At first glance it seems no verify and confirm key are exchanged during z2m pairing process.

Hopefully you can fix it. Just let me know if you need anything else. I can't wait to get your response.

Thanks

Koenkk commented 3 weeks ago
CodeForLove83 commented 3 weeks ago

Hi @Koenkk

Other Legrand devices (~70 devices) are pairing without any issue. I'm start wondering if there's any Conbee3 firmware issue ... I ordered in the meantime a Sonoff ZBDongle-E (V2 model, EFR32MG21), it should be delivered by this Friday.

Let me know if you notice anything in the Legrand sniff. Thanks a lot

Koenkk commented 3 weeks ago

Other Legrand devices (~70 devices) are pairing without any issue.

So you managed to pair 70 devices except one to your Conbee III?

CodeForLove83 commented 3 weeks ago

Well, mostly are pairing fine, others need to do some tricks (mentioned in other posts).

In general pairing Legrand devices is harder with z2m than Deconz.

Nevertheless I really do like z2m and it'd be great to spot the issues and fixing them all to fully support Legrand devices.

I'm obviously open to contribute actively with z2m.

Have you found anything interesting within the Legrand Gateway sniffing?

Trexano99 commented 3 weeks ago

Today I got the same problem adding a K4003C switch to z2m but maybe i have found a workaround. Reading the Bitcino documentation, I have found that the devices goes in pairing mode after booting them (so turning down the ac and then after a minute getting it up). So maybe you can also try my step:

  1. Press the reset button until the switch light flash red
  2. Turn off the alimentation of the switch (from the electric panel) for a minute
  3. Set z2m in pairing mode and turn on the switch alimentation
  4. The switch should pair and not disconnect

I hope this work also for you! Let me know.

CodeForLove83 commented 3 weeks ago

Hi, I've already test it out and it doesn't work. Which dongle are you using?

Trexano99 commented 3 weeks ago

Zigbee Dongle-E flashed with firmware ncp-uart-hw-v7.4.3.0-zbdonglee-115200.gbl

CodeForLove83 commented 3 weeks ago

The Legrand gateway can pair with the device without power it off. I've attached in my previous comments the pcap of the sniffing.

I need to figure out if this is a firmware dongle issue or a z2m one.

Let's see what @Koenkk suggests.

Koenkk commented 3 weeks ago

One diff I see is that the Legrand gateway does respond to the Node Descriptor Request while z2m doesn't, but neither does Deconz so this cannot be the issue. Can you make a sniff when pairing the device directly to the coordinator? Keep it close to the coordinator and from the frontend only enable joining via the coordinator.