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
758 stars 695 forks source link

[BUG] HESZB-120 #3022

Closed Isengo1989 closed 2 months ago

Isengo1989 commented 8 months ago

Bug description

The reconfiguration of the device has failed. Further information may be available in the logs.

Does not expose temperature etc.

Steps to reproduce

  1. Start pairing
  2. Check data in Home Assistant
  3. No data available

Expected behavior

  1. Start pairing
  2. Check data in Home Assistant
  3. See temperature etc.

Screenshots/Video

2024-03-05_09-05

Device signature

Device signature ```json { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2024.2.5", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.12.1", "docker": true, "arch": "x86_64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "6.6.16-haos", "supervisor": "2024.02.1", "host_os": "Home Assistant OS 12.0", "docker_version": "24.0.7", "chassis": "vm", "run_as_root": true }, "custom_components": { "hacs": { "version": "1.34.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "after_dependencies": [ "onboarding", "usb" ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly", "@TheJulianJES" ], "config_flow": true, "dependencies": [ "file_upload" ], "documentation": "https://www.home-assistant.io/integrations/zha", "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp", "universal_silabs_flasher" ], "requirements": [ "bellows==0.38.0", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.111", "zigpy-deconz==0.23.0", "zigpy==0.62.3", "zigpy-xbee==0.20.1", "zigpy-zigate==0.12.0", "zigpy-znp==0.12.1", "universal-silabs-flasher==0.0.18", "pyserial-asyncio-fast==0.11" ], "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": "0403", "pid": "6015", "description": "*conbee*", "known_devices": [ "Conbee III" ] }, { "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" ] } ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_uzg-01._tcp.local.", "name": "uzg-01*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 55136, "manufacturer": "frient A/S", "model": "HESZB-120", "name": "frient A/S HESZB-120", "quirk_applied": true, "quirk_class": "zhaquirks.develco.heat_alarm.HESZB120F", "quirk_id": null, "manufacturer_code": 4117, "power_source": "Battery or Unknown", "lqi": 112, "rssi": -72, "last_seen": "2024-03-05T09:24:43", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4117, maximum_buffer_size=80, maximum_incoming_transfer_size=80, server_mask=0, maximum_outgoing_transfer_size=80, descriptor_capability_field=, *allocate_address=False, *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": "0xc0c9", "device_type": "0x0001", "input_clusters": [ "0x0003", "0x0005", "0x0006" ], "output_clusters": [] }, "35": { "profile_id": "0x0104", "device_type": "0x0402", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x000f", "0x0020", "0x0500", "0x0502" ], "output_clusters": [ "0x000a", "0x0019" ] }, "38": { "profile_id": "0x0104", "device_type": "0x0302", "input_clusters": [ "0x0000", "0x0003", "0x0402" ], "output_clusters": [ "0x0003" ] } }, "manufacturer": "frient A/S", "model": "HESZB-120" }, "active_coordinator": false, "entities": [], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "unknown 1 device_type of 0xc0c9 profile id" }, { "name": "IAS_ZONE" }, { "name": "TEMPERATURE_SENSOR" } ], "user_given_name": null, "device_reg_id": "cb675be3b27e95676231d5d4f0495b53", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "unknown", "id": 1 }, "profile_id": 49353, "in_clusters": { "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": {}, "unsupported_attributes": { "0x0000": { "attribute_name": "on_off" } } } }, "out_clusters": {} }, "35": { "device_type": { "name": "IAS_ZONE", "id": 1026 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": {}, "unsupported_attributes": {} }, "0x0001": { "endpoint_attribute": "power", "attributes": { "0x003e": { "attribute_name": "battery_alarm_state", "value": 0 }, "0x0021": { "attribute_name": "battery_percentage_remaining", "value": 200 }, "0x0020": { "attribute_name": "battery_voltage", "value": 31 } }, "unsupported_attributes": { "0x0021": { "attribute_name": "battery_percentage_remaining" } } }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x000f": { "endpoint_attribute": "binary_input", "attributes": { "0x0055": { "attribute_name": "present_value", "value": 0 }, "0x006f": { "attribute_name": "status_flags", "value": 0 } }, "unsupported_attributes": {} }, "0x0020": { "endpoint_attribute": "poll_control", "attributes": { "0x0000": { "attribute_name": "checkin_interval", "value": 13200 } }, "unsupported_attributes": {} }, "0x0500": { "endpoint_attribute": "ias_zone", "attributes": { "0x0010": { "attribute_name": "cie_addr", "value": [ 73, 150, 39, 254, 255, 110, 2, 188 ] }, "0x0002": { "attribute_name": "zone_status", "value": 48 }, "0x0001": { "attribute_name": "zone_type", "value": 40 } }, "unsupported_attributes": {} }, "0x0502": { "endpoint_attribute": "ias_wd", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} } } }, "38": { "device_type": { "name": "TEMPERATURE_SENSOR", "id": 770 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": {}, "unsupported_attributes": {} }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0402": { "endpoint_attribute": "temperature", "attributes": { "0x0000": { "attribute_name": "measured_value", "value": 1975 } }, "unsupported_attributes": {} } }, "out_clusters": { "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} } } } } } } ```

