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
712 stars 660 forks source link

[Device Support Request] - ZHA - Legrand / Bticino K4003C switch doesn't support status light #2971

Open m4r1k opened 6 months ago

m4r1k commented 6 months ago

Problem description

The problem

The K4003C BTicino switch in ZHA doesn't support three key features:

Those are fully supported by zigbee2mqtt https://www.zigbee2mqtt.io/devices/K4003C_L4003C_N4003C_NT4003C.html

Today I've confirmed that the status light of the switch cannot be configured with the ZHA integration

This issue was originally reported by @PoVPoV29 but nobody picked it up. https://github.com/home-assistant/core/issues/80720

This issue was also reported on HA GitHub https://github.com/home-assistant/core/issues/110009

2024-02-08 13:52:26.312 DEBUG (MainThread) [homeassistant.components.zha.websocket_api] Get bindable devices: source_ieee: [00:04:74:00:00:ca:5c:a9], bindable devices: [[{'ieee': '00:12:4b:00:2a:2e:53:b5', 'nwk': 0x0000, 'manufacturer': 'Texas Instruments', 'model': 'Coordinator', 'name': 'Texas Instruments Coordinator', 'quirk_applied': False, 'quirk_class': 'zigpy_znp.zigbee.device.ZNPCoordinator', 'quirk_id': None, 'manufacturer_code': 0, 'power_source': 'Mains', 'lqi': None, 'rssi': None, 'last_seen': '2024-02-08T13:52:17', 'available': True, 'device_type': 'Coordinator', 'signature': {'node_descriptor': 'NodeDescriptor(logical_type=<LogicalType.Coordinator: 0>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AlternatePanCoordinator|FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 143>, manufacturer_code=0, maximum_buffer_size=80, maximum_incoming_transfer_size=160, server_mask=11265, maximum_outgoing_transfer_size=160, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=True, *is_coordinator=True, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)', 'endpoints': {2: {'profile_id': '0xc05e', 'device_type': '0x0820', 'input_clusters': ['0x0000'], 'output_clusters': []}, 1: {'profile_id': '0x0104', 'device_type': '0x0400', 'input_clusters': ['0x0000', '0x0006', '0x000a', '0x0019', '0x0501'], 'output_clusters': ['0x0001', '0x0020', '0x0500', '0x0502']}}, 'manufacturer': 'Texas Instruments', 'model': 'Coordinator'}, 'active_coordinator': True, 'entities': [], 'neighbors': [], 'routes': [], 'endpoint_names': [{'name': 'CONTROLLER'}, {'name': 'IAS_CONTROL'}], 'user_given_name': None, 'device_reg_id': 'c8c612b28d44aa7ca98ce41965d9b633', 'area_id': None}, {'ieee': '00:04:74:00:00:ca:5c:a9', 'nwk': 0xF202, 'manufacturer': ' Legrand', 'model': ' Light switch with neutral', 'name': ' Legrand  Light switch with neutral', 'quirk_applied': False, 'quirk_class': 'zigpy.device.Device', 'quirk_id': None, 'manufacturer_code': 4129, 'power_source': 'Mains', 'lqi': 72, 'rssi': None, 'last_seen': '2024-02-08T13:47:47', 'available': True, 'device_type': 'Router', 'signature': {'node_descriptor': 'NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=1, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4129, maximum_buffer_size=89, maximum_incoming_transfer_size=63, server_mask=10752, maximum_outgoing_transfer_size=63, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)', 'endpoints': {1: {'profile_id': '0x0104', 'device_type': '0x0100', 'input_clusters': ['0x0000', '0x0003', '0x0004', '0x0005', '0x0006', '0x000f', '0xfc01'], 'output_clusters': ['0x0000', '0x0005', '0x0006', '0x0019', '0xfc01']}, 242: {'profile_id': '0xa1e0', 'device_type': '0x0066', 'input_clusters': ['0x0021'], 'output_clusters': ['0x0021']}}, 'manufacturer': ' Legrand', 'model': ' Light switch with neutral'}, 'active_coordinator': False, 'entities': [{'entity_id': 'binary_sensor.legrand_4_lights_binary_input', 'name': ' Legrand  Light switch with neutral'}, {'entity_id': 'button.legrand_4_lights_identify', 'name': ' Legrand  Light switch with neutral'}, {'entity_id': 'light.legrand_4_lights_light', 'name': ' Legrand  Light switch with neutral'}, {'entity_id': 'binary_sensor.legrand_4_lights_opening', 'name': ' Legrand  Light switch with neutral'}, {'entity_id': 'select.legrand_4_lights_start_up_behavior', 'name': ' Legrand  Light switch with neutral'}], 'neighbors': [], 'routes': [], 'endpoint_names': [{'name': 'ON_OFF_LIGHT'}, {'name': 'COMBO_BASIC'}], 'user_given_name': 'Legrand - 4 Lights', 'device_reg_id': '4c6bbfbabca684c73bfe37ac8b568a62', 'area_id': 'kitchen'}]]

What version of Home Assistant Core has the issue?

core-2024.1.6

Home Assistant Container

Integration causing the issue

Zigbee Home Assistant (ZHA)

Link to integration documentation on our website

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

Solution description

Support for the following 3 properties:

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

philippk75 commented 5 months ago

no updates?

monofasesrl commented 4 months ago

any news?

sharwell commented 3 months ago

It seems like zigpy defines the two required attributes here: https://github.com/zigpy/zha-device-handlers/blob/bfbfb4876d1811440b4a05cac9e3b83311d194a8/zhaquirks/legrand/__init__.py#L20-L21

However, I'm seeing ManufacturerSpecificCluster in Home Assistant instead of Legrand Cluster, so these attributes are not exposed in the UI.

I was able to manually enable this feature using the ZHA Toolkit: Write Attribute service with the following properties:

led_dark (show blue indicator when light is off)

led_on (show blue indicator when light is on)


As a side note, I'm not sure exactly what the value of dimmer is supposed to indicate. I read the value from two devices locally and they returned the following:

WNAL10W1: 0x00, 0x01 WNAL50W1: 0x01, 0x01

m4r1k commented 2 weeks ago

ZHA is still not able to fully handle Legrand / Bticino devices. This issue cannot be closed yet.