zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
720 stars 669 forks source link

[Device Support Request] Add Friends of Hue Zigbee Green Power EnOcean Switch #2477

Closed smartmatic closed 1 week ago

smartmatic commented 1 year ago

Problem description

Zigbee Information from NodOn EnOcean Friends Of Hue switch could not parsed

Solution description

Add new ZHA device

Screenshots/Video

Screenshots/Video [Paste/upload your media here]

Device signature

Device signature ```json [Paste the device signature here] ```

Diagnostic information

Diagnostic information ```json [Paste the diagnostic information here] ```

Logs

Logs ``` Logger: bellows.ezsp.protocol Source: runner.py:179 First occurred: 09:58:40 (25 occurrences) Last logged: 10:03:19 Failed to parse frame gpepIncomingMessageHandler: b'7fd6d5003e1f71013e1f71016b02010000d5090000138a2d22a2ff00' Failed to parse frame gpepIncomingMessageHandler: b'7cd6d6003e1f71013e1f71016b00000000ffffffffe0ffffffffff2e02c5f2a835585ccd1a43d08badddcf2ace49e86f22d7b0d609000004111011121314151617226062636465666768' Failed to parse frame gpepIncomingMessageHandler: b'7fd6d7003e1f71013e1f71016b02010000d709000068c5233053ff00' Failed to parse frame gpepIncomingMessageHandler: b'7fd7d8003e1f71013e1f71016b02010000d8090000100c9299c5ff00' Failed to parse frame gpepIncomingMessageHandler: b'7fd6d9003e1f71013e1f71016b02010000d909000014baa9d58bff00' ``` ` Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:137 First occurred: 09:58:41 (20 occurrences) Last logged: 10:03:19 Error doing job: Exception in callback ThreadsafeProxy.__getattr__..func_wrapper..check_result_wrapper() at /usr/local/lib/python3.11/site-packages/bellows/thread.py:110 Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.11/site-packages/bellows/thread.py", line 111, in check_result_wrapper result = call() ^^^^^^ File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 339, in frame_received self._protocol(data) File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 180, in __call__ result, data = self.types.deserialize(data, schema) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/bellows/types/__init__.py", line 9, in deserialize value, data = type_.deserialize(data) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/types/struct.py", line 302, in deserialize value, data = field.type.deserialize(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/types/basic.py", line 851, in deserialize item, data = cls._item_type.deserialize(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/types/basic.py", line 190, in deserialize raise ValueError(f"Data is too short to contain {byte_size} bytes") ValueError: Data is too short to contain 1 bytes ` ` Logger: zigpy.zcl Source: runner.py:179 First occurred: 00:51:21 (119 occurrences) Last logged: 10:03:19 [0x94AC:242:0x0021] Unknown cluster command 0 b'\x88T>\x1fq\x01\xd4\t\x00\x00\x17\x00\xac\x94\xff' [0x94AC:242:0x0021] Unknown cluster command 0 b'\x88T>\x1fq\x01\xd5\t\x00\x00\x13\x00\xac\x94\xff' [0x94AC:242:0x0021] Unknown cluster command 0 b'\x88T>\x1fq\x01\xd7\t\x00\x00h\x00\xac\x94\xff' [0x94AC:242:0x0021] Unknown cluster command 0 b'\x88T>\x1fq\x01\xd8\t\x00\x00\x10\x00\xac\x94\xff' [0x94AC:242:0x0021] Unknown cluster command 0 b'\x88T>\x1fq\x01\xd9\t\x00\x00\x14\x00\xac\x94\xff' `

Custom quirk

Custom quirk ```python [Paste your custom quirk here] ```

Additional information

No response

Hedda commented 1 year ago

@smartmatic which exact EnOcean Zigbee Green Power module is that specific FOH switch from NodOn based on + what is its model and device signature? And how does it show in ZHA UI after added (paired/joined) the device to ZHA in Home Assistant?

@nworbneb Do you have any EnOcean PTM215ZE (PTM 215ZE), PTM215Z (PTM 215Z), or PTM216Z (PTM 216Z) ZGP modules?

PS: For reference, there are more ”Friends of Hue” (FOH) ZGP switches based on those and more mentioned in https://github.com/zigpy/zigpy/issues/341

