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
724 stars 671 forks source link

Request support for lumi.curtain.acn04 #3126

Open hzonz opened 4 months ago

hzonz commented 4 months ago

Problem description

Here's my previous request: #2739

ZHA has correctly identified lumi.curtain.acn04. I can only use the curtain position to control it opening and closing.

Using the button provides an error message:

日志: homeassistant.components.websocket_api.http.connection
来源: components/websocket_api/commands.py:239
集成: Home Assistant WebSocket API (文档, 问题)
首次发生: 16:48:43 (1 全部发生)
上次记录: 16:48:43

[140211060919104] Failed to close cover: <Status.FAILURE: 1>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/cover.py", line 290, in async_close_cover
    raise HomeAssistantError(f"Failed to close cover: {res[1]}")
homeassistant.exceptions.HomeAssistantError: Failed to close cover: <Status.FAILURE: 1>

Solution description

The status information is now correct.

I want to use the buttons to control this device correctly.

Screenshots/Video

Screenshots/Video [Paste/upload your media here]

Device signature

Device signature ```json { "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=4447, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *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": "0x0203", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0102", "0xfcc0" ], "output_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "Aqara", "model": "lumi.curtain.acn04", "class": "zigpy.device.Device" } ```

Diagnostic information

Diagnostic information ```json { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2024.4.4", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.12.2", "docker": true, "arch": "x86_64", "timezone": "Asia/Shanghai", "os_name": "Linux", "os_version": "6.6.25-haos", "supervisor": "2024.04.0", "host_os": "Home Assistant OS 12.2", "docker_version": "25.0.5", "chassis": "vm", "run_as_root": true }, "custom_components": { "ikuai": { "version": "1.3", "requirements": [] }, "webrtc": { "version": "v3.5.2", "requirements": [] }, "adaptive_lighting": { "version": "1.21.1", "requirements": [ "ulid-transform" ] }, "frigate": { "version": "5.1.0", "requirements": [ "pytz" ] }, "ipmi": { "version": "1.6.0", "requirements": [ "python-ipmi" ] }, "ha_file_explorer": { "version": "2023.4.20", "requirements": [] }, "browser_mod": { "version": "2.3.0", "requirements": [] }, "nodered": { "version": "3.1.5", "requirements": [] }, "bemfa": { "version": "1.4.0", "requirements": [ "paho-mqtt==1.6.1" ] }, "qweather": { "version": "2024.1.4", "requirements": [ "requests", "beautifulsoup4" ] }, "ha_cloud_music": { "version": "2024.1.17", "requirements": [ "beautifulsoup4>=4.11.1", "lxml>=4.9.1" ] }, "dahua": { "version": "0.5.0", "requirements": [] }, "openwrt": { "version": "1.3", "requirements": [] }, "ui_lovelace_minimalist": { "version": "v1.3.9", "requirements": [ "aiofiles==0.8.0", "aiogithubapi>=22.2.4" ] }, "xiaomi_miot": { "version": "0.7.17", "requirements": [ "construct>=2.10.68", "python-miio>=0.5.12", "micloud>=0.5" ] }, "xiaomi_gateway3": { "version": "4.0.4", "requirements": [ "zigpy>=0.52.3" ] }, "hacs": { "version": "1.34.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "ble_monitor": { "version": "12.10.4", "requirements": [ "pycryptodomex>=3.18.0", "janus>=1.0.0", "aioblescan>=0.2.14", "btsocket>=0.2.0", "pyric>=0.1.6.3" ] }, "zha_toolkit": { "version": "v1.1.10", "requirements": [ "pytz" ] } }, "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.1", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.114", "zigpy-deconz==0.23.1", "zigpy==0.63.5", "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": "10C4", "pid": "EA60", "description": "*slzb-07*", "known_devices": [ "smlight slzb-07" ] }, { "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": 39656, "manufacturer": "Aqara", "model": "lumi.curtain.acn04", "name": "Aqara lumi.curtain.acn04", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "quirk_id": null, "manufacturer_code": 4447, "power_source": "Mains", "lqi": 36, "rssi": null, "last_seen": "2024-04-28T16:49:28", "available": true, "device_type": "Router", "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=4447, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *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": "0x0203", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0102", "0xfcc0" ], "output_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "Aqara", "model": "lumi.curtain.acn04" }, "active_coordinator": false, "entities": [ { "entity_id": "button.aqara_lumi_curtain_acn04_identify", "name": "Aqara lumi.curtain.acn04" }, { "entity_id": "cover.unknown_cover", "name": "Aqara lumi.curtain.acn04" }, { "entity_id": "sensor.unknown_window_covering_type", "name": "Aqara lumi.curtain.acn04" }, { "entity_id": "switch.unknown_inverted", "name": "Aqara lumi.curtain.acn04" }, { "entity_id": "update.unknown_firmware", "name": "Aqara lumi.curtain.acn04" } ], "neighbors": [], "routes": [ { "dest_nwk": "0x0000", "route_status": "Active", "memory_constrained": false, "many_to_one": true, "route_record_required": false, "next_hop": "0x0000" }, { "dest_nwk": "0x0FCA", "route_status": "Active", "memory_constrained": false, "many_to_one": false, "route_record_required": false, "next_hop": "0x0FCA" }, { "dest_nwk": "0xE2A1", "route_status": "Active", "memory_constrained": false, "many_to_one": false, "route_record_required": false, "next_hop": "0x0FCA" }, { "dest_nwk": "0x2CDA", "route_status": "Active", "memory_constrained": false, "many_to_one": false, "route_record_required": false, "next_hop": "0x2CDA" }, { "dest_nwk": "0xFA6A", "route_status": "Active", "memory_constrained": false, "many_to_one": false, "route_record_required": false, "next_hop": "0xFA6A" } ], "endpoint_names": [ { "name": "WINDOW_COVERING_CONTROLLER" } ], "user_given_name": "\u6b21\u5367\u7a97\u5e18", "device_reg_id": "5e6d499bb66cdbf9ad894b26fee0ec1f", "area_id": "ci_wo", "cluster_details": { "1": { "device_type": { "name": "WINDOW_COVERING_CONTROLLER", "id": 515 }, "profile_id": 260, "in_clusters": { "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0004": { "attribute_name": "manufacturer", "value": "Aqara" }, "0x0005": { "attribute_name": "model", "value": "lumi.curtain.acn04" } }, "unsupported_attributes": {} }, "0x0102": { "endpoint_attribute": "window_covering", "attributes": { "0x0007": { "attribute_name": "config_status", "value": 3 }, "0x0008": { "attribute_name": "current_position_lift_percentage", "value": 0 }, "0x0009": { "attribute_name": "current_position_tilt_percentage", "value": 0 }, "0x0011": { "attribute_name": "installed_closed_limit_lift", "value": 0 }, "0x0013": { "attribute_name": "installed_closed_limit_tilt", "value": 0 }, "0x0010": { "attribute_name": "installed_open_limit_lift", "value": 0 }, "0x0012": { "attribute_name": "installed_open_limit_tilt", "value": 0 }, "0x0017": { "attribute_name": "window_covering_mode", "value": 1 }, "0x0000": { "attribute_name": "window_covering_type", "value": 1 } }, "unsupported_attributes": {} }, "0xfcc0": { "endpoint_attribute": "manufacturer_specific", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": { "0x0002": { "attribute_name": "current_file_version", "value": 9 } }, "unsupported_attributes": {} }, "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} } } } } } } ```

