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
760 stars 698 forks source link

[Legrand wireless switch product id 7 522 85] #2098

Closed Buci007 closed 1 year ago

Buci007 commented 1 year ago

Probleme I used a Legrand 7 522 85 wireless On/Off switch until last week integrated in HA (Home Assistant 2023.1.0) with Sonoff Zigbee 3.0 Dongle Plus-E. The switch fired ZHA event e.g.: device_ieee: 00:04:74:00:00:c1:c3:be, endpoint_id: 1, command: "off" and I was able to use it for automatization. I had to change the battery and reconnect to the system. The switch is reconnected, but fire only "Checking event." Do not fire any events on push of the buttons. I tried to reconnect several time the reason is the same. I have a Legrand gateway as well and paired to this the switch. In the Legrand system the switch worked. I reset and connected again to HA, the result same, no event fired. Link to the switch: https://vikiwat.com/wireless-switch-netatmo-752285-vallena-life-cream-legrand Link to the Legrand developer site https://developer.legrand.com/documentation/compatible-product/ Wireless Switch On / Off, Cloud type: NLTOO, Product type ZLE18 is declared ZigBee 3.0 compatible product.

Describe the solution you'd like I would like to use again the switch

Signatures ```yaml { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=1, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4129, maximum_buffer_size=89, maximum_incoming_transfer_size=63, server_mask=10752, maximum_outgoing_transfer_size=63, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0104", "in_clusters": [ "0x0000", "0x0001", "0x0003", "0x000f", "0x0020", "0xfc01" ], "out_clusters": [ "0x0000", "0x0003", "0x0006", "0x0008", "0x0019", "0xfc01" ] } }, "manufacturer": " Legrand", "model": " Remote switch", "class": "zigpy.device.Device" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2023.1.0", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "x86_64", "timezone": "Europe/Budapest", "os_name": "Linux", "os_version": "4.4.180+", "run_as_root": true }, "custom_components": { "sonoff": { "version": "3.3.1", "requirements": [ "pycryptodome>=3.6.6" ] }, "hacs": { "version": "1.29.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "powercalc": { "version": "v1.2.4", "requirements": [ "numpy>=1.21.1" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.5", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.90", "zigpy-deconz==0.19.2", "zigpy==0.52.3", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.2" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "1A86", "pid": "55D4", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus v2" ] }, { "vid": "10C4", "pid": "EA60", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus" ] }, { "vid": "10C4", "pid": "EA60", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*zigstar*", "known_devices": [ "ZigStar Coordinators" ] }, { "vid": "1CF1", "pid": "0030", "description": "*conbee*", "known_devices": [ "Conbee II" ] }, { "vid": "10C4", "pid": "8A2A", "description": "*zigbee*", "known_devices": [ "Nortek HUSBZB-1" ] }, { "vid": "0403", "pid": "6015", "description": "*zigate*", "known_devices": [ "ZiGate+" ] }, { "vid": "10C4", "pid": "EA60", "description": "*zigate*", "known_devices": [ "ZiGate" ] }, { "vid": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "dependencies": [ "file_upload" ], "after_dependencies": [ "onboarding", "usb", "zeroconf" ], "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 38346, "manufacturer": " Legrand", "model": " Remote switch", "name": " Legrand Remote switch", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4129, "power_source": "Battery or Unknown", "lqi": 200, "rssi": -50, "last_seen": "2023-01-15T09:02:55", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=1, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4129, maximum_buffer_size=89, maximum_incoming_transfer_size=63, server_mask=10752, maximum_outgoing_transfer_size=63, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0104", "in_clusters": [ "0x0000", "0x0001", "0x0003", "0x000f", "0x0020", "0xfc01" ], "out_clusters": [ "0x0000", "0x0003", "0x0006", "0x0008", "0x0019", "0xfc01" ] } } }, "active_coordinator": false, "entities": [ { "entity_id": "binary_sensor.legrand_remote_switch_binaryinput", "name": " Legrand Remote switch" }, { "entity_id": "button.legrand_remote_switch_identify", "name": " Legrand Remote switch" }, { "entity_id": "sensor.legrand_remote_switch_battery", "name": " Legrand Remote switch" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "DIMMER_SWITCH" } ], "user_given_name": null, "device_reg_id": "deacccf32b613bd0872ee84f705d9c79", "area_id": "eloszoba", "cluster_details": { "1": { "device_type": { "name": "DIMMER_SWITCH", "id": 260 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0004": { "attribute_name": "manufacturer", "value": " Legrand" }, "0x0005": { "attribute_name": "model", "value": " Remote switch" } }, "unsupported_attributes": {} }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x000f": { "endpoint_attribute": "binary_input", "attributes": { "0x0055": { "attribute_name": "present_value", "value": 0 } }, "unsupported_attributes": {} }, "0x0020": { "endpoint_attribute": "poll_control", "attributes": { "0x0000": { "attribute_name": "checkin_interval", "value": 13200 } }, "unsupported_attributes": {} }, "0x0001": { "endpoint_attribute": "power", "attributes": { "0x0020": { "attribute_name": "battery_voltage", "value": 28 } }, "unsupported_attributes": { "0x0021": { "attribute_name": "battery_percentage_remaining" }, "0x0033": { "attribute_name": "battery_quantity" }, "0x0031": { "attribute_name": "battery_size" } } }, "0xfc01": { "endpoint_attribute": "manufacturer_specific", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": {}, "unsupported_attributes": {} }, "0x0008": { "endpoint_attribute": "level", "attributes": {}, "unsupported_attributes": {} }, "0x0000": { "endpoint_attribute": "basic", "attributes": {}, "unsupported_attributes": {} }, "0xfc01": { "endpoint_attribute": "manufacturer_specific", "attributes": {}, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} } } } } } } ```
Add device log ``` 0xC91F](S26R2ZB): Device seen - marking the device available and resetting counter [0xC91F](S26R2ZB): Update device availability - device available: True - new availability: True - changed: False [0xFE3D](TS0011): last_seen is 1984002.010282278 seconds ago and ping attempts have been exhausted, marking the device unavailable [0xFE3D](TS0011): Update device availability - device available: False - new availability: False - changed: False [0xF808](01MINIZB): Device seen - marking the device available and resetting counter [0xF808](01MINIZB): Update device availability - device available: True - new availability: True - changed: False Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0x2DC8), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=158, profile_id=260, cluster_id=6, data=Serialized[b'\x08\x01\n\x00\x00(\x00'], tx_options=, radius=0, non_member_radius=0, lqi=132, rssi=-67) [0x2DC8:1:0x0006] Received ZCL frame: b'\x08\x01\n\x00\x00(\x00' [0x2DC8:1:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=1, command_id=10, *direction=, *is_reply=True) [0x2DC8:1:0x0006] Decoded ZCL frame: OnOff:Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=int8s, value=0))]) [0x2DC8:1:0x0006] Received command 0x0A (TSN 1): Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=int8s, value=0))]) [0x2DC8:1:0x0006] Attribute report received: on_off=0 [0x2DC8:1:0x0006] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=1, command_id=, *direction=, *is_reply=True) [0x2DC8:1:0x0006] Sending reply: Default_Response(command_id=10, status=) [0x2DC8](01MINIZB): Device seen - marking the device available and resetting counter [0x2DC8](01MINIZB): Update device availability - device available: True - new availability: True - changed: False [0x59F7](S26R2ZB): Device seen - marking the device available and resetting counter [0x59F7](S26R2ZB): Update device availability - device available: True - new availability: True - changed: False [0xA517](SML003): Device seen - marking the device available and resetting counter [0xA517](SML003): Update device availability - device available: True - new availability: True - changed: False [0xB30B](S26R2ZB): Device seen - marking the device available and resetting counter [0xB30B](S26R2ZB): Update device availability - device available: True - new availability: True - changed: False [0xB593](RDM001): Device seen - marking the device available and resetting counter [0xB593](RDM001): Update device availability - device available: True - new availability: True - changed: False [0xD8BF](TS0601): Device seen - marking the device available and resetting counter [0xD8BF](TS0601): Update device availability - device available: True - new availability: True - changed: False [0x9DE8](MS01): Device seen - marking the device available and resetting counter [0x9DE8](MS01): Update device availability - device available: True - new availability: True - changed: False [0x0FCF](MS01): Device seen - marking the device available and resetting counter [0x0FCF](MS01): Update device availability - device available: True - new availability: True - changed: False Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xBDB0), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=224, profile_id=260, cluster_id=1, data=Serialized[b'\x18\r\n \x00 \x1e'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) [0xBDB0:1:0x0001] Received ZCL frame: b'\x18\r\n \x00 \x1e' [0xBDB0:1:0x0001] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=13, command_id=10, *direction=, *is_reply=True) [0xBDB0:1:0x0001] Decoded ZCL frame: PowerConfigurationCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0020, value=TypeValue(type=uint8_t, value=30))]) [0xBDB0:1:0x0001] Received command 0x0A (TSN 13): Report_Attributes(attribute_reports=[Attribute(attrid=0x0020, value=TypeValue(type=uint8_t, value=30))]) [0xBDB0:1:0x0001] Attribute report received: battery_voltage=30 [0xBDB0:1:0x0001] Voltage [RAW]:30 [Max]:2.8 [Min]:1.5, Battery Percent: 100.0 [0xA63E](TS0011): Device seen - marking the device available and resetting counter [0xA63E](TS0011): Update device availability - device available: True - new availability: True - changed: False Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xE08E), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=66, profile_id=260, cluster_id=6, data=Serialized[b'\x08>\n\x00\x00(\x00'], tx_options=, radius=0, non_member_radius=0, lqi=136, rssi=-66) [0xE08E:1:0x0006] Received ZCL frame: b'\x08>\n\x00\x00(\x00' [0xE08E:1:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=62, command_id=10, *direction=, *is_reply=True) [0xE08E:1:0x0006] Decoded ZCL frame: OnOff:Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=int8s, value=0))]) [0xE08E:1:0x0006] Received command 0x0A (TSN 62): Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=int8s, value=0))]) [0xE08E:1:0x0006] Attribute report received: on_off=0 [0xE08E:1:0x0006] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=62, command_id=, *direction=, *is_reply=True) [0xE08E:1:0x0006] Sending reply: Default_Response(command_id=10, status=) [0xB15F](SML004): Device seen - marking the device available and resetting counter [0xB15F](SML004): Update device availability - device available: True - new availability: True - changed: False [0xEB80](DS01): Device seen - marking the device available and resetting counter [0xEB80](DS01): Update device availability - device available: True - new availability: True - changed: False [0xAAB9](01MINIZB): Device seen - marking the device available and resetting counter [0xAAB9](01MINIZB): Update device availability - device available: True - new availability: True - changed: False Device 0xfefc (00:04:74:00:00:c1:c3:be) joined the network Device 00:04:74:00:00:c1:c3:be changed id (0x9863 => 0xfefc) [0xfefc] Scheduling initialization Tries remaining: 3 [0xfefc] Requesting 'Node Descriptor' Tries remaining: 2 [0xfefc] Extending timeout for 0x46 request Device 0xfefc (00:04:74:00:00:c1:c3:be) joined the network [0xfefc] Scheduling initialization [0xfefc] Canceling old initialize call Tries remaining: 3 [0xfefc] Requesting 'Node Descriptor' Tries remaining: 2 [0xfefc] Extending timeout for 0x48 request Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=64, profile_id=0, cluster_id=2, data=Serialized[b'\x00\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) Received frame on uninitialized device from ep 0 to ep 0, cluster 2: b'\x00\x00\x00' [0xfefc:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000] [0xfefc:zdo] No handler for ZDO request:ZDOCmd.Node_Desc_req([0x0000]) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=65, profile_id=0, cluster_id=32770, data=Serialized[b'F\x00\xfc\xfe\x12@\x80!\x10Y?\x00\x00*?\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=128, rssi=-68) Received frame on uninitialized device from ep 0 to ep 0, cluster 32770: b'F\x00\xfc\xfe\x12@\x80!\x10Y?\x00\x00*?\x00\x00' [0xfefc:zdo] ZDO request ZDOCmd.Node_Desc_rsp: [, 0xFEFC, NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=1, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4129, maximum_buffer_size=89, maximum_incoming_transfer_size=63, server_mask=10752, maximum_outgoing_transfer_size=63, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)] [0xfefc:zdo] No handler for ZDO request:ZDOCmd.Node_Desc_rsp([, 0xFEFC, NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=1, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4129, maximum_buffer_size=89, maximum_incoming_transfer_size=63, server_mask=10752, maximum_outgoing_transfer_size=63, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)]) [0xE08E](01MINIZB): Device seen - marking the device available and resetting counter [0xE08E](01MINIZB): Update device availability - device available: True - new availability: True - changed: False Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=), dst_ep=0, source_route=None, extended_timeout=False, tsn=68, profile_id=0, cluster_id=54, data=Serialized[b'\x01\xb4\x01'], tx_options=, radius=0, non_member_radius=0, lqi=128, rssi=-68) Received frame on uninitialized device from ep 0 to ep 0, cluster 54: b'\x01\xb4\x01' [0xfefc:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [180, ] [0x7044](WB01): Device seen - marking the device available and resetting counter [0x7044](WB01): Update device availability - device available: True - new availability: True - changed: False [0x80A9](MS01): Device seen - marking the device available and resetting counter [0x80A9](MS01): Update device availability - device available: True - new availability: True - changed: False [0xEAAE](MS01): Device seen - marking the device available and resetting counter [0xEAAE](MS01): Update device availability - device available: True - new availability: True - changed: False Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=70, profile_id=260, cluster_id=0, data=Serialized[b'\x14!\x10\x03\x00\x00\xf0'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) Received frame on uninitialized device from ep 1 to ep 1, cluster 0: b'\x14!\x10\x03\x00\x00\xf0' [0xfefc] Received ZCL while uninitialized on endpoint id 1, cluster 0x0000 id, hdr: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=True, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), manufacturer=4129, tsn=3, command_id=0, *direction=, *is_reply=False), payload: b'\x00\xf0' [0xfefc] Uninitialized device command '0' params: Read_Attributes(attribute_ids=[61440]) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=), dst_ep=0, source_route=None, extended_timeout=False, tsn=71, profile_id=0, cluster_id=19, data=Serialized[b'\x02\xfc\xfe\xbe\xc3\xc1\x00\x00t\x04\x00\x80'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) Device 0xfefc (00:04:74:00:00:c1:c3:be) joined the network [0xfefc] Scheduling initialization [0xfefc] Canceling old initialize call Received frame on uninitialized device from ep 0 to ep 0, cluster 19: b'\x02\xfc\xfe\xbe\xc3\xc1\x00\x00t\x04\x00\x80' [0xfefc:zdo] ZDO request ZDOCmd.Device_annce: [0xFEFC, 00:04:74:00:00:c1:c3:be, 128] Tries remaining: 3 [0xfefc] Requesting 'Node Descriptor' Tries remaining: 2 [0xfefc] Extending timeout for 0x4a request Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=72, profile_id=0, cluster_id=32770, data=Serialized[b'J\x00\xfc\xfe\x12@\x80!\x10Y?\x00\x00*?\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) Received frame on uninitialized device from ep 0 to ep 0, cluster 32770: b'J\x00\xfc\xfe\x12@\x80!\x10Y?\x00\x00*?\x00\x00' [0xfefc] Got Node Descriptor: NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=1, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4129, maximum_buffer_size=89, maximum_incoming_transfer_size=63, server_mask=10752, maximum_outgoing_transfer_size=63, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False) [0xfefc] Discovering endpoints Tries remaining: 3 [0xfefc] Extending timeout for 0x4c request Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=73, profile_id=0, cluster_id=32773, data=Serialized[b'L\x00\xfc\xfe\x01\x01'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) Received frame on uninitialized device from ep 0 to ep 0, cluster 32773: b'L\x00\xfc\xfe\x01\x01' [0xfefc] Discovered endpoints: [1] [0xfefc] Initializing endpoints [>] [0xfefc:1] Discovering endpoint information Tries remaining: 3 [0xfefc] Extending timeout for 0x4e request Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=74, profile_id=0, cluster_id=32772, data=Serialized[b'N\x00\xfc\xfe \x01\x04\x01\x04\x01\x01\x06\x00\x00\x03\x00\x0f\x00 \x00\x01\x00\x01\xfc\x06\x03\x00\x06\x00\x08\x00\x00\x00\x01\xfc\x19\x00'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) Received frame on uninitialized device from ep 0 to ep 0, cluster 32772: b'N\x00\xfc\xfe \x01\x04\x01\x04\x01\x01\x06\x00\x00\x03\x00\x0f\x00 \x00\x01\x00\x01\xfc\x06\x03\x00\x06\x00\x08\x00\x00\x00\x01\xfc\x19\x00' [0xfefc:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=260, device_version=1, input_clusters=[0, 3, 15, 32, 1, 64513], output_clusters=[3, 6, 8, 0, 64513, 25]) [0xFEFC:1:0x0000] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=80, command_id=, *direction=, *is_reply=False) [0xFEFC:1:0x0000] Sending request: Read_Attributes(attribute_ids=[4, 5]) [0xfefc] Extending timeout for 0x50 request Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=75, profile_id=260, cluster_id=0, data=Serialized[b'\x18P\x01\x04\x00\x00B\x1f Legrand\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00B\x1f Remote switch\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) [0xFEFC:1:0x0000] Received ZCL frame: b'\x18P\x01\x04\x00\x00B\x1f Legrand\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00B\x1f Remote switch\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' [0xFEFC:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=80, command_id=1, *direction=, *is_reply=True) [0xFEFC:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=, value=TypeValue(type=CharacterString, value=' Legrand')), ReadAttributeRecord(attrid=0x0005, status=, value=TypeValue(type=CharacterString, value=' Remote switch'))]) [0xfefc] Read model ' Remote switch' and manufacturer ' Legrand' from > [0xfefc] Discovered basic device information for Device is initialized Checking quirks for Legrand Remote switch (00:04:74:00:00:c1:c3:be) Considering Fail because endpoint list mismatch: {1, 2, 242} {1} Considering Fail because endpoint list mismatch: {1, 2, 41, 42, 242, 51, 21, 31} {1} Considering Fail because endpoint list mismatch: {232, 230} {1} Considering Fail because endpoint list mismatch: {232, 230} {1} Considering Fail because device_type mismatch on at least one endpoint Considering Fail because device_type mismatch on at least one endpoint Considering Fail because device_type mismatch on at least one endpoint Considering Fail because device_type mismatch on at least one endpoint Considering Fail because endpoint list mismatch: {11, 13} {1} 'binary_sensor' component -> 'BinaryInput' using ['binary_input'] 'button' component -> 'ZHAIdentifyButton' using ['identify'] 'sensor' component -> 'Battery' using ['power'] 'sensor' component -> 'RSSISensor' using ['basic'] 'sensor' component -> 'LQISensor' using ['basic'] device - 0xfefc:00:04:74:00:00:c1:c3:be entering async_device_initialized - is_new_join: True device - 0xfefc:00:04:74:00:00:c1:c3:be has joined the ZHA zigbee network [0xfefc]( Remote switch): started configuration [0xfefc:ZDO]( Remote switch): 'async_configure' stage succeeded [0xfefc:1:0x0001]: Performing cluster binding [0xfefc] Extending timeout for 0x52 request [0xfefc:1:0x0003]: Configuring cluster attribute reporting [0xfefc:1:0x0003]: finished channel configuration [0xfefc:1:0x0000]: Configuring cluster attribute reporting [0xfefc:1:0x0000]: finished channel configuration [0xfefc:1:0x000f]: Performing cluster binding [0xfefc] Extending timeout for 0x54 request [0xfefc:1:0x0020]: Performing cluster binding [0xfefc] Extending timeout for 0x56 request [0xfefc:1:0x0008]: Performing cluster binding [0xfefc] Extending timeout for 0x58 request [0xfefc:1:0x0006]: Performing cluster binding [0xfefc] Extending timeout for 0x5a request [0xfefc:1:0x0019]: finished channel configuration Error handling '_save_attribute' event with (00:04:74:00:00:c1:c3:be, 1, 0, 4, ' Legrand') params: FOREIGN KEY constraint failed Error handling '_save_attribute' event with (00:04:74:00:00:c1:c3:be, 1, 0, 5, ' Remote switch') params: FOREIGN KEY constraint failed Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=76, profile_id=0, cluster_id=32801, data=Serialized[b'R\x00'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) [0xfefc:1:0x0001]: bound 'power' cluster: Status.SUCCESS [0xfefc:1:0x0001]: Configuring cluster attribute reporting [0xFEFC:1:0x0001] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=92, command_id=, *direction=, *is_reply=False) [0xFEFC:1:0x0001] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x0020, datatype=32, min_interval=3600, max_interval=10800, reportable_change=1), AttributeReportingConfig(direction=0, attrid=0x0021, datatype=32, min_interval=3600, max_interval=10800, reportable_change=1)]) [0xfefc] Extending timeout for 0x5c request Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=77, profile_id=0, cluster_id=32801, data=Serialized[b'T\x00'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) [0xfefc:1:0x000f]: bound 'binary_input' cluster: Status.SUCCESS [0xfefc:1:0x000f]: Configuring cluster attribute reporting [0xFEFC:1:0x000f] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=94, command_id=, *direction=, *is_reply=False) [0xFEFC:1:0x000f] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x0055, datatype=16, min_interval=30, max_interval=900, reportable_change=1)]) [0xfefc] Extending timeout for 0x5e request Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xFEFC), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=78, profile_id=260, cluster_id=1, data=Serialized[b'\x18\\\x07\x8c\x00 \x00\x86\x00!\x00'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) [0xFEFC:1:0x0001] Received ZCL frame: b'\x18\\\x07\x8c\x00 \x00\x86\x00!\x00' [0xFEFC:1:0x0001] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=92, command_id=7, *direction=, *is_reply=True) [0xFEFC:1:0x0001] Decoded ZCL frame: PowerConfiguration:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=, direction=, attrid=32), ConfigureReportingResponseRecord(status=, direction=, attrid=33)]) [0xfefc:1:0x0001]: Successfully configured reporting for 'set()' on 'power' cluster [0xfefc:1:0x0001]: Failed to configure reporting for '['battery_voltage', 'battery_percentage_remaining']' on 'power' cluster: [ConfigureReportingResponseRecord(status=, direction=, attrid=32), ConfigureReportingResponseRecord(status=, direction=, attrid=33)] [0xfefc:1:0x0001]: finished channel configuration ```

