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
751 stars 688 forks source link

[IMPROVEMENT] convert Legrand 064882 cable outlet to climate entity instead of switch #3030

Closed luke7101 closed 1 month ago

luke7101 commented 8 months ago

Problem description

Following https://github.com/zigpy/zha-device-handlers/pull/2807 I added the device, but it's discovered as a switch entity instead of a climate entity, despite its purpose. I think as it's designed to drive a electric heater with (or without) pilot wire it should be detected as a climate entity.

Solution description

The device can be in a standard (on/off) mode or a pilot wire mode (6 orders). Standard is set by default or by writing 10 in LegrandCluster 0XFC01 device_mode 0X0000 Pilot wire mode is set by by writing 20 in LegrandCluster 0XFC01 device_mode 0X0000

The climate entity could have hvac_modes set to off, on or pilot wire. Off and on should control the on/off switch in the standard mode Pilot wire should set the device to the pilot wire mode. Example: Screenshot 2024-03-10 150621

Then preset_modes would be selectable between the 6 available pilot wire orders in LegrandCableOutletCluster 0XFC40 device_mode 0X0000 by sending the following commands: COMFORT = 0x00 COMFORT_MINUS_1 = 0x01 COMFORT_MINUS_2 = 0x02 ECO = 0x03 FROST_PROTECTION = 0x04 OFF = 0x05 Example: Screenshot 2024-03-10 150605

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 ```python [Paste the logs here] ```

Custom quirk

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

Additional information

No response

bemble commented 8 months ago

What I did was the first step to getting it working for the winter, there's room for improvement for sure, and this will come in a quite close future.

luke7101 commented 8 months ago

And it works! Thanks very much 😊

Looking forward for it !

bemble commented 8 months ago

And it works! Thanks very much 😊

Looking forward for it !

Take a look at #3031 ;)

luke7101 commented 8 months ago

Take a look at #3031 ;)

Perfect timing ! 😁

bemble commented 8 months ago

Perfect timing ! 😁

Not a coincidence 😉

github-actions[bot] commented 1 month 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.