smartmatic commented 1 year ago

@smartmatic which exact EnOcean Zigbee Green Power module is that specific FOH switch from NodOn based on + what is its model and device signature?

The EnOcean model is a PTM215Z. The device itself is this wall switch: https://nodon.fr/en/nodon/enocean-wall-switch/

Can you how help me how can i determine the exact model and device signature?

Hedda commented 1 year ago

The EnOcean model is a PTM215Z. The device itself is this wall switch: https://nodon.fr/en/nodon/enocean-wall-switch/

Can you how help me how can i determine the exact model and device signature?

If it is NodOn CWS-4-1-01_HUE / CWS-PhU then I believe it would be same as other "Friends of Hue" device based on PTM 215Z?

https://nodon.fr/en/nodon/philips-hue-battery-less-switch/

https://nodon.fr/wp-content/uploads/2019/10/Fiche-technique-EN-CWS-PhH-191030.pdf

That is, that "Friends of Hue" (FOH) device is probably a white-label product made in partnership with Philips/Signify and if so it uses a standard EnOcean PTM 215Z module with a custom switch cover, check out Zigbee2MQTT's EnOcean PTM 215Z comments:

https://www.zigbee2mqtt.io/devices/PTM_215Z.html

"This is a Zigbee Green Power device which allows it to be very energy efficient. Messages from Green Power devices cannot be "understood" by normal Zigbee devices, therefore they need to be "translated" first. Not all Zigbee devices can do this translation, currently the only devices known to do this are Philips Hue devices. This means that the Green Power device has to be in range of a Philips Hue device in order to use it."

"Green Power devices don't support binding and are not included in network scans."

