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
721 stars 669 forks source link

[Device Support Request] Aqara H1 Double Rocker No Neutral Switch (Xiaomi WS-EUK02/lumi.switch.l2aeu1) #2810

Open bjarnekrottje opened 9 months ago

bjarnekrottje commented 9 months ago

Problem description

Hi all,

Since the merge of #2784 (Thanks for that @TheJulianJES) in release 0.0.107 (which has now been merged into Home Assistant version 2023.12.0), a new quirk has been added for the device with id lumi.switch.l2aeu1.

Unfortunately, it looks like not all functionality of the device is yet supported. Looking at the Zigbee2MQTT list of supported functionalities for this device it looks like some of the functionalities appear to not be available in this new quirk, like:

Please add a comment or correct something if I am missing functionalities or have incorrectly labeled them here.

Solution description

I would like to see the quirk being updated to support the missing functionalities. I have tried looking into this myself, but unfortunately have not been successful yet. Especially the Operation mode (Decoupled or Coupled/Control_relay) functionality is important to me currently.

It does look like (some of) the functionalities have already been implemented.

For example: The quirk the device currently uses (zhaquirks.xiaomi.aqara.switch_h1_double.AqaraH1DoubleRockerSwitchNoNeutralAlt) has a base reference to XiaomiOpple2ButtonSwitchBase, which itself has an endpoint of 1 and 2 with the input_cluster OppleSwitchCluster. This input cluster contains a lot of the missing functionalities (like operation mode and switch type). I am wondering why they aren't showing up in the device when using this quirk then. I have yet to be able to determine the cause for this, maybe someone could clarify it.

Screenshots/Video