Logs

Logs ```python 2024-04-28 13:48:42.738 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=64704, SrcAddr=0x159D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=, LQI=36, SecurityUse=, TimeStamp=6727660, TSN=0, Data=b'\x1C\x5F\x11\x4E\x0A\x25\x04\x20\x02', MacSrcAddr=0x159D, MsgResultRadius=29) 2024-04-28 13:48:42.738 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 4, 28, 5, 48, 42, 738815, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x159D), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=64704, data=Serialized[b'\x1c_\x11N\n%\x04 \x02'], tx_options=, radius=29, non_member_radius=0, lqi=36, rssi=None) 2024-04-28 13:48:42.739 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received ZCL frame: b'\x1c_\x11N\n%\x04 \x02' 2024-04-28 13:48:42.739 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x1C>(frame_type=, is_manufacturer_specific=True, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), manufacturer=4447, tsn=78, command_id=10, *direction=) 2024-04-28 13:48:42.739 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame: ManufacturerSpecificCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0425, value=TypeValue(type=uint8_t, value=2))]) 2024-04-28 13:48:42.739 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received command 0x0A (TSN 78): Report_Attributes(attribute_reports=[Attribute(attrid=0x0425, value=TypeValue(type=uint8_t, value=2))]) 2024-04-28 13:48:42.739 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Attribute report received: 0x0425=2 2024-04-28 13:48:42.739 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0xfcc0]: cluster_handler[manufacturer_specific] attribute_updated - cluster[Manufacturer Specific] attr[1061] value[2] 2024-04-28 13:48:42.739 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283322.738815, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) 2024-04-28 13:48:42.740 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283322.738815, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.246 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=258, SrcAddr=0x159D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=, LQI=36, SecurityUse=, TimeStamp=6759580, TSN=0, Data=b'\x18\x51\x0A\x08\x00\x20\x00', MacSrcAddr=0x159D, MsgResultRadius=29) 2024-04-28 13:48:43.247 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 4, 28, 5, 48, 43, 247037, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x159D), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=258, data=Serialized[b'\x18Q\n\x08\x00 \x00'], tx_options=, radius=29, non_member_radius=0, lqi=36, rssi=None) 2024-04-28 13:48:43.247 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Received ZCL frame: b'\x18Q\n\x08\x00 \x00' 2024-04-28 13:48:43.247 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] 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=81, command_id=10, *direction=) 2024-04-28 13:48:43.247 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Decoded ZCL frame: WindowCovering:Report_Attributes(attribute_reports=[Attribute(attrid=0x0008, value=TypeValue(type=uint8_t, value=0))]) 2024-04-28 13:48:43.247 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Received command 0x0A (TSN 81): Report_Attributes(attribute_reports=[Attribute(attrid=0x0008, value=TypeValue(type=uint8_t, value=0))]) 2024-04-28 13:48:43.247 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Attribute report received: current_position_lift_percentage=0 2024-04-28 13:48:43.248 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0x0102]: cluster_handler[window_covering] attribute_updated - cluster[Window Covering] attr[current_position_lift_percentage] value[0] 2024-04-28 13:48:43.250 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283323.247037, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.253 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283323.247037, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.255 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.256 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.256 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 258, 'attrid': 8, 'value': 0, 'timestamp': 1714283323.248001, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.257 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=64704, SrcAddr=0x159D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=, LQI=36, SecurityUse=, TimeStamp=6760003, TSN=0, Data=b'\x1C\x5F\x11\x52\x0A\x1F\x04\x20\x00\xF5\x00\x23\x00\x9D\x15\x03', MacSrcAddr=0x159D, MsgResultRadius=29) 2024-04-28 13:48:43.257 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 4, 28, 5, 48, 43, 257624, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x159D), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=64704, data=Serialized[b'\x1c_\x11R\n\x1f\x04 \x00\xf5\x00#\x00\x9d\x15\x03'], tx_options=, radius=29, non_member_radius=0, lqi=36, rssi=None) 2024-04-28 13:48:43.258 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received ZCL frame: b'\x1c_\x11R\n\x1f\x04 \x00\xf5\x00#\x00\x9d\x15\x03' 2024-04-28 13:48:43.258 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x1C>(frame_type=, is_manufacturer_specific=True, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), manufacturer=4447, tsn=82, command_id=10, *direction=) 2024-04-28 13:48:43.258 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame: ManufacturerSpecificCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x041F, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:43.258 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received command 0x0A (TSN 82): Report_Attributes(attribute_reports=[Attribute(attrid=0x041F, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:43.259 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Attribute report received: 0x041F=0, 0x00F5=51748096 2024-04-28 13:48:43.259 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0xfcc0]: cluster_handler[manufacturer_specific] attribute_updated - cluster[Manufacturer Specific] attr[1055] value[0] 2024-04-28 13:48:43.259 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0xfcc0]: cluster_handler[manufacturer_specific] attribute_updated - cluster[Manufacturer Specific] attr[245] value[51748096] 2024-04-28 13:48:43.259 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 258, 'attrid': 8, 'value': 0, 'timestamp': 1714283323.248001, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.259 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.260 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.261 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283323.257624, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.261 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283323.257624, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.262 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.262 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.262 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 1055, 'value': 0, 'timestamp': 1714283323.259094, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.262 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 1055, 'value': 0, 'timestamp': 1714283323.259094, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.263 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.263 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.263 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283323.259171, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.264 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283323.259171, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.265 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.265 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.451 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=64704, SrcAddr=0x159D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=, LQI=36, SecurityUse=, TimeStamp=6772184, TSN=0, Data=b'\x1C\x5F\x11\x53\x0A\x21\x04\x20\x00\xF5\x00\x23\x00\x9D\x15\x03', MacSrcAddr=0x159D, MsgResultRadius=29) 2024-04-28 13:48:43.451 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 4, 28, 5, 48, 43, 451762, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x159D), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=64704, data=Serialized[b'\x1c_\x11S\n!\x04 \x00\xf5\x00#\x00\x9d\x15\x03'], tx_options=, radius=29, non_member_radius=0, lqi=36, rssi=None) 2024-04-28 13:48:43.452 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received ZCL frame: b'\x1c_\x11S\n!\x04 \x00\xf5\x00#\x00\x9d\x15\x03' 2024-04-28 13:48:43.452 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x1C>(frame_type=, is_manufacturer_specific=True, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), manufacturer=4447, tsn=83, command_id=10, *direction=) 2024-04-28 13:48:43.452 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame: ManufacturerSpecificCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0421, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:43.452 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received command 0x0A (TSN 83): Report_Attributes(attribute_reports=[Attribute(attrid=0x0421, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:43.452 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Attribute report received: 0x0421=0, 0x00F5=51748096 2024-04-28 13:48:43.452 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0xfcc0]: cluster_handler[manufacturer_specific] attribute_updated - cluster[Manufacturer Specific] attr[1057] value[0] 2024-04-28 13:48:43.452 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0xfcc0]: cluster_handler[manufacturer_specific] attribute_updated - cluster[Manufacturer Specific] attr[245] value[51748096] 2024-04-28 13:48:43.453 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283323.451762, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.453 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283323.451762, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.453 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.453 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.454 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 1057, 'value': 0, 'timestamp': 1714283323.452803, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.454 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 1057, 'value': 0, 'timestamp': 1714283323.452803, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.455 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.455 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.455 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283323.45286, 'min_update_delta': 30.0}) 2024-04-28 13:48:43.456 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283323.45286, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:43.456 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:43.456 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:43.473 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x2CDA](lumi.curtain.acn04): Device seen - marking the device available and resetting counter 2024-04-28 13:48:43.474 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x2CDA](lumi.curtain.acn04): Update device availability - device available: True - new availability: True - changed: False 2024-04-28 13:48:43.476 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9426](lumi.curtain.acn04): Device seen - marking the device available and resetting counter 2024-04-28 13:48:43.476 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9426](lumi.curtain.acn04): Update device availability - device available: True - new availability: True - changed: False 2024-04-28 13:48:44.595 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating xiaomi_miot binary_sensor took longer than the scheduled update interval 0:00:01 2024-04-28 13:48:49.921 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.SrcRtgInd.Callback(DstAddr=0x159D, Relays=[]) 2024-04-28 13:48:49.922 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, 'INSERT INTO relays_v12 VALUES (:ieee, :relays)\n ON CONFLICT (ieee)\n DO UPDATE SET relays=excluded.relays WHERE relays != :relays', {'ieee': 54:ef:44:10:00:96:30:e0, 'relays': b'\x00'}) 2024-04-28 13:48:49.923 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, 'INSERT INTO relays_v12 VALUES (:ieee, :relays)\n ON CONFLICT (ieee)\n DO UPDATE SET relays=excluded.relays WHERE relays != :relays', {'ieee': 54:ef:44:10:00:96:30:e0, 'relays': b'\x00'}) completed 2024-04-28 13:48:49.923 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:49.923 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:49.971 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=64704, SrcAddr=0x159D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=, LQI=32, SecurityUse=, TimeStamp=7179700, TSN=0, Data=b'\x1C\x5F\x11\x55\x0A\x21\x04\x20\x02\xF5\x00\x23\x00\x9D\x15\x03', MacSrcAddr=0x159D, MsgResultRadius=29) 2024-04-28 13:48:49.971 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 4, 28, 5, 48, 49, 971642, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x159D), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=64704, data=Serialized[b'\x1c_\x11U\n!\x04 \x02\xf5\x00#\x00\x9d\x15\x03'], tx_options=, radius=29, non_member_radius=0, lqi=32, rssi=None) 2024-04-28 13:48:49.971 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received ZCL frame: b'\x1c_\x11U\n!\x04 \x02\xf5\x00#\x00\x9d\x15\x03' 2024-04-28 13:48:49.972 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x1C>(frame_type=, is_manufacturer_specific=True, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), manufacturer=4447, tsn=85, command_id=10, *direction=) 2024-04-28 13:48:49.972 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Decoded ZCL frame: ManufacturerSpecificCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0421, value=TypeValue(type=uint8_t, value=2)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:49.972 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Received command 0x0A (TSN 85): Report_Attributes(attribute_reports=[Attribute(attrid=0x0421, value=TypeValue(type=uint8_t, value=2)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:49.972 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0xfcc0] Attribute report received: 0x0421=2, 0x00F5=51748096 2024-04-28 13:48:49.972 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0xfcc0]: cluster_handler[manufacturer_specific] attribute_updated - cluster[Manufacturer Specific] attr[1057] value[2] 2024-04-28 13:48:49.972 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0xfcc0]: cluster_handler[manufacturer_specific] attribute_updated - cluster[Manufacturer Specific] attr[245] value[51748096] 2024-04-28 13:48:49.973 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283329.971642, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) 2024-04-28 13:48:49.974 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283329.971642, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:49.974 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:49.974 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:49.975 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 1057, 'value': 2, 'timestamp': 1714283329.972713, 'min_update_delta': 30.0}) 2024-04-28 13:48:49.975 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 1057, 'value': 2, 'timestamp': 1714283329.972713, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:49.975 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:49.976 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:49.976 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283329.972775, 'min_update_delta': 30.0}) 2024-04-28 13:48:49.976 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 64704, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283329.972775, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:49.976 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:49.977 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:51.625 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=258, SrcAddr=0x159D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=, LQI=32, SecurityUse=, TimeStamp=7283098, TSN=0, Data=b'\x18\x57\x0A\x08\x00\x20\x00\xF5\x00\x23\x00\x9D\x15\x03', MacSrcAddr=0x159D, MsgResultRadius=29) 2024-04-28 13:48:51.625 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 4, 28, 5, 48, 51, 625786, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x159D), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=258, data=Serialized[b'\x18W\n\x08\x00 \x00\xf5\x00#\x00\x9d\x15\x03'], tx_options=, radius=29, non_member_radius=0, lqi=32, rssi=None) 2024-04-28 13:48:51.626 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Received ZCL frame: b'\x18W\n\x08\x00 \x00\xf5\x00#\x00\x9d\x15\x03' 2024-04-28 13:48:51.626 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] 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=87, command_id=10, *direction=) 2024-04-28 13:48:51.626 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Decoded ZCL frame: WindowCovering:Report_Attributes(attribute_reports=[Attribute(attrid=0x0008, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:51.627 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Received command 0x0A (TSN 87): Report_Attributes(attribute_reports=[Attribute(attrid=0x0008, value=TypeValue(type=uint8_t, value=0)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=51748096))]) 2024-04-28 13:48:51.627 DEBUG (MainThread) [zigpy.zcl] [0x159D:1:0x0102] Attribute report received: current_position_lift_percentage=0, 0x00F5=51748096 2024-04-28 13:48:51.627 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0x0102]: cluster_handler[window_covering] attribute_updated - cluster[Window Covering] attr[current_position_lift_percentage] value[0] 2024-04-28 13:48:51.627 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x159D:1:0x0102]: cluster_handler[window_covering] attribute_updated - cluster[Window Covering] attr[245] value[51748096] 2024-04-28 13:48:51.627 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283331.625786, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) 2024-04-28 13:48:51.628 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1714283331.625786, 'ieee': 54:ef:44:10:00:96:30:e0, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:51.629 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:51.629 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:51.629 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 258, 'attrid': 8, 'value': 0, 'timestamp': 1714283331.62741, 'min_update_delta': 30.0}) 2024-04-28 13:48:51.630 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 258, 'attrid': 8, 'value': 0, 'timestamp': 1714283331.62741, 'min_update_delta': 30.0}) completed 2024-04-28 13:48:51.630 DEBUG (Thread-7) [aiosqlite] executing functools.partial() 2024-04-28 13:48:51.630 DEBUG (Thread-7) [aiosqlite] operation functools.partial() completed 2024-04-28 13:48:51.631 DEBUG (Thread-7) [aiosqlite] executing functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 258, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283331.62767, 'min_update_delta': 30.0}) 2024-04-28 13:48:51.631 DEBUG (Thread-7) [aiosqlite] operation functools.partial(, '\n INSERT INTO attributes_cache_v12\n VALUES (:ieee, :endpoint_id, :cluster_id, :attrid, :value, :timestamp)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid) DO UPDATE\n SET value=excluded.value, last_updated=excluded.last_updated\n WHERE\n value != excluded.value\n OR :timestamp - last_updated > :min_update_delta\n ', {'ieee': 54:ef:44:10:00:96:30:e0, 'endpoint_id': 1, 'cluster_id': 258, 'attrid': 245, 'value': 51748096, 'timestamp': 1714283331.62767, 'min_update_delta': 30.0}) completed ```