FYI, for reference, the same EnOcean PTM 215Z modules are also used in many other "Friends of Hue" (FOH) series white-label products, such as Niko 91004, NodOn CWS-4-1-01_HUE, Vimar 03906, Sunricher SR-ZGP2801K4-FOH-E, LED-Trading 9125, Feller 4120.2.S.FMI.61 and possibly more models (again more ”Friends of Hue” ZGP switches are mentioned in https://github.com/zigpy/zigpy/issues/341).

@smartmatic if you the device pairs/joins in ZHA then you should be able to collect both details ln device signature as well as debug information from there. (But if the device does not pair/join in ZHA then it will be very different as discussed in the zigpy feature request at https://github.com/zigpy/zigpy/issues/341 among zigpy developers).

As per Home Assistant’s documentation for the ZHA integration:

https://www.home-assistant.io/integrations/zha#how-to-add-support-for-new-and-unsupported-devices

When you open a new issue there is instructions on how to collect debug information, including device signature and diagnostic information.

Expand the collapsed sections under device signature and debug information and paste the details asked for in each:

Debug information

Device signature

You can find the device signature by going to the device page, clicking the three dots, clicking on "Manage Zigbee device", and then selecting the "Signature" tab at the top.

Copy the contents and paste your device signature in between the lines with the backticks below.

<details><summary>Device signature</summary>

```json
[Paste the device signature here]

Diagnostic information

You can find the diagnostic information of the device by going to the device page, clicking the three dots, and then by clicking on "Download diagnostics".

Copy the contents of the downloaded text file and paste it in between the lines with the backticks below.

<details><summary>Diagnostic information</summary>

```json
[Paste the diagnostic information here]

smartmatic commented 1 year ago

The device did not pair successfully. Therefore i can not provide exact model or device signature. I have only the logging information at the moment.

Hedda commented 1 year ago

The device did not pair successfully. Therefore i can not provide exact model or device signature.

Sorry but if the device does not successfully pair then I believe that this still belongs at the zigpy level, i.e. -> https://github.com/zigpy/zigpy/issues/341

Hedda commented 1 year ago

@smartmatic Forgot to ask if you can please also give feedback on which exact Zigbee Coordinator and firmware you tested with.

smartmatic commented 1 year ago

@smartmatic Forgot to ask if you can please also give feedback on which exact Zigbee Coordinator and firmware you tested with.

I am using a Sonoff Dongle Plus E with the latest Firmware 6.10.3 NOT the MultiPAN Firmware.

Yamacore commented 1 year ago

Hello there, i dont know if im right here but i saw the topic including PTM 215ZE module or the newer EnOcean PTM 216Z. i currently try to get this switch to work with my skyconnect but it seems it just works in zigbee2mqtt atm.

thibaultmol commented 10 months ago

It's really annoying that I constantly have to replace the batteries on my buttons but I'm still looking for this issue to be fixed. What exactly is the problem that's holding it back right now? (Genuinely asking)

Hedda commented 10 months ago

I'm still looking for this issue to be fixed. What exactly is the problem that's holding it back right now? (Genuinely asking)

Note that this requires ZGP (Zigbee Green Power) profile support which is a new feature (and not something broken to be fixed).

https://www.home-assistant.io/integrations/zha#limitations

ZHA does currently not support devices that can only use the ZGP (“Zigbee Green Power”) profile which is used in a few batteryless self-powered or energy harvesting devices, (such as for example; Philips Hue Click, Philips Hue Tap, and some “Friends of Hue” partnership switches).

What is actually holding this back is there needs to be a volunteering developer with a personal interest in taking on this project.

Can you confirm that you tried adding/pairing/joining a native ZGP (Zigbee Green Power) device to ZHA and it did not pair/join?

Please post feedback about which exact Zigbee Coordinator and firmware you tested with when trying to pair/join the device.

If symptoms are still that can not even pair/join a device "Friend of Hue" switch based on PTM215ZE/PTM215Z/PTM216Z then I assume the issue is that zigpy and/or its radio libraries does not yet fully support native ZGP (Zigbee Green Power) devices.

FYI, there is an end-user feature request and end-user discussions here, so if you can not contribute then express interest there (voting and posting in the existing Home Assistant community forum thread is the best way to show end-user interest in this):

https://community.home-assistant.io/t/zha-integration-support-for-zgp-zigbee-green-power-devices-via-zigpy/277149/

(Maybe the community could start a crowdfunding collection on Bountysource or a similar for this feature to be of more interest?)

Anyway, the main developers/development discussion about native ZGP (Zigbee Green Power) device support can be found here:

https://github.com/zigpy/zigpy/issues/341

Note! If only want to add a simple "+1" to show interest then suggest consider that you just click the symbolic thumbs-up emoji (but please do not post non-development questions or try to discuss off-topic workarounds in the zigpy request issue about ZGP):

image

PS: I do not own any ZGP (Zigbee Green Power) devices myself, so I can not even test pairing/joining to check debug/diagnostics myself, and regardless of that, I do not have the coding skills to identify the missing pieces and even less so implement the code.

Hedda commented 10 months ago

FYI, developers should know that there is now a pull request for zigpy to add proper ZGP (Zigbee Green Power) support and the developer of that PR is asking for help in reviewing his code patches there:

https://github.com/zigpy/zigpy/pull/1282

Note that it is still only an early draft with initial work so best if end-users do not post there unless already know how contribute with code testing without handholding (e.i. not posting questions there asking how test a fork/patch).

hesspoint commented 6 months ago

Hi

I want to move about 20 FoH (zigbee green power) switches from my Hue hub to ZHA and consolidate my 4 zigbee networks. I now learned that I cannot move the switches which sucks. Any ETA when these will be supported by ZHA?

Thanks

Hedda commented 6 months ago

No ETA as it is for free and open source software developed by volenteers in their spare time, however it sounded really close with PR https://github.com/zigpy/zigpy/pull/1282 but then heard a tree fell on his house so had to prioritize that first simply due to bad luck.

Again, if you are an end user and not a Python developer that can not help review the code yourself then discussion can be found here -> https://community.home-assistant.io/t/zha-integration-support-for-zgp-zigbee-green-power-devices-via-zigpy/277149/

Anyway, you can migrate all your other devices thoygh suggest you keep your ZGP devices on your Philips Hue Brige togther with at least enough always-on mains-powered Zigbee Router devices that can act as Zigbee Green Power Proxy devices as I undrsttabd those ZGP devices withj not work directly and will need to connect via other Zigbee Router device.

github-actions[bot] commented 2 weeks ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.