zigpy / zigpy-znp

TI CC2531, CC13x2, CC26x2 radio support for Zigpy and ZHA
GNU General Public License v3.0
144 stars 40 forks source link

MotionSensor detected but stuck at configuration within HomeAssistant (ZHA) #241

Open jacky-coke opened 4 months ago

jacky-coke commented 4 months ago

Hi folks,

I'm having some issues pairing LEDVANCE MotionSensor+ devices using Home Assistant Zigbee integration.

It starts fine with detecting the device but during "configuration" there is no progress. From the logs I see the following:

New device 0xdec0 (00:0d:6f:00:0b:b2:f5:9d) joined the network [0xdec0] Scheduling initialization Received frame on uninitialized device <Device model=None manuf=None nwk=0xDEC0 ieee=00:0d:6f:00:0b:b2:f5:9d is_initialized=False> from ep 0 to ep 0, cluster 19: Serialized[b'\x81\xc0\xde\x9d\xf5\xb2\x0b\x00o\r\x00\x80'] [0xdec0:zdo] ZDO request ZDOCmd.Device_annce: [0xDEC0, 00:0d:6f:00:0b:b2:f5:9d, 128] Tries remaining: 5 [0xdec0] Requesting 'Node Descriptor' [0xdec0] Extending timeout for 0x01 request Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 2, 18, 11, 39, 54, 137912, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDEC0), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=1, profile_id=0, cluster_id=32770, data=Serialized[b'\x01\x00\xc0\xde\x02@\x80N\x10RR\x00\x00\x00R\x00\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) Received frame on uninitialized device <Device model=None manuf=None nwk=0xDEC0 ieee=00:0d:6f:00:0b:b2:f5:9d is_initialized=False> from ep 0 to ep 0, cluster 32770: Serialized[b'\x01\x00\xc0\xde\x02@\x80N\x10RR\x00\x00\x00R\x00\x00'] [0xdec0] Got Node Descriptor: NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4174, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=0, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *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) [0xdec0] Discovering endpoints [0xdec0] Extending timeout for 0x02 request Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 2, 18, 11, 39, 55, 128888, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDEC0), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=2, profile_id=0, cluster_id=32773, data=Serialized[b'\x02\x00\xc0\xde\x02\x01\x02'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) Received frame on uninitialized device <Device model=None manuf=None nwk=0xDEC0 ieee=00:0d:6f:00:0b:b2:f5:9d is_initialized=False> from ep 0 to ep 0, cluster 32773: Serialized[b'\x02\x00\xc0\xde\x02\x01\x02'] [0xdec0] Discovered endpoints: [1, 2] [0xdec0] Initializing endpoints [<Endpoint id=1 in=[] out=[] status=<Status.NEW: 0>>, <Endpoint id=2 in=[] out=[] status=<Status.NEW: 0>>] [0xdec0:1] Discovering endpoint information [0xdec0] Extending timeout for 0x03 request Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 2, 18, 11, 39, 57, 150557, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDEC0), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=3, profile_id=0, cluster_id=32772, data=Serialized[b'\x03\x00\xc0\xde\x18\x01\x04\x01\x02\x04\x00\x07\x00\x00\x01\x00\x03\x00 \x00\x02\x04\x00\x05\x05\x0b\x01\x19\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) Received frame on uninitialized device <Device model=None manuf=None nwk=0xDEC0 ieee=00:0d:6f:00:0b:b2:f5:9d is_initialized=False> from ep 0 to ep 0, cluster 32772: Serialized[b'\x03\x00\xc0\xde\x18\x01\x04\x01\x02\x04\x00\x07\x00\x00\x01\x00\x03\x00 \x00\x02\x04\x00\x05\x05\x0b\x01\x19\x00'] [0xdec0:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=1026, device_version=0, input_clusters=[0, 1, 3, 32, 1026, 1280, 2821], output_clusters=[25]) [0xdec0:2] Discovering endpoint information [0xdec0] Extending timeout for 0x04 request Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 2, 18, 11, 39, 58, 147036, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDEC0), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=4, profile_id=0, cluster_id=32772, data=Serialized[b'\x04\x00\xc0\xde\x14\x02\x04\x01\x07\x01\x00\x05\x00\x00\x01\x00\x03\x00\x06\x04\x05\x0b\x01\x03\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) Received frame on uninitialized device <Device model=None manuf=None nwk=0xDEC0 ieee=00:0d:6f:00:0b:b2:f5:9d is_initialized=False> from ep 0 to ep 0, cluster 32772: Serialized[b'\x04\x00\xc0\xde\x14\x02\x04\x01\x07\x01\x00\x05\x00\x00\x01\x00\x03\x00\x06\x04\x05\x0b\x01\x03\x00'] [0xdec0:2] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=2, profile=260, device_type=263, device_version=0, input_clusters=[0, 1, 3, 1030, 2821], output_clusters=[3]) [0xDEC0:1:0x0000] Sending request header: ZCLHeader(frame_control=FrameControl<0x00>(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Client_to_Server: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=5, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Client_to_Server: 0>) [0xDEC0:1:0x0000] Sending request: Read_Attributes(attribute_ids=[4, 5]) [0xdec0] Extending timeout for 0x05 request Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 2, 18, 11, 39, 59, 156960, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xDEC0), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=0, data=Serialized[b'\x08\x05\x01\x04\x00\x00B\nCentraLite\x05\x00\x00B\x0fMotion Sensor-A'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=171, rssi=None) [0xDEC0:1:0x0000] Received ZCL frame: b'\x08\x05\x01\x04\x00\x00B\nCentraLite\x05\x00\x00B\x0fMotion Sensor-A' [0xDEC0:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x08>(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Server_to_Client: 1>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=5, command_id=1, *direction=<Direction.Server_to_Client: 1>) [0xDEC0:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='CentraLite')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='Motion Sensor-A'))]) [0xdec0] Read model 'Motion Sensor-A' and manufacturer 'CentraLite' from <Endpoint id=1 in=[basic:0x0000, power:0x0001, identify:0x0003, poll_control:0x0020, temperature:0x0402, ias_zone:0x0500, diagnostic:0x0B05] out=[ota:0x0019] status=<Status.ZDO_INIT: 1>> [0xdec0] Discovered basic device information for <Device model='Motion Sensor-A' manuf='CentraLite' nwk=0xDEC0 ieee=00:0d:6f:00:0b:b2:f5:9d is_initialized=True> Device is initialized <Device model='Motion Sensor-A' manuf='CentraLite' nwk=0xDEC0 ieee=00:0d:6f:00:0b:b2:f5:9d is_initialized=True> Checking quirks for CentraLite Motion Sensor-A (00:0d:6f:00:0b:b2:f5:9d) Considering <class 'zhaquirks.centralite.cl_3305S.CentraLite3305S'> Found custom device replacement for 00:0d:6f:00:0b:b2:f5:9d: <class 'zhaquirks.centralite.cl_3305S.CentraLite3305S'> Creating cluster handler for cluster id: 0 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.BasicClusterHandler'> Creating cluster handler for cluster id: 1 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.PowerConfigurationClusterHandler'> Creating cluster handler for cluster id: 3 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.IdentifyClusterHandler'> Creating cluster handler for cluster id: 32 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.PollControlClusterHandler'> Creating cluster handler for cluster id: 1026 class: <class 'homeassistant.components.zha.core.cluster_handlers.measurement.TemperatureMeasurementClusterHandler'> Creating cluster handler for cluster id: 1280 class: <class 'homeassistant.components.zha.core.cluster_handlers.security.IASZoneClusterHandler'> Creating cluster handler for cluster id: 2821 class: <class 'homeassistant.components.zha.core.cluster_handlers.homeautomation.DiagnosticClusterHandler'> Discovering entities for endpoint: 00:0d:6f:00:0b:b2:f5:9d-1 'binary_sensor' component -> 'IASZone' using ['ias_zone'] 'button' component -> 'ZHAIdentifyButton' using ['identify'] 'sensor' component -> 'Battery' using ['power'] 'sensor' component -> 'Temperature' using ['temperature'] 'sensor' component -> 'RSSISensor' using ['basic'] 'sensor' component -> 'LQISensor' using ['basic'] 'update' component -> 'ZHAFirmwareUpdateEntity' using ['ota'] Creating cluster handler for cluster id: 0 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.BasicClusterHandler'> Creating cluster handler for cluster id: 3 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.IdentifyClusterHandler'> Creating cluster handler for cluster id: 1030 class: <class 'homeassistant.components.zha.core.cluster_handlers.measurement.OccupancySensingClusterHandler'> Creating cluster handler for cluster id: 2821 class: <class 'homeassistant.components.zha.core.cluster_handlers.homeautomation.DiagnosticClusterHandler'> Discovering entities for endpoint: 00:0d:6f:00:0b:b2:f5:9d-2 'binary_sensor' component -> 'Occupancy' using ['occupancy'] 'button' component -> 'ZHAIdentifyButton' using ['identify'] 'sensor' component -> 'RSSISensor' using ['basic'] 'sensor' component -> 'LQISensor' using ['basic'] [0xDEC0](Motion Sensor-A): starting availability checks - interval: 80 device - 0xDEC0:00:0d:6f:00:0b:b2:f5:9d entering async_device_initialized - is_new_join: True device - 0xDEC0:00:0d:6f:00:0b:b2:f5:9d has joined the ZHA zigbee network [0xDEC0](Motion Sensor-A): started configuration [0xDEC0:ZDO](Motion Sensor-A): 'async_configure' stage succeeded Error handling '_save_attribute' event with (00:0d:6f:00:0b:b2:f5:9d, 1, 0, 4, 'CentraLite', datetime.datetime(2024, 2, 18, 11, 39, 59, 165170, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint failed [0xDEC0:1:0x0500] Sending request header: ZCLHeader(frame_control=FrameControl<0x00>(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Client_to_Server: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=1, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Client_to_Server: 0>) [0xDEC0:1:0x0500] Sending request: Read_Attributes(attribute_ids=[1]) [0xdec0] Extending timeout for 0x01 request [0xDEC0:1:0x0402]: Performing cluster binding [0xdec0] Extending timeout for 0x02 request [0xDEC0:1:0x0001]: Performing cluster binding [0xdec0] Extending timeout for 0x03 request [0xDEC0:1:0x0003]: Configuring cluster attribute reporting [0xDEC0:1:0x0003]: finished cluster handler configuration [0xDEC0:1:0x0000]: Configuring cluster attribute reporting [0xDEC0:1:0x0000]: finished cluster handler configuration [0xDEC0:1:0x0020]: Performing cluster binding [0xdec0] Extending timeout for 0x04 request [0xDEC0:1:0x0019]: finished cluster handler configuration [0xDEC0:1:0x0019]: finished cluster handler configuration [0xDEC0:2:0x0406]: Performing cluster binding [0xdec0] Extending timeout for 0x05 request [0xDEC0:2:0x0000]: Configuring cluster attribute reporting [0xDEC0:2:0x0000]: finished cluster handler configuration [0xDEC0:2:0x0003]: Configuring cluster attribute reporting [0xDEC0:2:0x0003]: finished cluster handler configuration Error handling '_save_attribute' event with (00:0d:6f:00:0b:b2:f5:9d, 1, 0, 5, 'Motion Sensor-A', datetime.datetime(2024, 2, 18, 11, 39, 59, 165356, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint failed

Any idea where to start research?

Best regards, Nik

Hedda commented 4 months ago

I'm having some issues pairing LEDVANCE MotionSensor+ devices using Home Assistant Zigbee integration.

Might be ok to keep it here (however I think it might not get as much attention from more people here so expect responses to be slower if ask for help), but FYI, issues with the ZHA integration in Home Assistant should instead primarily be reported to as issues to the Home Assistant core repository -> https://github.com/home-assistant/core/issues

Perhaps the ZHA integration documentation is too much of a maze today and needs to better clarify where to report issues?

You see the ZHA integration documentation says this today -> https://www.home-assistant.io/integrations/zha#reporting-issues

so that in essence refer to -> https://www.home-assistant.io/help/reporting_issues/

and that links to -> https://www.home-assistant.io/help/#bugs-feature-requests-and-alike

which in turn points to the issue tracker for the Home Assistant core repository -> https://github.com/home-assistant/core/issues

Note! If ZHA have problems pairing/joining devices then first really needs to have followed tips in these troubleshooting sections:

https://www.home-assistant.io/integrations/zha#zigbee-interference-avoidance-and-network-rangecoverage-optimization

https://www.home-assistant.io/integrations/zha#best-practices-to-avoid-pairingconnection-difficulties

PS: Most problems with pairing devices are due to either radio noise and EMF interference or not enough Zigbee Router devices.

https://www.home-assistant.io/integrations/zha#defining-zigbee-channel-to-use

https://www.home-assistant.io/integrations/zha#using-router-devices-to-add-more-devices