Koenkk / zigbee2mqtt

Zigbee šŸ to MQTT bridge šŸŒ‰, get rid of your proprietary Zigbee bridges šŸ”Ø
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.22k stars 1.69k forks source link

PTM216Z #23959

Open chris-1243 opened 2 months ago

chris-1243 commented 2 months ago

What happened?

While trying to pair a PTM216Z, I get this error:

[2024-09-13 17:30:46] error:    zh:controller:greenpower: AssertionError [ERR_ASSERTION]: Failed to find green power proxy device
    at GreenPower.sendPairingCommand (/app/node_modules/zigbee-herdsman/src/controller/greenPower.ts:95:19)
    at GreenPower.onZclGreenPowerData (/app/node_modules/zigbee-herdsman/src/controller/greenPower.ts:181:25)
    at Controller.onZclPayload (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:690:13)

It might be related to the device (IKEA - LED2103G5) to pair it. As the PTM216Z is able to be configured via NFC, I changed its configuration in order to have it recognized as a Greenpower_2 instead of Greenpower_7 and it successfully paired. I tried with some HUE devices but not all are able to translate ZGP frames (Greenpower_7) correctly. 4034031P7 is able but as broadcast only...

The main problem I have is in greenpower_2, this device (at least mine) is not able to send any commands, only press_or_release_all or identify while sniffing traffic.

I have the same issue while using ember if not paired directly to the coordinator.

This issue is mainly based on #22897

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.40.1-dev

Adapter firmware version

20240710 - 7.4.3

Adapter

Sonoff Dongle-P - Sonoff Dongle-E

Setup

Z2M in docker (Pi4)

Debug log

log.txt

Koenkk commented 2 months ago

Could you try with the following change:

docker exec -it CONTAINER_NAME sh
apk add nano
nano /app/node_modules/zigbee-herdsman/dist/controller/greenPower.js
# Change `if (dataPayload.wasBroadcast) {` to `if (true) {`
# save and exit nano
exit
docker restart CONTAINER_NAME
chris-1243 commented 2 months ago

I did multiple tries with the same IKEA - LED2103G5 and an Ubisys C4 and the PTM216Z paired successfully on both devices. It is fully working...

Here a log log_2024.09.14.txt

What is really interesting, it pairs successfully as unicast but its reaction is slightly slower than when it is paired via 4034031P7 as broadcast.

Koenkk commented 2 months ago
chris-1243 commented 2 months ago

So everything works now? Including all the actions?

Yes, all actions are reported correctly

When commissioning, you will see "gppNwkAddr":1282, does e.g 1282 in this case match the network address of any of your devices?

I just had a try on a test network and it doesn't match the IKEA light I used for the pairing.

log_20240916.txt

Koenkk commented 2 months ago

Without the fix, does the issue also happen when pairing via the C4? If not, I guess it's due to the LED2103G5?

chris-1243 commented 2 months ago

Without your fix, I have only two routers able to translate the PTM216Z frames and no latency

The main problem with those, it seems there is a bug in the firmware and the PTM never pairs as unicast...

The Ubisys C4, S2 nor some HUE, IKEA devices and a Dongle-E as a router are able to do the job without your fix. The drawback is the slight latency which is less than 0.5s