Diagnostic information

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

Logs

Logs ```python Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 3, 5, 8, 30, 53, 828944, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x1F23), src_ep=35, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=35, source_route=None, extended_timeout=False, tsn=12, profile_id=260, cluster_id=0, data=Serialized[b'\x18\x08\x01\x04\x00\x00B\nfrient A/S\x05\x00\x00B\tHESZB-120'], tx_options=, radius=0, non_member_radius=0, lqi=128, rssi=-68) [0x1F23:35:0x0000] Received ZCL frame: b'\x18\x08\x01\x04\x00\x00B\nfrient A/S\x05\x00\x00B\tHESZB-120' [0x1F23:35:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x18>(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=8, command_id=1, *direction=) [0x1F23:35:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=, value=TypeValue(type=CharacterString, value='frient A/S')), ReadAttributeRecord(attrid=0x0005, status=, value=TypeValue(type=CharacterString, value='HESZB-120'))]) [0x1f23] Read model 'HESZB-120' and manufacturer 'frient A/S' from > [0x1f23] Discovered basic device information for Device is initialized Checking quirks for frient A/S HESZB-120 (00:15:bc:00:34:00:17:6b) Considering Found custom device replacement for 00:15:bc:00:34:00:17:6b: Creating cluster handler for cluster id: 3 class: Creating cluster handler for cluster id: 5 class: Creating cluster handler for cluster id: 6 class: Discovering entities for endpoint: 00:15:bc:00:34:00:17:6b-1 'button' component -> 'ZHAIdentifyButton' using ['identify'] 'select' component -> 'ZHAStartupOnOffSelectEntity' using ['on_off'] Creating cluster handler for cluster id: 0 class: Creating cluster handler for cluster id: 1 class: Creating cluster handler for cluster id: 3 class: Creating cluster handler for cluster id: 15 class: Creating cluster handler for cluster id: 32 class: Creating cluster handler for cluster id: 1280 class: Creating cluster handler for cluster id: 1282 class: Discovering entities for endpoint: 00:15:bc:00:34:00:17:6b-35 'binary_sensor' component -> 'BinaryInput' using ['binary_input'] 'binary_sensor' component -> 'IASZone' using ['ias_zone'] 'button' component -> 'ZHAIdentifyButton' using ['identify'] 'sensor' component -> 'Battery' using ['power'] 'sensor' component -> 'RSSISensor' using ['basic'] 'sensor' component -> 'LQISensor' using ['basic'] 'siren' component -> 'ZHASiren' using ['ias_wd'] 'select' component -> 'ZHADefaultToneSelectEntity' using ['ias_wd'] 'select' component -> 'ZHADefaultSirenLevelSelectEntity' using ['ias_wd'] 'select' component -> 'ZHADefaultStrobeLevelSelectEntity' using ['ias_wd'] 'select' component -> 'ZHADefaultStrobeSelectEntity' using ['ias_wd'] 'update' component -> 'ZHAFirmwareUpdateEntity' using ['ota'] Creating cluster handler for cluster id: 0 class: Creating cluster handler for cluster id: 3 class: Creating cluster handler for cluster id: 1026 class: Discovering entities for endpoint: 00:15:bc:00:34:00:17:6b-38 'button' component -> 'ZHAIdentifyButton' using ['identify'] 'sensor' component -> 'Temperature' using ['temperature'] 'sensor' component -> 'RSSISensor' using ['basic'] 'sensor' component -> 'LQISensor' using ['basic'] [0x1F23](HESZB-120): starting availability checks - interval: 89 device - 0x1F23:00:15:bc:00:34:00:17:6b entering async_device_initialized - is_new_join: True device - 0x1F23:00:15:bc:00:34:00:17:6b has joined the ZHA zigbee network [0x1F23](HESZB-120): started configuration [0x1F23:ZDO](HESZB-120): 'async_configure' stage succeeded [0x1F23:1:0x0003]: Configuring cluster attribute reporting Error handling '_save_attribute' event with (00:15:bc:00:34:00:17:6b, 35, 0, 5, 'HESZB-120', datetime.datetime(2024, 3, 5, 8, 30, 53, 832149, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint failed [0x6B8A:1:0x0008] Sending request header: ZCLHeader(frame_control=FrameControl<0x00>(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=94, command_id=, *direction=) [0x6B8A:1:0x0008] Sending request: Read_Attributes(attribute_ids=[0]) Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 3, 5, 8, 30, 55, 3837, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x1F23), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=13, profile_id=0, cluster_id=32801, data=Serialized[b'\x01\x00'], tx_options=, radius=0, non_member_radius=0, lqi=132, rssi=-67) [0x1F23:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS ```

Additional information

Seems like the issue is a FK constraint

github-actions[bot] commented 2 months 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.