Additional context Add any other context or screenshots about the feature request here.

MattWestb commented 1 year ago

I dont have experience of Legrand remotes but if its doing checkins its very positive. IKEA remotes is not doing it then being new paired and need being reconfigured from the device card for getting reporting OK to the system. Tyre doing one reconfigure of your remote and waking it up the sending commands to it.

Buci007 commented 1 year ago

Thanky you for your response. With reconfigure and push the on and off button on the switch I got a result failed. Details: cluster and binding all are NOK. Reconfigure again with short push on EZ button. (reset and pairing button) The reconfiguration is failed, but binding and reporting - OK. BinaryInput - OK, PowerConfiguration - OK, PollControl - OK, OnOff - NOK, LevelControl - NOK. Ckecking event fired in every hours. No other event fired if On/Off button is pressed. The switch worked 1-2 months without any problem before the battery changed. The switch use the standard zigpy.device.Device quirk. Is there any change can cause this behaviour?

MattWestb commented 1 year ago

I think (= not knowing) that ZHA is trying binding to much cluster then the device can handling and the reconfigure is failing (if looking in the log om sure you is having binding table full).

I see 2 ways trying fixing it.

  1. Delete the device and waiting one minute and adding it new to HA and look if its being OK configured (without reconfigure at first).
  2. Manual deleting some bindings or all in the device from device card and Manage Zigbee Device (the three . ) right from reconfigure) and try deleting some or all bindings and adding what you is needing (power, OnOff and Level and perhaps pull control).