Current functionality (since Home Assistant version 2023.12.0): HA Screenshot current device (Looks like the image is not showing using the <details> syntax, so pasted it outside so it at least shows)

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=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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": "0x0104", "device_type": "0x0000", "input_clusters": [ "0x0000", "0x0002", "0x0003", "0x0004", "0x0005", "0x0006", "0x0009", "0x0012", "0x0702", "0x0b04", "0xfcc0" ], "output_clusters": [ "0x000a", "0x0019" ] }, "2": { "profile_id": "0x0104", "device_type": "0x0000", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0012", "0xfcc0" ], "output_clusters": [] }, "21": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x000c" ], "output_clusters": [] }, "31": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x000c" ], "output_clusters": [] }, "41": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "42": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "51": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "61": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "242": { "profile_id": "0xa1e0", "device_type": "0x0061", "input_clusters": [], "output_clusters": [ "0x0021" ] } }, "manufacturer": "LUMI", "model": "lumi.switch.l2aeu1", "class": "zhaquirks.xiaomi.aqara.switch_h1_double.AqaraH1DoubleRockerSwitchNoNeutralAlt" } ```

Diagnostic information

Diagnostic information ```json { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.12.0", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.11.6", "docker": true, "arch": "aarch64", "timezone": "Europe/Amsterdam", "os_name": "Linux", "os_version": "6.1.58-haos-raspi", "supervisor": "2023.11.6", "host_os": "Home Assistant OS 11.2", "docker_version": "24.0.7", "chassis": "embedded", "run_as_root": true }, "custom_components": { "grott": { "version": "1.1.0", "requirements": [] }, "volkswagen_we_connect_id": { "version": "1.0", "requirements": [ "weconnect==0.58.0", "ascii_magic>=2.0.0" ] }, "alarmo": { "version": "v1.9.13", "requirements": [] }, "hacs": { "version": "1.33.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "hass_agent_mediaplayer": { "version": "2022.5.6", "requirements": [] }, "afvalbeheer": { "version": "5.2.9", "requirements": [ "rsa", "pycryptodome" ] }, "multiscrape": { "version": "6.5.0", "requirements": [ "lxml==4.9.1", "beautifulsoup4==4.11.1" ] }, "dwains_dashboard": { "version": "3.6.0", "requirements": [] }, "hass_agent_notifier": { "version": "2022.10.25.1", "requirements": [] }, "webrtc": { "version": "v3.5.0", "requirements": [] }, "eufy_security": { "version": "7.7.4", "requirements": [ "websocket-client==1.4.2", "aiortsp==1.3.7" ] }, "watchman": { "version": "0.5.1", "requirements": [ "prettytable==3.0.0" ] }, "spotcast": { "version": "v3.6.30", "requirements": [] } }, "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.37.1", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.107", "zigpy-deconz==0.22.0", "zigpy==0.60.0", "zigpy-xbee==0.20.0", "zigpy-zigate==0.12.0", "zigpy-znp==0.12.0", "universal-silabs-flasher==0.0.15", "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": 11721, "manufacturer": "LUMI", "model": "lumi.switch.l2aeu1", "name": "LUMI lumi.switch.l2aeu1", "quirk_applied": true, "quirk_class": "zhaquirks.xiaomi.aqara.switch_h1_double.AqaraH1DoubleRockerSwitchNoNeutralAlt", "quirk_id": null, "manufacturer_code": 4447, "power_source": "Battery or Unknown", "lqi": 164, "rssi": -59, "last_seen": "2023-12-07T19:46:00", "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=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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": "0x0104", "device_type": "0x0000", "input_clusters": [ "0x0000", "0x0002", "0x0003", "0x0004", "0x0005", "0x0006", "0x0009", "0x0012", "0x0702", "0x0b04", "0xfcc0" ], "output_clusters": [ "0x000a", "0x0019" ] }, "2": { "profile_id": "0x0104", "device_type": "0x0000", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0012", "0xfcc0" ], "output_clusters": [] }, "21": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x000c" ], "output_clusters": [] }, "31": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x000c" ], "output_clusters": [] }, "41": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "42": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "51": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "61": { "profile_id": "0x0104", "device_type": "0x0100", "input_clusters": [ "0x0012" ], "output_clusters": [] }, "242": { "profile_id": "0xa1e0", "device_type": "0x0061", "input_clusters": [], "output_clusters": [ "0x0021" ] } }, "manufacturer": "LUMI", "model": "lumi.switch.l2aeu1" }, "active_coordinator": false, "entities": [ { "entity_id": "button.lumi_lumi_switch_l2aeu1_identify", "name": "LUMI lumi.switch.l2aeu1" }, { "entity_id": "sensor.lumi_lumi_switch_l2aeu1_voltage", "name": "LUMI lumi.switch.l2aeu1" }, { "entity_id": "sensor.lumi_lumi_switch_l2aeu1_device_temperature", "name": "LUMI lumi.switch.l2aeu1" }, { "entity_id": "sensor.lumi_lumi_switch_l2aeu1_power", "name": "LUMI lumi.switch.l2aeu1" }, { "entity_id": "sensor.lumi_lumi_switch_l2aeu1_summation_delivered", "name": "LUMI lumi.switch.l2aeu1" }, { "entity_id": "switch.lumi_lumi_switch_l2aeu1_switch", "name": "LUMI lumi.switch.l2aeu1" }, { "entity_id": "switch.lumi_lumi_switch_l2aeu1_switch_2", "name": "LUMI lumi.switch.l2aeu1" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "ON_OFF_SWITCH" }, { "name": "ON_OFF_SWITCH" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "PROXY_BASIC" } ], "user_given_name": null, "device_reg_id": "c12643c3720da74abf21c3615a143757", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "ON_OFF_SWITCH", "id": 0 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0005": { "attribute_name": "model", "value": "lumi.switch.l2aeu1" } }, "unsupported_attributes": {} }, "0x0002": { "endpoint_attribute": "device_temperature", "attributes": { "0x0000": { "attribute_name": "current_temperature", "value": 2000 } }, "unsupported_attributes": {} }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 0 } }, "unsupported_attributes": { "0x4003": { "attribute_name": "start_up_on_off" } } }, "0x0009": { "endpoint_attribute": "alarms", "attributes": {}, "unsupported_attributes": {} }, "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} }, "0x0702": { "endpoint_attribute": "smartenergy_metering", "attributes": { "0x0000": { "attribute_name": "current_summ_delivered", "value": 0 }, "0x0302": { "attribute_name": "divisor", "value": 1000 }, "0x0306": { "attribute_name": "metering_device_type", "value": 0 }, "0x0301": { "attribute_name": "multiplier", "value": 1 }, "0x0303": { "attribute_name": "summation_formatting", "value": 35 }, "0x0300": { "attribute_name": "unit_of_measure", "value": 0 } }, "unsupported_attributes": { "0x0400": { "attribute_name": "instantaneous_demand" }, "0x0100": { "attribute_name": "current_tier1_summ_delivered" }, "0x0102": { "attribute_name": "current_tier2_summ_delivered" }, "0x0106": { "attribute_name": "current_tier4_summ_delivered" }, "0x0304": { "attribute_name": "demand_formatting" }, "0x0104": { "attribute_name": "current_tier3_summ_delivered" }, "0x0108": { "attribute_name": "current_tier5_summ_delivered" }, "0x010a": { "attribute_name": "current_tier6_summ_delivered" }, "0x0200": { "attribute_name": "status" } } }, "0x0b04": { "endpoint_attribute": "electrical_measurement", "attributes": { "0x0605": { "attribute_name": "ac_power_divisor", "value": 10 }, "0x0604": { "attribute_name": "ac_power_multiplier", "value": 1 }, "0x050b": { "attribute_name": "active_power", "value": 0 }, "0x0403": { "attribute_name": "power_divisor", "value": 1 }, "0x0402": { "attribute_name": "power_multiplier", "value": 1 }, "0x0505": { "attribute_name": "rms_voltage", "value": 0 }, "0x0304": { "attribute_name": "total_active_power", "value": 0 } }, "unsupported_attributes": { "0x0600": { "attribute_name": "ac_voltage_multiplier" }, "0x0601": { "attribute_name": "ac_voltage_divisor" }, "0x0602": { "attribute_name": "ac_current_multiplier" }, "0x0603": { "attribute_name": "ac_current_divisor" }, "0x0401": { "attribute_name": "ac_frequency_divisor" }, "0x0400": { "attribute_name": "ac_frequency_multiplier" }, "0x0000": { "attribute_name": "measurement_type" }, "0x0507": { "attribute_name": "rms_voltage_max" }, "0x0508": { "attribute_name": "rms_current" }, "0x0300": { "attribute_name": "ac_frequency" }, "0x050a": { "attribute_name": "rms_current_max" }, "0x0302": { "attribute_name": "ac_frequency_max" }, "0x050d": { "attribute_name": "active_power_max" }, "0x050f": { "attribute_name": "apparent_power" }, "0x0510": { "attribute_name": "power_factor" } } }, "0xfcc0": { "endpoint_attribute": "opple_cluster", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} } } }, "2": { "device_type": { "name": "ON_OFF_SWITCH", "id": 0 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": {}, "unsupported_attributes": {} }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 0 } }, "unsupported_attributes": { "0x4003": { "attribute_name": "start_up_on_off" } } }, "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} }, "0xfcc0": { "endpoint_attribute": "opple_cluster", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "21": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x000c": { "endpoint_attribute": "analog_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "31": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x000c": { "endpoint_attribute": "analog_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "41": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": { "0x0055": { "attribute_name": "present_value", "value": 1.0 } }, "unsupported_attributes": {} } }, "out_clusters": {} }, "42": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": { "0x0055": { "attribute_name": "present_value", "value": 1.0 } }, "unsupported_attributes": {} } }, "out_clusters": {} }, "51": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": { "0x0055": { "attribute_name": "present_value", "value": 1.0 } }, "unsupported_attributes": {} } }, "out_clusters": {} }, "61": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "242": { "device_type": { "name": "PROXY_BASIC", "id": 97 }, "profile_id": 41440, "in_clusters": {}, "out_clusters": { "0x0021": { "endpoint_attribute": "green_power", "attributes": {}, "unsupported_attributes": {} } } } } } } ```

Logs

Logs I don't know if this is the correct piece of the debug logging, but here it is: ```python 2023-12-07 19:52:16.624 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8160597e' 2023-12-07 19:52:16.627 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame received incomingMessageHandler: [, EmberApsFrame(profileId=260, clusterId=0, sourceEndpoint=1, destinationEndpoint=1, options=, groupId=0, sequence=26), 156, -61, 0x0f3a, 255, 255, b'\x18t\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.l2aeu1'] 2023-12-07 19:52:16.627 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [, EmberApsFrame(profileId=260, clusterId=0, sourceEndpoint=1, destinationEndpoint=1, options=, groupId=0, sequence=26), 156, -61, 0x0f3a, 255, 255, b'\x18t\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.l2aeu1'] 2023-12-07 19:52:16.628 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2023, 12, 7, 18, 52, 16, 628382, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x0F3A), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=26, profile_id=260, cluster_id=0, data=Serialized[b'\x18t\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.l2aeu1'], tx_options=, radius=0, non_member_radius=0, lqi=156, rssi=-61) 2023-12-07 19:52:16.629 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:1:0x0000] Received ZCL frame: b'\x18t\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.l2aeu1' 2023-12-07 19:52:16.630 DEBUG (MainThread) [zigpy.zcl] [0x0F3A: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), tsn=116, command_id=1, *direction=) 2023-12-07 19:52:16.637 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=, value=TypeValue(type=CharacterString, value='LUMI')), ReadAttributeRecord(attrid=0x0005, status=, value=TypeValue(type=CharacterString, value='lumi.switch.l2aeu1'))]) 2023-12-07 19:52:16.640 INFO (MainThread) [zigpy.device] [0x0f3a] Read model 'lumi.switch.l2aeu1' and manufacturer 'LUMI' from > 2023-12-07 19:52:16.640 INFO (MainThread) [zigpy.device] [0x0f3a] Discovered basic device information for 2023-12-07 19:52:16.640 DEBUG (MainThread) [zigpy.application] Device is initialized 2023-12-07 19:52:16.641 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for LUMI lumi.switch.l2aeu1 (54:ef:44:10:00:90:56:5c) 2023-12-07 19:52:16.641 DEBUG (MainThread) [zigpy.quirks.registry] Considering 2023-12-07 19:52:16.641 DEBUG (MainThread) [zigpy.quirks.registry] Found custom device replacement for 54:ef:44:10:00:90:56:5c: 2023-12-07 19:52:16.644 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 0 class: 2023-12-07 19:52:16.644 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 2 class: 2023-12-07 19:52:16.644 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 3 class: 2023-12-07 19:52:16.644 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 4 class: 2023-12-07 19:52:16.644 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 5 class: 2023-12-07 19:52:16.645 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 6 class: 2023-12-07 19:52:16.645 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 9 class: 2023-12-07 19:52:16.645 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 18 class: 2023-12-07 19:52:16.645 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 1794 class: 2023-12-07 19:52:16.645 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 2820 class: 2023-12-07 19:52:16.645 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 64704 class: 2023-12-07 19:52:16.646 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-1 2023-12-07 19:52:16.648 DEBUG (Thread-6) [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:90:56:5c, 'endpoint_id': 1, 'cluster_id': 0, 'attrid': 4, 'value': 'LUMI', 'timestamp': 1701975136.639729, 'min_update_delta': 30.0}) 2023-12-07 19:52:16.652 DEBUG (Thread-6) [aiosqlite] returning exception FOREIGN KEY constraint failed 2023-12-07 19:52:16.655 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'button' component -> 'ZHAIdentifyButton' using ['identify'] 2023-12-07 19:52:16.656 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'ElectricalMeasurementApparentPower' using ['electrical_measurement'] 2023-12-07 19:52:16.656 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'ElectricalMeasurementRMSCurrent' using ['electrical_measurement'] 2023-12-07 19:52:16.656 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'ElectricalMeasurementRMSVoltage' using ['electrical_measurement'] 2023-12-07 19:52:16.656 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'ElectricalMeasurementFrequency' using ['electrical_measurement'] 2023-12-07 19:52:16.656 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'ElectricalMeasurementPowerFactor' using ['electrical_measurement'] 2023-12-07 19:52:16.656 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'DeviceTemperature' using ['device_temperature'] 2023-12-07 19:52:16.656 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'RSSISensor' using ['basic'] 2023-12-07 19:52:16.657 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'LQISensor' using ['basic'] 2023-12-07 19:52:16.657 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'PolledElectricalMeasurement' using ['electrical_measurement'] 2023-12-07 19:52:16.657 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'SmartEnergyMetering' using ['smartenergy_metering'] 2023-12-07 19:52:16.657 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'SmartEnergySummation' using ['smartenergy_metering'] 2023-12-07 19:52:16.665 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'select' component -> 'TuyaPowerOnStateSelectEntity' using ['on_off'] 2023-12-07 19:52:16.665 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'select' component -> 'TuyaBacklightModeSelectEntity' using ['on_off'] 2023-12-07 19:52:16.666 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'select' component -> 'ZHAStartupOnOffSelectEntity' using ['on_off'] 2023-12-07 19:52:16.666 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'switch' component -> 'TuyaChildLockSwitch' using ['on_off'] 2023-12-07 19:52:16.666 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 0 class: 2023-12-07 19:52:16.666 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 3 class: 2023-12-07 19:52:16.666 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 4 class: 2023-12-07 19:52:16.666 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 5 class: 2023-12-07 19:52:16.667 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 6 class: 2023-12-07 19:52:16.667 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 18 class: 2023-12-07 19:52:16.667 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 64704 class: 2023-12-07 19:52:16.667 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-2 2023-12-07 19:52:16.674 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'button' component -> 'ZHAIdentifyButton' using ['identify'] 2023-12-07 19:52:16.674 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'RSSISensor' using ['basic'] 2023-12-07 19:52:16.674 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' component -> 'LQISensor' using ['basic'] 2023-12-07 19:52:16.682 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'select' component -> 'TuyaPowerOnStateSelectEntity' using ['on_off'] 2023-12-07 19:52:16.682 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'select' component -> 'TuyaBacklightModeSelectEntity' using ['on_off'] 2023-12-07 19:52:16.683 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'select' component -> 'ZHAStartupOnOffSelectEntity' using ['on_off'] 2023-12-07 19:52:16.683 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'switch' component -> 'TuyaChildLockSwitch' using ['on_off'] 2023-12-07 19:52:16.683 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 12 class: 2023-12-07 19:52:16.683 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-21 2023-12-07 19:52:16.695 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 12 class: 2023-12-07 19:52:16.696 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-31 2023-12-07 19:52:16.704 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 18 class: 2023-12-07 19:52:16.705 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-41 2023-12-07 19:52:16.714 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 18 class: 2023-12-07 19:52:16.714 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-42 2023-12-07 19:52:16.727 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 18 class: 2023-12-07 19:52:16.728 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-51 2023-12-07 19:52:16.733 INFO (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 18 class: 2023-12-07 19:52:16.734 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-61 2023-12-07 19:52:16.750 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: 54:ef:44:10:00:90:56:5c-242 2023-12-07 19:52:16.763 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x0F3A:54:ef:44:10:00:90:56:5c entering async_device_initialized - is_new_join: True 2023-12-07 19:52:16.764 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x0F3A:54:ef:44:10:00:90:56:5c has joined the ZHA zigbee network 2023-12-07 19:52:16.768 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x0F3A](lumi.switch.l2aeu1): started configuration 2023-12-07 19:52:16.768 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:ZDO](lumi.switch.l2aeu1): 'async_configure' stage succeeded 2023-12-07 19:52:16.781 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (54:ef:44:10:00:90:56:5c, 1, 0, 4, 'LUMI', datetime.datetime(2023, 12, 7, 18, 52, 16, 639729, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint failed 2023-12-07 19:52:16.782 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0b04]: Performing cluster binding 2023-12-07 19:52:16.783 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0b04]: bound 'electrical_measurement' cluster: Status.SUCCESS 2023-12-07 19:52:16.783 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0b04]: Configuring cluster attribute reporting 2023-12-07 19:52:16.784 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0b04]: Successfully configured reporting for '{'active_power': (5, 900, 1), 'active_power_max': (30, 900, 1), 'apparent_power': (5, 900, 1)}' on 'electrical_measurement' cluster: [ConfigureReportingResponseRecord(status=)] 2023-12-07 19:52:16.786 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0b04]: Successfully configured reporting for '{'rms_current': (5, 900, 1), 'rms_current_max': (30, 900, 1), 'rms_voltage': (5, 900, 1)}' on 'electrical_measurement' cluster: [ConfigureReportingResponseRecord(status=)] 2023-12-07 19:52:16.787 DEBUG (Thread-6) [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:90:56:5c, 'endpoint_id': 1, 'cluster_id': 0, 'attrid': 5, 'value': 'lumi.switch.l2aeu1', 'timestamp': 1701975136.639847, 'min_update_delta': 30.0}) 2023-12-07 19:52:16.788 DEBUG (Thread-6) [aiosqlite] returning exception FOREIGN KEY constraint failed 2023-12-07 19:52:16.790 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0b04]: Successfully configured reporting for '{'rms_voltage_max': (30, 900, 1), 'ac_frequency': (5, 900, 1), 'ac_frequency_max': (30, 900, 1)}' on 'electrical_measurement' cluster: [ConfigureReportingResponseRecord(status=)] 2023-12-07 19:52:16.791 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0b04]: finished cluster handler configuration 2023-12-07 19:52:16.792 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0003]: Configuring cluster attribute reporting 2023-12-07 19:52:16.792 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0003]: finished cluster handler configuration 2023-12-07 19:52:16.793 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0002]: Performing cluster binding 2023-12-07 19:52:16.793 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0002]: bound 'device_temperature' cluster: Status.SUCCESS 2023-12-07 19:52:16.793 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0002]: Configuring cluster attribute reporting 2023-12-07 19:52:16.794 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0002]: Successfully configured reporting for '{'current_temperature': (30, 900, 50)}' on 'device_temperature' cluster: [ConfigureReportingResponseRecord(status=)] 2023-12-07 19:52:16.794 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0002]: finished cluster handler configuration 2023-12-07 19:52:16.794 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0000]: Configuring cluster attribute reporting 2023-12-07 19:52:16.794 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0000]: finished cluster handler configuration 2023-12-07 19:52:16.795 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0702]: Performing cluster binding 2023-12-07 19:52:16.795 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0702]: bound 'smartenergy_metering' cluster: Status.SUCCESS 2023-12-07 19:52:16.798 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0702]: Configuring cluster attribute reporting 2023-12-07 19:52:16.799 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0702]: Successfully configured reporting for '{'instantaneous_demand': (5, 900, 1), 'current_summ_delivered': (30, 900, 1), 'current_tier1_summ_delivered': (30, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] 2023-12-07 19:52:18.043 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'16feb1a90d2a2fbd05c2da25ba117d1d14f026bc3f6e9f7e' 2023-12-07 19:52:18.043 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'82503a7e' 2023-12-07 19:52:18.096 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'26feb1a9112a15b658924a27ab5593499c555b10d7c19874f3de9083fc7e2fa71ecdfd6f7000c5df98fc7e' 2023-12-07 19:52:18.096 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'83401b7e' 2023-12-07 19:52:18.098 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0702]: Successfully configured reporting for '{'current_tier2_summ_delivered': (30, 900, 1), 'current_tier3_summ_delivered': (30, 900, 1), 'current_tier4_summ_delivered': (30, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] 2023-12-07 19:52:18.099 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0702]: Successfully configured reporting for '{'current_tier5_summ_delivered': (30, 900, 1), 'current_tier6_summ_delivered': (30, 900, 1), 'status': (1, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] 2023-12-07 19:52:18.100 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0702]: finished cluster handler configuration 2023-12-07 19:52:18.101 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0xfcc0]: Performing cluster binding 2023-12-07 19:52:18.102 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'1efeb1a90d2a2fbd05c2da25ba117d1d14f026bc3fa1e97e' 2023-12-07 19:52:18.102 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'82503a7e' 2023-12-07 19:52:18.105 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'2efeb1a9112a15b658924a27ab5593499c555b10d7c19874f3de9083fc7e2fa71ecdfd6f7000c5df9d3b7e' 2023-12-07 19:52:18.105 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'83401b7e' 2023-12-07 19:52:18.102 DEBUG (MainThread) [zigpy.device] [0x0f3a] Extending timeout for 0x7d request 2023-12-07 19:52:18.106 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(timestamp=datetime.datetime(2023, 12, 7, 18, 52, 18, 106302, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x0000), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0F3A), dst_ep=0, source_route=None, extended_timeout=True, tsn=125, profile_id=0, cluster_id=, data=Serialized[b'}\\V\x90\x00\x10D\xefT\x01\xc0\xfc\x03\xb1\xc9"\xfe\xffn\x02\xbc\x01'], tx_options=, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-12-07 19:52:18.107 DEBUG (MainThread) [bellows.ezsp.protocol] Send command setExtendedTimeout: (54:ef:44:10:00:90:56:5c, True) 2023-12-07 19:52:18.108 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0006]: Performing cluster binding 2023-12-07 19:52:18.110 DEBUG (MainThread) [zigpy.device] [0x0f3a] Extending timeout for 0x7f request 2023-12-07 19:52:18.110 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(timestamp=datetime.datetime(2023, 12, 7, 18, 52, 18, 110545, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x0000), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0F3A), dst_ep=0, source_route=None, extended_timeout=True, tsn=127, profile_id=0, cluster_id=, data=Serialized[b'\x7f\\V\x90\x00\x10D\xefT\x01\x06\x00\x03\xb1\xc9"\xfe\xffn\x02\xbc\x01'], tx_options=, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-12-07 19:52:18.111 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:1:0x0019]: finished cluster handler configuration 2023-12-07 19:52:18.111 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:2:0x0000]: Configuring cluster attribute reporting 2023-12-07 19:52:18.112 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:2:0x0000]: finished cluster handler configuration 2023-12-07 19:52:18.112 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:2:0x0003]: Configuring cluster attribute reporting 2023-12-07 19:52:18.112 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:2:0x0003]: finished cluster handler configuration 2023-12-07 19:52:18.112 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:2:0xfcc0]: Performing cluster binding 2023-12-07 19:52:18.113 DEBUG (MainThread) [zigpy.device] [0x0f3a] Extending timeout for 0x81 request 2023-12-07 19:52:18.115 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'63ff21a92a2a49e4c9945a614501936af27e' 2023-12-07 19:52:18.113 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(timestamp=datetime.datetime(2023, 12, 7, 18, 52, 18, 113556, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x0000), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0F3A), dst_ep=0, source_route=None, extended_timeout=True, tsn=129, profile_id=0, cluster_id=, data=Serialized[b'\x81\\V\x90\x00\x10D\xefT\x02\xc0\xfc\x03\xb1\xc9"\xfe\xffn\x02\xbc\x01'], tx_options=, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-12-07 19:52:18.116 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x0F3A:2:0x0006]: Performing cluster binding 2023-12-07 19:52:18.117 DEBUG (MainThread) [zigpy.device] [0x0f3a] Extending timeout for 0x83 request 2023-12-07 19:52:18.117 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(timestamp=datetime.datetime(2023, 12, 7, 18, 52, 18, 117850, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x0000), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0F3A), dst_ep=0, source_route=None, extended_timeout=True, tsn=131, profile_id=0, cluster_id=, data=Serialized[b'\x83\\V\x90\x00\x10D\xefT\x02\x06\x00\x03\xb1\xc9"\xfe\xffn\x02\xbc\x01'], tx_options=, radius=0, non_member_radius=0, lqi=None, rssi=None) 2023-12-07 19:52:18.119 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame received incomingRouteRecordHandler: [0x0f3a, 54:ef:44:10:00:90:56:5c, 136, -66, [0xd217]] 2023-12-07 19:52:18.119 DEBUG (MainThread) [bellows.zigbee.application] Received incomingRouteRecordHandler frame with [0x0f3a, 54:ef:44:10:00:90:56:5c, 136, -66, [0xd217]] 2023-12-07 19:52:18.119 DEBUG (MainThread) [bellows.zigbee.application] Processing route record request: (0x0f3a, 54:ef:44:10:00:90:56:5c, 136, -66, [0xd217]) 2023-12-07 19:52:18.120 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame received incomingMessageHandler: [, EmberApsFrame(profileId=260, clusterId=6, sourceEndpoint=2, destinationEndpoint=1, options=, groupId=0, sequence=27), 124, -69, 0x0f3a, 255, 255, b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02'] 2023-12-07 19:52:18.120 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [, EmberApsFrame(profileId=260, clusterId=6, sourceEndpoint=2, destinationEndpoint=1, options=, groupId=0, sequence=27), 124, -69, 0x0f3a, 255, 255, b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02'] 2023-12-07 19:52:18.120 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2023, 12, 7, 18, 52, 18, 120847, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x0F3A), src_ep=2, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=27, profile_id=260, cluster_id=6, data=Serialized[b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) 2023-12-07 19:52:18.121 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Received ZCL frame: b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02' 2023-12-07 19:52:18.122 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] 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), tsn=243, command_id=10, *direction=) 2023-12-07 19:52:18.124 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Decoded ZCL frame: OnOffCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=Bool, value=)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=50331392))]) 2023-12-07 19:52:18.125 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Received command 0x0A (TSN 243): Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=Bool, value=)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=50331392))]) 2023-12-07 19:52:18.125 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Attribute report received: on_off=, 0x00F5=50331392 2023-12-07 19:52:18.126 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame received incomingRouteRecordHandler: [0x0f3a, 54:ef:44:10:00:90:56:5c, 136, -66, [0xd217]] 2023-12-07 19:52:18.126 DEBUG (MainThread) [bellows.zigbee.application] Received incomingRouteRecordHandler frame with [0x0f3a, 54:ef:44:10:00:90:56:5c, 136, -66, [0xd217]] 2023-12-07 19:52:18.126 DEBUG (MainThread) [bellows.zigbee.application] Processing route record request: (0x0f3a, 54:ef:44:10:00:90:56:5c, 136, -66, [0xd217]) 2023-12-07 19:52:18.127 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame received incomingMessageHandler: [, EmberApsFrame(profileId=260, clusterId=6, sourceEndpoint=2, destinationEndpoint=1, options=, groupId=0, sequence=27), 124, -69, 0x0f3a, 255, 255, b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02'] 2023-12-07 19:52:18.127 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [, EmberApsFrame(profileId=260, clusterId=6, sourceEndpoint=2, destinationEndpoint=1, options=, groupId=0, sequence=27), 124, -69, 0x0f3a, 255, 255, b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02'] 2023-12-07 19:52:18.128 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2023, 12, 7, 18, 52, 18, 128427, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x0F3A), src_ep=2, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=27, profile_id=260, cluster_id=6, data=Serialized[b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02'], tx_options=, radius=0, non_member_radius=0, lqi=124, rssi=-69) 2023-12-07 19:52:18.129 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Received ZCL frame: b'\x18\xf3\n\x00\x00\x10\x00\xf5\x00#\x00\xff\xff\x02' 2023-12-07 19:52:18.130 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] 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), tsn=243, command_id=10, *direction=) 2023-12-07 19:52:18.131 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Decoded ZCL frame: OnOffCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=Bool, value=)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=50331392))]) 2023-12-07 19:52:18.132 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Received command 0x0A (TSN 243): Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=Bool, value=)), Attribute(attrid=0x00F5, value=TypeValue(type=uint32_t, value=50331392))]) 2023-12-07 19:52:18.133 DEBUG (MainThread) [zigpy.zcl] [0x0F3A:2:0x0006] Attribute report received: on_off=, 0x00F5=50331392 2023-12-07 19:52:18.134 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'37ffa1a92a2a60b87e' 2023-12-07 19:52:18.134 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8430fc7e' 2023-12-07 19:52:18.146 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (54:ef:44:10:00:90:56:5c, 1, 0, 5, 'lumi.switch.l2aeu1', datetime.datetime(2023, 12, 7, 18, 52, 16, 639847, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint failed 2023-12-07 19:52:18.146 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame received setExtendedTimeout: [] ``` If you need any more (or different) logs, please let me know. Happy to provide them.

Custom quirk

Not yet available

Additional information

I hope you can help me out figuring out how we can add these functionalities. I am willing to help create/improve the quirk, although I have been unsuccessful thus far. Thank you very much in advance for your help.

TheJulianJES commented 9 months ago

Did you check the "Manage Zigbee device" -> "clusters" dialog? (Three dots on the device page)

bjarnekrottje commented 9 months ago

Hi @TheJulianJES, that's a quick response. I did check it and do see the information available there. For example in this case the Operation Mode can be found here: Example Unfortunately you are not able at the moment to change this through the UI as for example a configuration property on the device page. Or is it because the data can be found in the "clusters" dialog the quirk is working correct, but somewhere else these properties have to be defined to show (and/or be configurable) in the UI? Thanks in advance!

TheJulianJES commented 9 months ago

Unfortunately you are not able at the moment to change this through the UI

You can change it on that page. Change the upper "value" field to 0 or 1 for example. Leave the lower text field empty. Then, press "write attribute". Afterwards, you can press "read attribute" to see if it correctly wrote that value.

But yes, ZHA config entities should be added for these custom attributes. (just not implemented yet)

bjarnekrottje commented 9 months ago

Change the upper "value" field to 0 or 1 for example.

Thank you very much for this tip. I tried entering OppleOperationMode.Coupled or OppleOperationMode.Decoupled and then pressing "write attribute", but that didn't work. Using 0 and 1 did the trick!

But yes, ZHA config entities should be added for these custom attributes. (just not implemented yet)

If that's something I could help with, please let me know. Happy to help and contribute to this, just not sure where to start to achieve this at the moment.

Archomeda commented 9 months ago

Just a quick related question, is the l1aeu1 also supposed to support the same features as the l2aeu1? In HA I only see the changes for my l2aeu1 device, and my l1aeu1 devices have not changed.

Hedda commented 9 months ago

FYI, there is an indirectly inconsistency issue where the Aqara Wall Switch single and double rocker have different device type:

https://github.com/zigpy/zha-device-handlers/discussions/1957

There also seems to be a related bug that prevents users modifying the device type in ZHA without using a custom quirk:

https://github.com/home-assistant/core/issues/101093

joker11940 commented 5 months ago

Change the upper "value" field to 0 or 1 for example.

Thank you very much for this tip. I tried entering OppleOperationMode.Coupled or OppleOperationMode.Decoupled and then pressing "write attribute", but that didn't work. Using 0 and 1 did the trick!

But yes, ZHA config entities should be added for these custom attributes. (just not implemented yet)

If that's something I could help with, please let me know. Happy to help and contribute to this, just not sure where to start to achieve this at the moment.

I have been testing the double rocker no neutral version about the decoupled mode as that was a deal breaker for my use case

Did you find any way to set the switch to be on (rather than off) by default?