Custom quirk

Custom quirk ```python from zigpy.quirks import CustomCluster from zigpy.profiles import zha from zigpy.zcl.clusters.general import ( Basic, PowerConfiguration, Identify, Ota ) from zigpy.zcl.clusters.closures import WindowCovering from zigpy.zcl.clusters.manufacturer_specific import ManufacturerSpecificCluster from zigpy.types import uint8_t, uint32_t from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, MODELS_INFO, OUTPUT_CLUSTERS, PROFILE_ID, ) from zhaquirks.xiaomi import LUMI, XiaomiCustomDevice # 自定义窗帘控制集群 class WindowCoveringC3(CustomCluster, WindowCovering): """自定义窗帘控制集群,处理状态反转等需求""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def set_full_open(self): self._write_attributes({'target_position': 0}) def set_full_close(self): self._write_attributes({'target_position': 100}) # 定义LumiCurtainACN04设备类 class DriverC3(XiaomiCustomDevice): signature = { MODELS_INFO: [(LUMI, "lumi.curtain.acn04")], ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE, # 修改为窗帘设备类型 INPUT_CLUSTERS: [ Basic.cluster_id, PowerConfiguration.cluster_id, Identify.cluster_id, WindowCoveringC3, # 使用自定义窗帘控制集群 ManufacturerSpecificCluster.cluster_id, ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Ota.cluster_id, ], } }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE, INPUT_CLUSTERS: [ Basic.cluster_id, PowerConfiguration.cluster_id, Identify.cluster_id, WindowCoveringC3, # 确保替换为自定义集群 ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Ota.cluster_id, ], } }, } ```

Additional information

The ZHA quirks file is written using AI. The log reports that quirks are loaded correctly.

The device is not loading quirks properly.

日志: zhaquirks
来源: /usr/local/lib/python3.12/site-packages/zhaquirks/__init__.py:465
首次发生: 16:35:01 (1 全部发生)
上次记录: 16:35:01

Loaded custom quirks. Please contribute them to https://github.com/zigpy/zha-device-handlers
hzonz commented 4 months ago

![Uploading screenshot.png…]()