From your writing we can see that the 3 first is being made OK and the 2 last is not working and we like have its opposite.

I think its one light controller device so likely is using group binding and not device binding but you must testing what is working for knowing. If you is deleting all device and group binding you is not reporting any thing to ZHA (can being that is sending to group 0 as default then its working) and normally group 0 is the standard reporting group and the coordinator is the standard device if using device binding.

Sorry i cant saying exact what shall working or not then i have not experience of the device.

Edit: looks its using group bindings (from one other but not the same device) https://www.zigbee2mqtt.io/devices/067774.html.

javicalle commented 1 year ago

Maybe that quirk can do the job:

Probably the device_automation_triggers needs to be tunned.

javicalle commented 1 year ago

Your device's signature match with the already defuned RemoteDimmer quirk.

To check, remove any previous quirk for your device. Copy the current legrand/dimmer.py file to your local quirk folder:

Go to the RemoteDimmer class and put your device in the MODELS_INFO like this:

class RemoteDimmer(CustomDevice):
    """Remote dimmer ."""

    signature = {
        MODELS_INFO: [
            (f" {LEGRAND}", " Remote dimmer switch"), 
            (f" {LEGRAND}", " Remote switch"), 
        ],

Save changes, delete any __pycache__ folder and restart HA.

EDIT: fix typo

MattWestb commented 1 year ago

Is some one knowing if all devices is in-wall switches / dimmers for light commands ? I asking then normally users like having device automatons for all (in)possible "clicks". If its in-wall and is pure light controllers i think its best not implanting DA for it but some user like getting it for easy making clickomania of them.

Buci007 commented 1 year ago

Hi! I did what you suggested.

class RemoteDimmer(CustomDevice):
    """Remote dimmer ."""

signature = {
    MODELS_INFO: [
        (f" {LEGRAND}", " Remote dimmer switch"),
        (f" {LEGRAND}", " Remote switch")
    ],

I add the missing "," at the end of the first device line, with this update the quirk is loaded without crashing. home-assistant_2023-01-16T13-06-30.798Z.log

The device signature lists that the quirk is used. Signature.txt

The switch is as a binary input sensor detected, as before and only fires "Legrand Remote switch Checkin event was fired" No any response on push Off or On buttons. Thanks!

Buci007 commented 1 year ago

Maybe I was not clear, the switch doesn't work, only fire "Checking event" :-( Do you have any other suggestion?

MattWestb commented 1 year ago

Fixing the quirk can helping with some functions but first you need getting the binding / reporting working so you is getting events in ZHA. As it was working before changing the battery i think its not one problem with the device firmware and also ZHA is doing the things right but its have limited binding table and need being deleted and added new for getting it reporting OK.

Buci007 commented 1 year ago

I add the device diagnostic, maybe it can help Legrand Remote switch diagnostic.txt

Buci007 commented 1 year ago

Thank you! You are right, but what can I do others? I binded it several times. I deleted the device and added again with "Add device". I made factory reset of the switch and tried everything was possible on my known based on the Legrand developer site. I did Reconfiguration as well. Binding and Reporting in the head I got OK. In the table LegrandPowerConfiguration, BinaryInput, PollControll i got OK. On/Off and LevelControl - NOK binding. In the Zigbee device handling I cannot bind manually. There are listed the devices can bind, but nothing happen if I try to bind. I really appreciate if you can advice me, what can I do.

MattWestb commented 1 year ago

Delete the device in ZHA and wait one minute (the database need committing the deletion) and then adding it in ZHA and only giving one name and aria and test if its sending events from OnOff cluster.

Buci007 commented 1 year ago

I deleted the device and waited 2 minutes. Then I restarted the system and device with name "Legrand Remote switch" is back with their Entities. After deleting it with reload the configuration of the SONOFF Zigbee 3.0 USB Dongle the switch was back again. I must deleted it 5 times with restart the system as well to avoide, that the switch come back. Currently I have 28 devices and 142 entities listed in the coordinator excluded this Legrand Switch.

After the switch is deleted, I tried to add with the standard and with the custom quirks as well. I tried to reconfigurate as well. PollControl sometimes binded, sometimes not. The On/Off and LevelControll clusters never binded. As you wrote there are the 2 cluster binding missing. Legrand Remote switch Diagnostic with the custom quirk.txt I got Checking Events and Battery info. Is there any solution to force these bindings?

javicalle commented 1 year ago

This is a battery device. Have you tried to keep it awake during all the pairing process? Just push the button every second or so to prevent it from getting sleep until the pairing process ends.

Buci007 commented 1 year ago

I tried several type before, but I wanted to answer you after I made the test again. I found the info in HA community pages, that the device(s) come back automatically if they are not factory reset. I deleted the switch and did a factory reset with 20 second push on the EZ button. Waited 5 minutes. I started the Add device process. Pushed 1 second the EZ (pairing) button on the switch. Green light started blinking about 10-15 second. I pushed per second the Off button until the process stopped, about 30-40 second. On/Off cluster binded, the switch fire On / Off event :-) I guess the battery clusters didn't binded, no battery info :-( But I'm happy that it works again :-) Where can I see the the bindings if I missed to save the Binding login? I download the diagnostic data of the device and compared the working and not working variant. They are the same there and there isn't any infromation about bindings.. Thanks for you both!!!!

MattWestb commented 1 year ago

That is one personality of the device i have not seen before !!! Great that you is have getting it working ! You can trying adding binding of power configure cluster and deleting some other if its not working. And now you is knowing how getting it back if it stop working :-))

If you like making more advanced binding work you can using https://github.com/mdeweerd/zha-toolkit it working very well but is little more technical but it can reading all bindings in normal devices.

javicalle commented 1 year ago

Glad to know you get it working again! Just to be sure, because you said that device was already working before the battery change (I didn't read this part 😓): Is the quirk needed for this device?

It doesn't cost anything to include the new device in the quirk, but I'd like to be sure.

Buci007 commented 1 year ago

No, I didn't use the custom quirk. I was able to bind with the standard. "zigpy.device.Device"

WLR13 commented 1 year ago

Hi all, I'm unfortunately having issues with battery powered switches from Legrand (067723) as well. The buttons (on/off) events only show up in HA assistant sometimes, but not always. When it works and I continue to press another button within <1 sec, the button presses are usually recognized within HA. However if I wait a little longer, nothing happens. Only after a couple of more clicks / seconds, HA starts recognizing the events again.

Does this issue sound familiar to anyone?

I've 3 Legrand battery switches of which 2 show an "N" at the end of their product number (067723N - google is not showing anything this). Only the switch without the N is working as expected...

Did anyone have similar issues / tips how this could be solved?

Thanks!

EzEsAz commented 1 year ago

Hi WLR13, Check the firmware of the switches. Check the distance between switch and coordinator (big distance without router supported can cause this probleme) Check Legrand developer forum https://developer.legrand.com/forums/ 067723 is a Céliane wireless switch. There are 2 verions 067723A and 067723L

WLR13 commented 1 year ago

Hi EzEsAz,

Thanks, I'll do that. Just an update on the behavior. I was wrong when I said that the switch does not work sometimes. It just takes 5-10 seconds for the lights to come on... Sometimes it works instantly (as expected).

Will update here if I find out anything at Legrand forum.

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