zha-device-handlers icon indicating copy to clipboard operation
zha-device-handlers copied to clipboard

Xiaomi H1 Wired Double Rocker Switch With Neutral

Open dumpfheimer opened this issue 3 years ago • 43 comments

Added quirk for Xiaomi H1 double rocker switche with neutral (n2aeu1)

dumpfheimer avatar Feb 22 '22 21:02 dumpfheimer

One more thing, if anyone wants to test this: my working environment is based on the ZCLv7 update from puddly. There might be an issue with OppleCluster.attributes vs OppleCluster.manufacturer_attributes

dumpfheimer avatar Feb 22 '22 21:02 dumpfheimer

Pull Request Test Coverage Report for Build 2956280996

  • 37 of 44 (84.09%) changed or added relevant lines in 2 files are covered.
  • 24 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.2%) to 71.568%

Changes Missing Coverage Covered Lines Changed/Added Lines %
zhaquirks/xiaomi/aqara/opple_switch.py 35 42 83.33%
<!-- Total: 37 44
Files with Coverage Reduction New Missed Lines %
zhaquirks/tuya/ts0210.py 2 84.38%
zhaquirks/xiaomi/aqara/plug_mmeu01.py 10 67.44%
zhaquirks/siglis/zigfred.py 12 65.31%
<!-- Total: 24
Totals Coverage Status
Change from base Build 2933899945: -0.2%
Covered Lines: 5266
Relevant Lines: 7358

💛 - Coveralls

coveralls avatar Feb 22 '22 21:02 coveralls

Codecov Report

Merging #1391 (e7c5401) into dev (1274644) will decrease coverage by 0.17%. The diff coverage is 84.09%.

@@            Coverage Diff             @@
##              dev    #1391      +/-   ##
==========================================
- Coverage   71.74%   71.56%   -0.18%     
==========================================
  Files         237      239       +2     
  Lines        7195     7358     +163     
==========================================
+ Hits         5162     5266     +104     
- Misses       2033     2092      +59     
Impacted Files Coverage Δ
zhaquirks/xiaomi/aqara/opple_switch.py 83.33% <83.33%> (ø)
zhaquirks/xiaomi/__init__.py 76.65% <100.00%> (+0.13%) :arrow_up:
zhaquirks/xiaomi/aqara/plug_mmeu01.py 67.44% <0.00%> (-10.69%) :arrow_down:
zhaquirks/tuya/ts0210.py 84.37% <0.00%> (-4.09%) :arrow_down:
zhaquirks/tuya/ts0601_switch.py 100.00% <0.00%> (ø)
zhaquirks/tuya/ts0601_haozee.py 54.94% <0.00%> (ø)
zhaquirks/siglis/zigfred.py 65.30% <0.00%> (+1.89%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Feb 22 '22 21:02 codecov-commenter

I have several H1 one-button WS-EUK03 lumi.switch.n1aeu1 switches, is there anything I can do to help?

ianfromnyc avatar Mar 03 '22 19:03 ianfromnyc

Hi! Thanks for offering your help!

Could you send me the device descriptor of your switches?

dumpfheimer avatar Mar 06 '22 19:03 dumpfheimer

Hi, I am new to world of HA and ZHA. I bought Aqara WS-EUK04. Temperature and electric doesn't work. So I have found you quirk - now I am stuck with this:

2022-05-02 17:19:16 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='lumi.switch.n2aeu1' manuf='LUMI' nwk=0x1F3F ieee=54:ef:44:10:00:36:48:53 is_initialized=True>
2022-05-02 17:19:16 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for LUMI lumi.switch.n2aeu1 (54:ef:44:10:00:36:48:53)
2022-05-02 17:19:16 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'opple_switch.XiaomiOpple2ButtonSwitch'>
2022-05-02 17:19:16 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1, 2, 41, 42, 242, 51, 21, 31} {1, 2, 242}
2022-05-02 17:19:16 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'opple_switch.XiaomiOpple3ButtonSwitch'>
2022-05-02 17:19:16 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1, 2, 3, 41, 42, 43, 242, 51, 52, 21, 53, 61, 31} {1, 2, 242}

Any advice?

BlastyCZ avatar May 02 '22 15:05 BlastyCZ

It seems like Xiaomi devices change their type when they are re-joined. Maybe try removing and re-joining the device a few times and check if the entities that are discovered change.

Mine for example only have the electric measurements every other time. Also sometimes they are switches sometimes lights I believe.

dumpfheimer avatar May 02 '22 15:05 dumpfheimer

No luck - logs shows the same error, so I am trying to provide some useful info.

"data": {
    "ieee": "**REDACTED**",
    "nwk": 2824,
    "manufacturer": "LUMI",
    "model": "lumi.switch.n2aeu1",
    "name": "LUMI lumi.switch.n2aeu1",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4447,
    "power_source": "Mains",
    "lqi": 100,
    "rssi": -75,
    "last_seen": "2022-05-02T18:23:49",
    "available": true,
    "device_type": "Router",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *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": 260,
          "device_type": "0x0100",
          "in_clusters": [
            "0x0000",
            "0x0002",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0009",
            "0x0702",
            "0x0b04"
          ],
          "out_clusters": [
            "0x000a",
            "0x0019"
          ]
        },
        "2": {
          "profile_id": 260,
          "device_type": "0x0100",
          "in_clusters": [
            "0x0000",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0012",
            "0xfcc0"
          ],
          "out_clusters": []
        },
        "242": {
          "profile_id": 41440,
          "device_type": "0x0061",
          "in_clusters": [],
          "out_clusters": [
            "0x0021"
          ]
        }
      }
    }

BlastyCZ avatar May 02 '22 16:05 BlastyCZ

You alwas get the same 3 clusters? Does it make a difference if you reset it on the device or click "remove device" on the device page?

dumpfheimer avatar May 02 '22 16:05 dumpfheimer

If clusters means keys in endpoints ("1", "2", "242") - yes they are always the same

BlastyCZ avatar May 02 '22 16:05 BlastyCZ

Yes, sorry, that is what I meant. Do you have debugging turned on for zigpy? My best guess is that some of the endpoints somewhere get lost because they do not get matched or so. Maybe there ist just a slight difference in the actual device descriptor. Also what software versions are you using?

dumpfheimer avatar May 02 '22 17:05 dumpfheimer

Debugging turned on - unfortunately I dont know what should I look for....

2022-05-02 20:32:39 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (54:ef:44:10:00:36:48:53, 1, 0, 4, 'LUMI') params: FOREIGN KEY constraint failed

I can provide full log if you want.

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.4.7",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Prague",
    "os_name": "Linux",
    "os_version": "5.10.108",
    "supervisor": "2022.04.0",
    "host_os": "Home Assistant OS 7.6",
    "docker_version": "20.10.9",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {},
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "requirements": [
      "bellows==0.29.0",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.72",
      "zigpy-deconz==0.14.0",
      "zigpy==0.44.2",
      "zigpy-xbee==0.14.0",
      "zigpy-zigate==0.7.4",
      "zigpy-znp==0.7.0"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga"
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      }
    ],
    "after_dependencies": [
      "usb",
      "zeroconf"
    ],
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 2824,
    "manufacturer": "LUMI",
    "model": "lumi.switch.n2aeu1",
    "name": "LUMI lumi.switch.n2aeu1",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4447,
    "power_source": "Mains",
    "lqi": 100,
    "rssi": -75,
    "last_seen": "2022-05-02T18:23:49",
    "available": true,
    "device_type": "Router",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *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": 260,
          "device_type": "0x0100",
          "in_clusters": [
            "0x0000",
            "0x0002",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0009",
            "0x0702",
            "0x0b04"
          ],
          "out_clusters": [
            "0x000a",
            "0x0019"
          ]
        },
        "2": {
          "profile_id": 260,
          "device_type": "0x0100",
          "in_clusters": [
            "0x0000",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0012",
            "0xfcc0"
          ],
          "out_clusters": []
        },
        "242": {
          "profile_id": 41440,
          "device_type": "0x0061",
          "in_clusters": [],
          "out_clusters": [
            "0x0021"
          ]
        }
      }
    },
    "entities": [
      {
        "entity_id": "sensor.lumi_lumi_switch_n2aeu1_53483600_electrical_measurement",
        "name": "LUMI lumi.switch.n2aeu1"
      },
      {
        "entity_id": "sensor.lumi_lumi_switch_n2aeu1_53483600_smartenergy_metering_summation_delivered",
        "name": "LUMI lumi.switch.n2aeu1"
      },
      {
        "entity_id": "sensor.lumi_lumi_switch_n2aeu1_53483600_device_temperature",
        "name": "LUMI lumi.switch.n2aeu1"
      },
      {
        "entity_id": "button.lumi_lumi_switch_n2aeu1_53483600_identify",
        "name": "LUMI lumi.switch.n2aeu1"
      },
      {
        "entity_id": "light.lumi_lumi_switch_n2aeu1_53483600_on_off",
        "name": "LUMI lumi.switch.n2aeu1"
      },
      {
        "entity_id": "light.lumi_lumi_switch_n2aeu1_53483600_on_off_2",
        "name": "LUMI lumi.switch.n2aeu1"
      }
    ],
    "neighbors": [],
    "endpoint_names": [
      {
        "name": "ON_OFF_LIGHT"
      },
      {
        "name": "ON_OFF_LIGHT"
      },
      {
        "name": "unknown 97 device_type of 0xa1e0 profile id"
      }
    ],
    "user_given_name": null,
    "device_reg_id": "5b25e9c57b587746227f68578ef537ff",
    "area_id": "obyvak"
  }
}

BlastyCZ avatar May 02 '22 18:05 BlastyCZ

Here are the logs from my n1aeu1 (the one button version of the same switch):

Device signature:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *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": 260,
      "device_type": "0x0100",
      "in_clusters": [
        "0x0000",
        "0x0002",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0009",
        "0x0702",
        "0x0b04"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "242": {
      "profile_id": 41440,
      "device_type": "0x0061",
      "in_clusters": [],
      "out_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.switch.n1aeu1",
  "class": "zigpy.device.Device"
}

lumi.switch.n1aeu1 pairing log.txt

New device 0xf149 (54:ef:44:10:00:36:76:07) joined the network
[0xf149] Scheduling initialization
Received frame on uninitialized device <Device model=None manuf=None nwk=0xF149 ieee=54:ef:44:10:00:36:76:07 is_initialized=False> from ep 0 to ep 0, cluster 19: b'\xd3I\xf1\x07v6\x00\x10D\xefT\x8e'
[0xf149:zdo] ZDO request ZDOCmd.Device_annce: [0xF149, 54:ef:44:10:00:36:76:07, 142]
Tries remaining: 3
[0xf149] Requesting 'Node Descriptor'
Tries remaining: 2
[0xf149] Extending timeout for 0x4f request
Received frame on uninitialized device <Device model=None manuf=None nwk=0xF149 ieee=54:ef:44:10:00:36:76:07 is_initialized=False> from ep 0 to ep 0, cluster 32770: b'O\x00I\xf1\x01@\x8e_\x11\x7fd\x00\x00,d\x00\x00'
[0xf149] Got Node Descriptor: NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *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)
[0xf149] Discovering endpoints
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xF149 ieee=54:ef:44:10:00:36:76:07 is_initialized=False> from ep 0 to ep 0, cluster 32773: b'Q\x00I\xf1\x02\x01\xf2'
[0xf149] Discovered endpoints: [1, 242]
[0xf149] Initializing endpoints [<Endpoint id=1 in=[] out=[] status=<Status.NEW: 0>>, <Endpoint id=242 in=[] out=[] status=<Status.NEW: 0>>]
[0xf149:1] Discovering endpoint information
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xF149 ieee=54:ef:44:10:00:36:76:07 is_initialized=False> from ep 0 to ep 0, cluster 32772: b'S\x00I\xf1\x1e\x01\x04\x01\x00\x01\x01\t\x00\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\t\x00\x02\x07\x04\x0b\x02\n\x00\x19\x00'
[0xf149:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=256, device_version=1, input_clusters=[0, 2, 3, 4, 5, 6, 9, 1794, 2820], output_clusters=[10, 25])
[0xf149:242] Discovering endpoint information
Tries remaining: 3
Received frame on uninitialized device <Device model=None manuf=None nwk=0xF149 ieee=54:ef:44:10:00:36:76:07 is_initialized=False> from ep 0 to ep 0, cluster 32772: b'U\x00I\xf1\n\xf2\xe0\xa1a\x00\x00\x00\x01!\x00'
[0xf149:242] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=242, profile=41440, device_type=97, device_version=0, input_clusters=[], output_clusters=[33])
[0xF149:1:0x0000] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=87, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0000] Sending request: Read_Attributes(attribute_ids=[4, 5])
[0xF149:1:0x0000] Received ZCL frame: b'\x18W\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.n1aeu1'
[0xF149:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=87, command_id=1, *is_reply=True)
[0xF149:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='LUMI')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='lumi.switch.n1aeu1'))])
[0xf149] Read model 'lumi.switch.n1aeu1' and manufacturer 'LUMI' from <Endpoint id=1 in=[basic:0x0000, device_temperature:0x0002, identify:0x0003, groups:0x0004, scenes:0x0005, on_off:0x0006, alarms:0x0009, smartenergy_metering:0x0702, electrical_measurement:0x0B04] out=[time:0x000A, ota:0x0019] status=<Status.ZDO_INIT: 1>>
[0xf149] Discovered basic device information for <Device model='lumi.switch.n1aeu1' manuf='LUMI' nwk=0xF149 ieee=54:ef:44:10:00:36:76:07 is_initialized=True>
Device is initialized <Device model='lumi.switch.n1aeu1' manuf='LUMI' nwk=0xF149 ieee=54:ef:44:10:00:36:76:07 is_initialized=True>
Checking quirks for LUMI lumi.switch.n1aeu1 (54:ef:44:10:00:36:76:07)
Considering <class 'opple_switch.AqaraH1SingleBtn'>
Fail because input cluster mismatch on at least one endpoint
Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
Fail because endpoint list mismatch: {232, 230} {1, 242}
Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
Fail because endpoint list mismatch: {232, 230} {1, 242}
Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
Fail because endpoint list mismatch: {1} {1, 242}
Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
Fail because endpoint list mismatch: {1} {1, 242}
Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
Fail because endpoint list mismatch: {1} {1, 242}
Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
Fail because endpoint list mismatch: {11, 13} {1, 242}
Considering <class 'bellows.zigbee.application.EZSPCoordinator'>
Fail because endpoint list mismatch: {1} {1, 242}
'button' component -> 'ZHAIdentifyButton' using ['identify']
'sensor' component -> 'ElectricalMeasurement' using ['electrical_measurement']
'sensor' component -> 'ElectricalMeasurementApparentPower' using ['electrical_measurement']
'sensor' component -> 'ElectricalMeasurementRMSCurrent' using ['electrical_measurement']
'sensor' component -> 'ElectricalMeasurementRMSVoltage' using ['electrical_measurement']
'sensor' component -> 'SmartEnergyMetering' using ['smartenergy_metering']
'sensor' component -> 'SmartEnergySummation' using ['smartenergy_metering']
'sensor' component -> 'DeviceTemperature' using ['device_temperature']
'sensor' component -> 'RSSISensor' using ['basic']
'sensor' component -> 'LQISensor' using ['basic']
device - 0xF149:54:ef:44:10:00:36:76:07 entering async_device_initialized - is_new_join: True
device - 0xF149:54:ef:44:10:00:36:76:07 has joined the ZHA zigbee network
[0xF149](lumi.switch.n1aeu1): started configuration
[0xF149:ZDO](lumi.switch.n1aeu1): 'async_configure' stage succeeded
[0xF149:1:0x0000]: finished channel configuration
[0xF149:1:0x0003]: finished channel configuration
Error handling '_save_attribute' event with (54:ef:44:10:00:36:76:07, 1, 0, 4, 'LUMI') params: FOREIGN KEY constraint failed
Error handling '_save_attribute' event with (54:ef:44:10:00:36:76:07, 1, 0, 5, 'lumi.switch.n1aeu1') params: FOREIGN KEY constraint failed
[0xF149:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0xF149:1:0x0006] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=95, command_id=<GeneralCommand.Configure_Reporting: 6>, *is_reply=False)
[0xF149:1:0x0006] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x0000, datatype=16, min_interval=0, max_interval=900, reportable_change=1)])
[0xF149:1:0x0002]: bound 'device_temperature' cluster: Status.SUCCESS
[0xF149:1:0x0002] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=97, command_id=<GeneralCommand.Configure_Reporting: 6>, *is_reply=False)
[0xF149:1:0x0002] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x0000, datatype=41, min_interval=30, max_interval=900, reportable_change=50)])
[0xF149:1:0x0b04]: bound 'electrical_measurement' cluster: Status.SUCCESS
[0xF149:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=99, command_id=<GeneralCommand.Configure_Reporting: 6>, *is_reply=False)
[0xF149:1:0x0b04] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x050B, datatype=41, min_interval=5, max_interval=900, reportable_change=1), AttributeReportingConfig(direction=0, attrid=0x050D, datatype=41, min_interval=30, max_interval=900, reportable_change=1), AttributeReportingConfig(direction=0, attrid=0x050F, datatype=33, min_interval=5, max_interval=900, reportable_change=1)])
[0xF149:1:0x0006] Received ZCL frame: b'\x18_\x07\x00'
[0xF149:1:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=95, command_id=7, *is_reply=True)
[0xF149:1:0x0006] Decoded ZCL frame: OnOff:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=0)])
[0xF149:1:0x0006]: Successfully configured reporting for '{'on_off': (0, 900, 1)}' on 'on_off' cluster: [ConfigureReportingResponseRecord(status=0)]
[0xF149:1:0x0006]: finished channel configuration
[0xF149:1:0x0002] Received ZCL frame: b'\x18a\x07\x8c\x00\x00\x00'
[0xF149:1:0x0002] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=97, command_id=7, *is_reply=True)
[0xF149:1:0x0002] Decoded ZCL frame: DeviceTemperature:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=140, direction=0, attrid=0)])
[0xF149:1:0x0002]: Successfully configured reporting for 'set()' on 'device_temperature' cluster
[0xF149:1:0x0002]: Failed to configure reporting for '['current_temperature']' on 'device_temperature' cluster: [ConfigureReportingResponseRecord(status=140, direction=0, attrid=0)]
[0xF149:1:0x0002]: finished channel configuration
[0xF149:1:0x0019]: finished channel configuration
[0xF149:1:0x0b04] Received ZCL frame: b'\x18c\x07\x8c\x00\x0b\x05\x86\x00\r\x05\x86\x00\x84\x03'
[0xF149:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=99, command_id=7, *is_reply=True)
[0xF149:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=140, direction=0, attrid=1291), ConfigureReportingResponseRecord(status=134, direction=0, attrid=1293), ConfigureReportingResponseRecord(status=134, direction=0, attrid=900)])
[0xF149:1:0x0b04]: Successfully configured reporting for '{'apparent_power'}' on 'electrical_measurement' cluster
[0xF149:1:0x0b04]: Failed to configure reporting for '['active_power', 'active_power_max', 900]' on 'electrical_measurement' cluster: [ConfigureReportingResponseRecord(status=140, direction=0, attrid=1291), ConfigureReportingResponseRecord(status=134, direction=0, attrid=1293), ConfigureReportingResponseRecord(status=134, direction=0, attrid=900)]
[0xF149:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=103, command_id=<GeneralCommand.Configure_Reporting: 6>, *is_reply=False)
[0xF149:1:0x0b04] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x0508, datatype=33, min_interval=5, max_interval=900, reportable_change=1), AttributeReportingConfig(direction=0, attrid=0x050A, datatype=33, min_interval=30, max_interval=900, reportable_change=1), AttributeReportingConfig(direction=0, attrid=0x0505, datatype=33, min_interval=5, max_interval=900, reportable_change=1)])
[0xF149:1:0x0702]: bound 'smartenergy_metering' cluster: Status.SUCCESS
[0xF149:1:0x0702] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=105, command_id=<GeneralCommand.Configure_Reporting: 6>, *is_reply=False)
[0xF149:1:0x0702] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x0400, datatype=42, min_interval=5, max_interval=900, reportable_change=1), AttributeReportingConfig(direction=0, attrid=0x0000, datatype=37, min_interval=30, max_interval=900, reportable_change=1), AttributeReportingConfig(direction=0, attrid=0x0200, datatype=24, min_interval=1, max_interval=900, reportable_change=1)])
[0xF149:1:0x0b04] Received ZCL frame: b'\x18g\x07\x86\x00\x08\x05\x86\x00\x84\x03\x86\x00\n\x05'
[0xF149:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=103, command_id=7, *is_reply=True)
[0xF149:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=134, direction=0, attrid=1288), ConfigureReportingResponseRecord(status=134, direction=0, attrid=900), ConfigureReportingResponseRecord(status=134, direction=0, attrid=1290)])
[0xF149:1:0x0b04]: Successfully configured reporting for '{'rms_voltage'}' on 'electrical_measurement' cluster
[0xF149:1:0x0b04]: Failed to configure reporting for '['rms_current', 900, 'rms_current_max']' on 'electrical_measurement' cluster: [ConfigureReportingResponseRecord(status=134, direction=0, attrid=1288), ConfigureReportingResponseRecord(status=134, direction=0, attrid=900), ConfigureReportingResponseRecord(status=134, direction=0, attrid=1290)]
[0xF149:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=107, command_id=<GeneralCommand.Configure_Reporting: 6>, *is_reply=False)
[0xF149:1:0x0b04] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x0507, datatype=33, min_interval=30, max_interval=900, reportable_change=1)])
[0xF149:1:0x0702] Received ZCL frame: b'\x18i\x07\x86\x00\x00\x04\x86\x00\x84\x03\x8d\x00\x00\x00'
[0xF149:1:0x0702] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=105, command_id=7, *is_reply=True)
[0xF149:1:0x0702] Decoded ZCL frame: Metering:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=134, direction=0, attrid=1024), ConfigureReportingResponseRecord(status=134, direction=0, attrid=900), ConfigureReportingResponseRecord(status=141, direction=0, attrid=0)])
[0xF149:1:0x0702]: Successfully configured reporting for '{'status'}' on 'smartenergy_metering' cluster
[0xF149:1:0x0702]: Failed to configure reporting for '['instantaneous_demand', 900, 'current_summ_delivered']' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=134, direction=0, attrid=1024), ConfigureReportingResponseRecord(status=134, direction=0, attrid=900), ConfigureReportingResponseRecord(status=141, direction=0, attrid=0)]
[0xF149:1:0x0702]: finished channel configuration
[0xF149:1:0x0b04] Received ZCL frame: b'\x18k\x07\x86\x00\x07\x05'
[0xF149:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=107, command_id=7, *is_reply=True)
[0xF149:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=134, direction=0, attrid=1287)])
[0xF149:1:0x0b04]: Successfully configured reporting for 'set()' on 'electrical_measurement' cluster
[0xF149:1:0x0b04]: Failed to configure reporting for '['rms_voltage_max']' on 'electrical_measurement' cluster: [ConfigureReportingResponseRecord(status=134, direction=0, attrid=1287)]
[0xF149:1:0x0b04]: finished channel configuration
[0xF149:1:0x0006]: 'async_configure' stage succeeded
[0xF149:1:0x0000]: 'async_configure' stage succeeded
[0xF149:1:0x0003]: 'async_configure' stage succeeded
[0xF149:1:0x0002]: 'async_configure' stage succeeded
[0xF149:1:0x0b04]: 'async_configure' stage succeeded
[0xF149:1:0x0702]: 'async_configure' stage succeeded
[0xF149:1:0x0019]: 'async_configure' stage succeeded
[0xF149](lumi.switch.n1aeu1): completed configuration
[0xF149](lumi.switch.n1aeu1): stored in registry: ZhaDeviceEntry(name='LUMI lumi.switch.n1aeu1', ieee='54:ef:44:10:00:36:76:07', last_seen=1651519298.2280474)
[0xF149:1:0x0003] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=109, command_id=64, *is_reply=False)
[0xF149:1:0x0003] Sending request: trigger_effect(effect_id=<EffectIdentifier.Okay: 2>, effect_variant=<EffectVariant.Default: 0>)
[0xF149:1:0x0003] Received ZCL frame: b'\x18m\x0b@\x81'
[0xF149:1:0x0003] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=109, command_id=11, *is_reply=True)
[0xF149:1:0x0003] Decoded ZCL frame: Identify:Default_Response(command_id=64, status=<Status.UNSUP_CLUSTER_COMMAND: 129>)
[0xF149:1:0x0003]: executed 'trigger_effect' command with args: '(2, 0)' kwargs: '{}' result: Default_Response(command_id=64, status=<Status.UNSUP_CLUSTER_COMMAND: 129>)
[0xF149](lumi.switch.n1aeu1): started initialization
[0xF149:ZDO](lumi.switch.n1aeu1): 'async_initialize' stage succeeded
[0xF149:1:0x0006]: initializing channel: from_cache: False
[0xF149:1:0x0006] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=111, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0006] Sending request: Read_Attributes(attribute_ids=[0])
[0xF149:1:0x0000]: initializing channel: from_cache: False
[0xF149:1:0x0000]: finished channel initialization
[0xF149:1:0x0003]: initializing channel: from_cache: False
[0xF149:1:0x0003]: finished channel initialization
[0xF149:1:0x0002]: initializing channel: from_cache: False
[0xF149:1:0x0002] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=113, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0002] Sending request: Read_Attributes(attribute_ids=[0])
[0xF149:1:0x0b04]: initializing channel: from_cache: False
[0xF149:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=115, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1539, 1538, 1541, 1540, 1537, 1536, 0, 1027, 1026])
[0xF149:1:0x0006] Received ZCL frame: b'\x18o\x01\x00\x00\x00\x10\x00'
[0xF149:1:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=111, command_id=1, *is_reply=True)
[0xF149:1:0x0006] Decoded ZCL frame: OnOff:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0000, status=<Status.SUCCESS: 0>, value=TypeValue(type=Bool, value=<Bool.false: 0>))])
[0xF149:1:0x0006]: finished channel initialization
[0xF149:1:0x0702]: initializing channel: from_cache: False
[0xF149:1:0x0702] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=117, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0702] Sending request: Read_Attributes(attribute_ids=[772, 770, 774, 769, 771, 768])
[0xF149:1:0x0002] Received ZCL frame: b'\x18q\x01\x00\x00\x00)%\x00'
[0xF149:1:0x0002] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=113, command_id=1, *is_reply=True)
[0xF149:1:0x0002] Decoded ZCL frame: DeviceTemperature:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0000, status=<Status.SUCCESS: 0>, value=TypeValue(type=int16s, value=37))])
[0xF149:1:0x0002]: finished channel initialization
[0xF149:1:0x0019]: initializing channel: from_cache: False
[0xF149:1:0x0019]: finished channel initialization
[0xF149:1:0x0b04] Received ZCL frame: b'\x18s\x01\x03\x06\x86\x02\x06\x86\x05\x06\x00!\n\x00\x04\x06\x00!\x01\x00\x01\x06\x86\x00\x06\x86\x00\x00\x00\x1b\x08\x00\x00\x00\x03\x04\x86\x02\x04\x86'
[0xF149:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=115, command_id=1, *is_reply=True)
[0xF149:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0603, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0602, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0605, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint16_t, value=10)), ReadAttributeRecord(attrid=0x0604, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint16_t, value=1)), ReadAttributeRecord(attrid=0x0601, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0600, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0000, status=<Status.SUCCESS: 0>, value=TypeValue(type=bitmap32, value=<bitmap32.8: 8>)), ReadAttributeRecord(attrid=0x0403, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0402, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>)])
[0xF149:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=119, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291, 1293, 1295, 1288, 1290, 1285, 1287])
[0xF149:1:0x0702] Received ZCL frame: b'\x18u\x01\x04\x03\x00\x18\x00\x02\x03\x00"\xe8\x03\x00\x06\x03\x00\x18\x00\x01\x03\x00"\x01\x00\x00\x03\x03\x00\x18#\x00\x03\x000\x00'
[0xF149:1:0x0702] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=117, command_id=1, *is_reply=True)
[0xF149:1:0x0702] Decoded ZCL frame: Metering:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0304, status=<Status.SUCCESS: 0>, value=TypeValue(type=bitmap8, value=<bitmap8.0: 0>)), ReadAttributeRecord(attrid=0x0302, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint24_t, value=1000)), ReadAttributeRecord(attrid=0x0306, status=<Status.SUCCESS: 0>, value=TypeValue(type=bitmap8, value=<bitmap8.0: 0>)), ReadAttributeRecord(attrid=0x0301, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint24_t, value=1)), ReadAttributeRecord(attrid=0x0303, status=<Status.SUCCESS: 0>, value=TypeValue(type=bitmap8, value=<bitmap8.32|2|1: 35>)), ReadAttributeRecord(attrid=0x0300, status=<Status.SUCCESS: 0>, value=TypeValue(type=enum8, value=<enum8.undefined_0x00: 0>))])
[0xF149:1:0x0702] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=121, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0702] Sending request: Read_Attributes(attribute_ids=[1024, 0, 512])
[0xF149:1:0x0b04] Received ZCL frame: b'\x18w\x01\x0b\x05\x00)\x00\x00\r\x05\x86\x0f\x05\x86\x08\x05\x86\n\x05\x86\x05\x05\x86\x07\x05\x86'
[0xF149:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=119, command_id=1, *is_reply=True)
[0xF149:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x050B, status=<Status.SUCCESS: 0>, value=TypeValue(type=int16s, value=0)), ReadAttributeRecord(attrid=0x050D, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x050F, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0508, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x050A, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0505, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0507, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>)])
[0xF149:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=123, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291, 1293, 1295, 1288, 1290, 1285, 1287])
[0xF149:1:0x0702] Received ZCL frame: b'\x18y\x01\x00\x04\x86\x00\x00\x00%\x00\x00\x00\x00\x00\x00\x00\x02\x00\x18\x00'
[0xF149:1:0x0702] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=121, command_id=1, *is_reply=True)
[0xF149:1:0x0702] Decoded ZCL frame: Metering:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0400, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0000, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint48_t, value=0)), ReadAttributeRecord(attrid=0x0200, status=<Status.SUCCESS: 0>, value=TypeValue(type=bitmap8, value=<bitmap8.0: 0>))])
[0xF149:1:0x0702]: finished channel initialization
[0xF149:1:0x0b04] Received ZCL frame: b'\x18{\x01\x0b\x05\x00)\x00\x00\r\x05\x86\x0f\x05\x86\x08\x05\x86\n\x05\x86\x05\x05\x86\x07\x05\x86'
[0xF149:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=123, command_id=1, *is_reply=True)
[0xF149:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x050B, status=<Status.SUCCESS: 0>, value=TypeValue(type=int16s, value=0)), ReadAttributeRecord(attrid=0x050D, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x050F, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0508, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x050A, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0505, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>), ReadAttributeRecord(attrid=0x0507, status=<Status.UNSUPPORTED_ATTRIBUTE: 134>)])
[0xF149:1:0x0b04]: finished channel initialization
[0xF149:1:0x0006]: 'async_initialize' stage succeeded
[0xF149:1:0x0000]: 'async_initialize' stage succeeded
[0xF149:1:0x0003]: 'async_initialize' stage succeeded
[0xF149:1:0x0002]: 'async_initialize' stage succeeded
[0xF149:1:0x0b04]: 'async_initialize' stage succeeded
[0xF149:1:0x0702]: 'async_initialize' stage succeeded
[0xF149:1:0x0019]: 'async_initialize' stage succeeded
[0xF149](lumi.switch.n1aeu1): power source: Mains
[0xF149](lumi.switch.n1aeu1): completed initialization
None: polling current state
[0xF149:1:0x0006] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=125, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0006] Sending request: Read_Attributes(attribute_ids=[0])
[0xF149:1:0x0006] Received ZCL frame: b'\x18}\x01\x00\x00\x00\x10\x00'
[0xF149:1:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=125, command_id=1, *is_reply=True)
[0xF149:1:0x0006] Decoded ZCL frame: OnOff:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0000, status=<Status.SUCCESS: 0>, value=TypeValue(type=Bool, value=<Bool.false: 0>))])
[0x0A58:1:0x0b04]: async_update
[0x0A58:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=127, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0x0A58:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291])
[0x70F9:1:0x0b04]: async_update
[0x70F9:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=129, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0x70F9:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291])
[0x20D3:1:0x0b04]: async_update
[0x20D3:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=131, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0x20D3:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291])
[0xF149:1:0x0b04]: async_update
[0xF149:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=133, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
[0xF149:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291])
[0x0A58:1:0x0b04] Received ZCL frame: b'\x18\x7f\x01\x0b\x05\x00)\xba\x00'
[0x0A58:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=127, command_id=1, *is_reply=True)
[0x0A58:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x050B, status=<Status.SUCCESS: 0>, value=TypeValue(type=int16s, value=186))])
[0x20D3:1:0x0b04] Received ZCL frame: b'\x18\x83\x01\x0b\x05\x00)\x00\x00'
[0x20D3:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=131, command_id=1, *is_reply=True)
[0x20D3:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x050B, status=<Status.SUCCESS: 0>, value=TypeValue(type=int16s, value=0))])
[0x70F9:1:0x0b04] Received ZCL frame: b'\x18\x81\x01\x0b\x05\x00)\r\x00'
[0x70F9:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=129, command_id=1, *is_reply=True)
[0x70F9:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x050B, status=<Status.SUCCESS: 0>, value=TypeValue(type=int16s, value=13))])
[0xf149:zdo] ZDO request ZDOCmd.Match_Desc_req: [0xFFFD, 260, [25], []]
[0xF149:1:0x0b04]: failed to get attributes '['active_power']' on 'electrical_measurement' cluster: 
[0xf149:zdo] ZDO request ZDOCmd.IEEE_addr_req: [0x0000, 0, 0]
[0xF149:1:0x0019] Received ZCL frame: b'\x01\xec\x01\x00_\x11\x1c\x15\x16\x0b\x00\x00'
[0xF149:1:0x0019] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=236, command_id=1, *is_reply=False)
[0xF149:1:0x0019] Decoded ZCL frame: Ota:query_next_image(field_control=0, manufacturer_code=4447, image_type=5404, current_file_version=2838, hardware_version=None)
[0xF149:1:0x0019] Received command 0x01 (TSN 236): query_next_image(field_control=0, manufacturer_code=4447, image_type=5404, current_file_version=2838, hardware_version=None)
[0xF149:1:0x0019] OTA query_next_image handler for 'LUMI lumi.switch.n1aeu1': field_control=0, manufacture_id=4447, image_type=5404, current_file_version=2838, hardware_version=None, model=lumi.switch.n1aeu1
[0xF149:1:0x0019] No OTA image is available
[0xF149:1:0x0019] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=False, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=True, *is_general=False), tsn=236, command_id=2, *is_reply=True)
[0xF149:1:0x0019] Sending reply: query_next_image_response(status=<Status.NO_IMAGE_AVAILABLE: 152>, manufacturer_code=None, image_type=None, file_version=None, image_size=None)

config_entry-zha-ae2ff7273e2c33dc8e1309fc9adb9a93.json.txt

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.4.7",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/London",
    "os_name": "Linux",
    "os_version": "5.10.103-v8",
    "supervisor": "2022.04.0",
    "host_os": "Home Assistant OS 7.6",
    "docker_version": "20.10.9",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
*REDACTED*
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "requirements": [
      "bellows==0.29.0",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.72",
      "zigpy-deconz==0.14.0",
      "zigpy==0.44.2",
      "zigpy-xbee==0.14.0",
      "zigpy-zigate==0.7.4",
      "zigpy-znp==0.7.0"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga"
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      }
    ],
    "after_dependencies": [
      "usb",
      "zeroconf"
    ],
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "is_built_in": true
  },
  "data": {
    "config": {
      "custom_quirks_path": "/config/custom_zha_quirks/",
      "device_config": {},
      "enable_quirks": true
    },
    "config_entry": {
      "entry_id": "ae2ff7273e2c33dc8e1309fc9adb9a93",
      "version": 3,
      "domain": "zha",
      "title": "ConBee II - /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2462398-if00, s/n: DE2462398 - dresden elektronik ingenieurtechnik GmbH - 1CF1:0030",
      "data": {
        "radio_type": "deconz",
        "device": {
          "path": "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2462398-if00"
        }
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "usb",
      "unique_id": "**REDACTED**",
      "disabled_by": null
    },
    "application_state": {
      "node_information": {
        "nwk": 0,
        "ieee": "**REDACTED**",
        "logical_type": 0
      },
      "network_information": {
        "extended_pan_id": "**REDACTED**",
        "pan_id": 62424,
        "nwk_update_id": 1,
        "nwk_manager_id": 65534,
        "channel": 11,
        "channel_mask": 2048,
        "security_level": 3,
        "network_key": "**REDACTED**",
        "tc_link_key": {
          "key": [
            90,
            105,
            103,
            66,
            101,
            101,
            65,
            108,
            108,
            105,
            97,
            110,
            99,
            101,
            48,
            57
          ],
          "tx_counter": 0,
          "rx_counter": 0,
          "seq": 0,
          "partner_ieee": "**REDACTED**"
        },
        "key_table": [],
        "children": [],
        "nwk_addresses": {},
        "stack_specific": {}
      },
      "counters": {},
      "broadcast_counters": {},
      "device_counters": {},
      "group_counters": {}
    },
    "versions": {
      "bellows": "0.29.0",
      "zigpy": "0.44.2",
      "zigpy_deconz": "0.14.0",
      "zigpy_xbee": "0.14.0",
      "zigpy_znp": "0.7.0",
      "zigpy_zigate": "0.7.4",
      "zhaquirks": "0.0.72"
    }
  }
}

ianfromnyc avatar May 02 '22 19:05 ianfromnyc

Two things:

  1. The quirk is only for the 2 button switch. I was unable to get a device descriptor of a one button switch so far.
  2. I see you have the ConBee II and am not sure if this might make a difference.

Could you send the same log for your two button device? I have a bunch of those working so I believe it should be easier to get those started

dumpfheimer avatar May 03 '22 06:05 dumpfheimer

Two things:

  1. The quirk is only for the 2 button switch. I was unable to get a device descriptor of a one button switch so far.
  2. I see you have the ConBee II and am not sure if this might make a difference.

Could you send the same log for your two button device? I have a bunch of those working so I believe it should be easier to get those started

How do I get the device descriptor?

ianfromnyc avatar May 03 '22 10:05 ianfromnyc

It is in the logs. If you send me the same log you sent for the 1 button join but for the two button switch it should be in thete

dumpfheimer avatar May 03 '22 18:05 dumpfheimer

It is in the logs. If you send me the same log you sent for the 1 button join but for the two button switch it should be in thete

Oh sorry, I thought you were saying you still needed one for the 1 button.

ianfromnyc avatar May 03 '22 18:05 ianfromnyc

I have no idea if device descriptor is in there

2022-05-03 16:05:00 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=0, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=19), 152, -62, 0x811c, 255, 255, b'\x18\x13\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.n2aeu1']
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0000] Received ZCL frame: b'\x18\x13\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.n2aeu1'
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='LUMI')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='lumi.switch.n2aeu1'))])
2022-05-03 16:05:00 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=0, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=20), 116, -71, 0x811c, 255, 255, b'\x18\x15\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.n2aeu1']
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0000] Received ZCL frame: b'\x18\x15\x01\x04\x00\x00B\x04LUMI\x05\x00\x00B\x12lumi.switch.n2aeu1'
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='LUMI')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='lumi.switch.n2aeu1'))])
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.zcl","message":["[0x811C:1:0x0000] Received ZCL frame: b'\\x18\\x13\\x01\\x04\\x00\\x00B\\x04LUMI\\x05\\x00\\x00B\\x12lumi.switch.n2aeu1'"],"level":"DEBUG","source":["/usr/local/lib/python3.9/site-packages/zigpy/zcl/__init__.py",217],"timestamp":1651586700.562102,"exception":"","count":1,"first_occurred":1651586700.562102}}}
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.zcl","message":["[0x811C:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='LUMI')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='lumi.switch.n2aeu1'))])"],"level":"DEBUG","source":["/usr/local/lib/python3.9/site-packages/zigpy/zcl/__init__.py",245],"timestamp":1651586700.5645945,"exception":"","count":1,"first_occurred":1651586700.5645945}}}
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.zcl","message":["[0x811C:1:0x0000] Received ZCL frame: b'\\x18\\x15\\x01\\x04\\x00\\x00B\\x04LUMI\\x05\\x00\\x00B\\x12lumi.switch.n2aeu1'"],"level":"DEBUG","source":["/usr/local/lib/python3.9/site-packages/zigpy/zcl/__init__.py",217],"timestamp":1651586700.5685225,"exception":"","count":1,"first_occurred":1651586700.5685225}}}
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.zcl","message":["[0x811C:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='LUMI')), ReadAttributeRecord(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='lumi.switch.n2aeu1'))])"],"level":"DEBUG","source":["/usr/local/lib/python3.9/site-packages/zigpy/zcl/__init__.py",245],"timestamp":1651586700.5705557,"exception":"","count":1,"first_occurred":1651586700.5705557}}}
2022-05-03 16:05:00 INFO (MainThread) [zigpy.device] [0x811c] Read model 'lumi.switch.n2aeu1' and manufacturer 'LUMI' from <Endpoint id=1 in=[basic:0x0000, device_temperature:0x0002, identify:0x0003, groups:0x0004, scenes:0x0005, on_off:0x0006, alarms:0x0009, smartenergy_metering:0x0702, electrical_measurement:0x0B04] out=[time:0x000A, ota:0x0019] status=<Status.ZDO_INIT: 1>>
2022-05-03 16:05:00 INFO (MainThread) [zigpy.device] [0x811c] Discovered basic device information for <Device model='lumi.switch.n2aeu1' manuf='LUMI' nwk=0x811C ieee=54:ef:44:10:00:36:48:53 is_initialized=True>
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='lumi.switch.n2aeu1' manuf='LUMI' nwk=0x811C ieee=54:ef:44:10:00:36:48:53 is_initialized=True>
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for LUMI lumi.switch.n2aeu1 (54:ef:44:10:00:36:48:53)
2022-05-03 16:05:00 DEBUG (Thread-4) [aiosqlite] executing functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f551f761d50>, 'INSERT INTO attributes_cache_v7 VALUES (?, ?, ?, ?, ?)\n ON CONFLICT (ieee, endpoint_id, cluster, attrid)\n DO UPDATE SET\n value=excluded.value', (54:ef:44:10:00:36:48:53, 1, 0, 4, 'LUMI'))
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x811C](lumi.switch.n2aeu1): started configuration
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x811C:ZDO](lumi.switch.n2aeu1): 'async_configure' stage succeeded
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.device","message":["[0x811c] Read model 'lumi.switch.n2aeu1' and manufacturer 'LUMI' from <Endpoint id=1 in=[basic:0x0000, device_temperature:0x0002, identify:0x0003, groups:0x0004, scenes:0x0005, on_off:0x0006, alarms:0x0009, smartenergy_metering:0x0702, electrical_measurement:0x0B04] out=[time:0x000A, ota:0x0019] status=<Status.ZDO_INIT: 1>>"],"level":"INFO","source":["/usr/local/lib/python3.9/site-packages/zigpy/device.py",225],"timestamp":1651586700.5776188,"exception":"","count":1,"first_occurred":1651586700.5776188}}}
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.device","message":["[0x811c] Discovered basic device information for <Device model='lumi.switch.n2aeu1' manuf='LUMI' nwk=0x811C ieee=54:ef:44:10:00:36:48:53 is_initialized=True>"],"level":"INFO","source":["/usr/local/lib/python3.9/site-packages/zigpy/device.py",240],"timestamp":1651586700.578121,"exception":"","count":1,"first_occurred":1651586700.578121}}}
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.application","message":["Device is initialized <Device model='lumi.switch.n2aeu1' manuf='LUMI' nwk=0x811C ieee=54:ef:44:10:00:36:48:53 is_initialized=True>"],"level":"DEBUG","source":["/usr/local/lib/python3.9/site-packages/zigpy/application.py",134],"timestamp":1651586700.5784872,"exception":"","count":1,"first_occurred":1651586700.5784872}}}
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"raw_device_initialized","device_info":{"nwk":33052,"ieee":"54:ef:44:10:00:36:48:53","pairing_status":"INTERVIEW_COMPLETE","model":"lumi.switch.n2aeu1","manufacturer":"LUMI","signature":{"manufacturer":"LUMI","model":"lumi.switch.n2aeu1","node_desc":{"logical_type":1,"complex_descriptor_available":0,"user_descriptor_available":0,"reserved":0,"aps_flags":0,"frequency_band":8,"mac_capability_flags":142,"manufacturer_code":4447,"maximum_buffer_size":127,"maximum_incoming_transfer_size":100,"server_mask":11264,"maximum_outgoing_transfer_size":100,"descriptor_capability_field":0},"endpoints":{"1":{"profile_id":260,"device_type":256,"input_clusters":[0,2,3,4,5,6,9,1794,2820],"output_clusters":[10,25]},"2":{"profile_id":260,"device_type":256,"input_clusters":[0,3,4,5,6,18,64704],"output_clusters":[]},"242":{"profile_id":41440,"device_type":97,"input_clusters":[],"output_clusters":[33]}}}}}}
2022-05-03 16:05:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140003618063696] Sending {"id":98,"type":"event","event":{"type":"log_output","log_entry":{"name":"zigpy.quirks.registry","message":["Checking quirks for LUMI lumi.switch.n2aeu1 (54:ef:44:10:00:36:48:53)"],"level":"DEBUG","source":["/usr/local/lib/python3.9/site-packages/zigpy/quirks/registry.py",59],"timestamp":1651586700.579955,"exception":"","count":1,"first_occurred":1651586700.579955}}}
2022-05-03 16:05:00 INFO (MainThread) [zigpy.device] [0x811c] Read model 'lumi.switch.n2aeu1' and manufacturer 'LUMI' from <Endpoint id=1 in=[basic:0x0000, device_temperature:0x0002, identify:0x0003, groups:0x0004, scenes:0x0005, on_off:0x0006, alarms:0x0009, smartenergy_metering:0x0702, electrical_measurement:0x0B04] out=[time:0x000A, ota:0x0019] status=<Status.ZDO_INIT: 1>>
2022-05-03 16:05:00 INFO (MainThread) [zigpy.device] [0x811c] Discovered basic device information for <Device model='lumi.switch.n2aeu1' manuf='LUMI' nwk=0x811C ieee=54:ef:44:10:00:36:48:53 is_initialized=True>
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='lumi.switch.n2aeu1' manuf='LUMI' nwk=0x811C ieee=54:ef:44:10:00:36:48:53 is_initialized=True>
2022-05-03 16:05:00 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for LUMI lumi.switch.n2aeu1 (54:ef:44:10:00:36:48:53)

BlastyCZ avatar May 03 '22 18:05 BlastyCZ

I have no idea why your device looks so differently..

Could you send me a debug log while pressing a few buttons? Maybe I can recognize a pattern

dumpfheimer avatar May 05 '22 18:05 dumpfheimer

Log should include turning on and off one button with few seconds delay

2022-05-07 11:22:11 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'83401b7e'
2022-05-07 11:22:11 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 241 (readCounters) received: b'1d000c001a000a000000000000000000100008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
2022-05-07 11:22:11 DEBUG (MainThread) [bellows.ezsp.protocol] Send command getValue: (<EzspValueId.VALUE_FREE_BUFFERS: 3>,)
2022-05-07 11:22:11 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'7d338a21a9fe2a1694787e'
2022-05-07 11:22:11 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'328aa1a9fe2a15b3abda197e'
2022-05-07 11:22:11 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8430fc7e'
2022-05-07 11:22:11 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 170 (getValue) received: b'0001f2'
2022-05-07 11:22:11 DEBUG (MainThread) [bellows.zigbee.application] Free buffers status EzspStatus.SUCCESS, value: 242
2022-05-07 11:22:11 DEBUG (MainThread) [bellows.zigbee.application] ezsp_counters: [MAC_RX_BROADCAST = 854, MAC_TX_BROADCAST = 516, MAC_RX_UNICAST = 1524, MAC_TX_UNICAST_SUCCESS = 756, MAC_TX_UNICAST_RETRY = 64, MAC_TX_UNICAST_FAILED = 2, APS_DATA_RX_BROADCAST = 7, APS_DATA_TX_BROADCAST = 7, APS_DATA_RX_UNICAST = 437, APS_DATA_TX_UNICAST_SUCCESS = 365, APS_DATA_TX_UNICAST_RETRY = 13, APS_DATA_TX_UNICAST_FAILED = 3, ROUTE_DISCOVERY_INITIATED = 6, NEIGHBOR_ADDED = 2, NEIGHBOR_REMOVED = 0, NEIGHBOR_STALE = 3, JOIN_INDICATION = 0, CHILD_REMOVED = 0, ASH_OVERFLOW_ERROR = 0, ASH_FRAMING_ERROR = 0, ASH_OVERRUN_ERROR = 0, NWK_FRAME_COUNTER_FAILURE = 0, APS_FRAME_COUNTER_FAILURE = 0, UTILITY = 0, APS_LINK_KEY_NOT_AUTHORIZED = 0, NWK_DECRYPTION_FAILURE = 0, APS_DECRYPTION_FAILURE = 0, ALLOCATE_PACKET_BUFFER_FAILURE = 0, RELAYED_UNICAST = 0, PHY_TO_MAC_QUEUE_LIMIT_REACHED = 0, PACKET_VALIDATE_LIBRARY_DROPPED_COUNT = 0, TYPE_NWK_RETRY_OVERFLOW = 0, PHY_CCA_FAIL_COUNT = 0, BROADCAST_TABLE_FULL = 0, PTA_LO_PRI_REQUESTED = 0, PTA_HI_PRI_REQUESTED = 0, PTA_LO_PRI_DENIED = 0, PTA_HI_PRI_DENIED = 0, PTA_LO_PRI_TX_ABORTED = 0, PTA_HI_PRI_TX_ABORTED = 0, ADDRESS_CONFLICT_SENT = 0, EZSP_FREE_BUFFERS = 242]
2022-05-07 11:22:18 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'428ab1a9112a15b658984a30ab5593499c3f5b10f14f9874f1da3c9807746aa7d2cdde6f8ffd72db7e'
2022-05-07 11:22:18 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8520dd7e'
2022-05-07 11:22:18 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 69 (incomingMessageHandler) received: b'0004010c00150100010000717cbb1c81ffff0c1c5f11fb0a5500390000000002'
2022-05-07 11:22:18 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=12, sourceEndpoint=21, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=113), 124, -69, 0x811c, 255, 255, b'\x1c_\x11\xfb\nU\x009\x00\x00\x00\x00']
2022-05-07 11:22:18 DEBUG (MainThread) [zigpy.device] Ignoring message (b'1c5f11fb0a55003900000000') on cluster 12: unknown endpoint or cluster id: 21
2022-05-07 11:22:21 DEBUG (MainThread) [bellows.ezsp.protocol] Send command readCounters: ()
2022-05-07 11:22:21 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'258b21a9a52ab3627e'
2022-05-07 11:22:21 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'538ba1a9a52a0bb254945125a05592499c4e27abedce768bf5c66389fc7e3fa7ebcdde6f8fffc7dbd5d2698c4623a9ec763ba5ea758241984c2613b1e070381c0e07bbe5ca658a459a4d9e4f9ff7c3d9d46a35a25190482486537e'
2022-05-07 11:22:21 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8610be7e'
2022-05-07 11:22:21 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 241 (readCounters) received: b'1e000d001b000a000000000000000000110008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
2022-05-07 11:22:21 DEBUG (MainThread) [bellows.ezsp.protocol] Send command getValue: (<EzspValueId.VALUE_FREE_BUFFERS: 3>,)
2022-05-07 11:22:21 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'368821a9fe2a1608697e'
2022-05-07 11:22:21 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'6488a1a9fe2a15b3ab03107e'
2022-05-07 11:22:21 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'87009f7e'
2022-05-07 11:22:21 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 170 (getValue) received: b'0001f2'
2022-05-07 11:22:21 DEBUG (MainThread) [bellows.zigbee.application] Free buffers status EzspStatus.SUCCESS, value: 242
2022-05-07 11:22:21 DEBUG (MainThread) [bellows.zigbee.application] ezsp_counters: [MAC_RX_BROADCAST = 855, MAC_TX_BROADCAST = 517, MAC_RX_UNICAST = 1525, MAC_TX_UNICAST_SUCCESS = 756, MAC_TX_UNICAST_RETRY = 64, MAC_TX_UNICAST_FAILED = 2, APS_DATA_RX_BROADCAST = 7, APS_DATA_TX_BROADCAST = 7, APS_DATA_RX_UNICAST = 438, APS_DATA_TX_UNICAST_SUCCESS = 365, APS_DATA_TX_UNICAST_RETRY = 13, APS_DATA_TX_UNICAST_FAILED = 3, ROUTE_DISCOVERY_INITIATED = 6, NEIGHBOR_ADDED = 2, NEIGHBOR_REMOVED = 0, NEIGHBOR_STALE = 3, JOIN_INDICATION = 0, CHILD_REMOVED = 0, ASH_OVERFLOW_ERROR = 0, ASH_FRAMING_ERROR = 0, ASH_OVERRUN_ERROR = 0, NWK_FRAME_COUNTER_FAILURE = 0, APS_FRAME_COUNTER_FAILURE = 0, UTILITY = 0, APS_LINK_KEY_NOT_AUTHORIZED = 0, NWK_DECRYPTION_FAILURE = 0, APS_DECRYPTION_FAILURE = 0, ALLOCATE_PACKET_BUFFER_FAILURE = 0, RELAYED_UNICAST = 0, PHY_TO_MAC_QUEUE_LIMIT_REACHED = 0, PACKET_VALIDATE_LIBRARY_DROPPED_COUNT = 0, TYPE_NWK_RETRY_OVERFLOW = 0, PHY_CCA_FAIL_COUNT = 0, BROADCAST_TABLE_FULL = 0, PTA_LO_PRI_REQUESTED = 0, PTA_HI_PRI_REQUESTED = 0, PTA_LO_PRI_DENIED = 0, PTA_HI_PRI_DENIED = 0, PTA_LO_PRI_TX_ABORTED = 0, PTA_HI_PRI_TX_ABORTED = 0, ADDRESS_CONFLICT_SENT = 0, EZSP_FREE_BUFFERS = 242]
2022-05-07 11:22:24 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xBAE4](TS0502A): Device seen - marking the device available and resetting counter
2022-05-07 11:22:24 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xBAE4](TS0502A): Update device availability -  device available: True - new availability: True - changed: False
2022-05-07 11:22:31 DEBUG (MainThread) [bellows.ezsp.protocol] Send command readCounters: ()
2022-05-07 11:22:31 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'478921a9a52a23b97e'
2022-05-07 11:22:31 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'7589a1a9a52a0ab257945125a05592499c4e27abedce768bf5c66389fc7e3fa7ebcdde6f8fffc7dbd5d2698c4623a9ec763ba5ea758241984c2613b1e070381c0e07bbe5ca658a459a4d9e4f9ff7c3d9d46a35a25190482431917e'
2022-05-07 11:22:31 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8070787e'
2022-05-07 11:22:31 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 241 (readCounters) received: b'1f000e001b000a000000000000000000110008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
2022-05-07 11:22:31 DEBUG (MainThread) [bellows.ezsp.protocol] Send command getValue: (<EzspValueId.VALUE_FREE_BUFFERS: 3>,)
2022-05-07 11:22:31 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'508e21a9fe2a1697b77e'
2022-05-07 11:22:31 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'068ea1a9fe2a15b3abbd997e'
2022-05-07 11:22:31 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8160597e'
2022-05-07 11:22:31 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 170 (getValue) received: b'0001f2'
2022-05-07 11:22:31 DEBUG (MainThread) [bellows.zigbee.application] Free buffers status EzspStatus.SUCCESS, value: 242
2022-05-07 11:22:31 DEBUG (MainThread) [bellows.zigbee.application] ezsp_counters: [MAC_RX_BROADCAST = 856, MAC_TX_BROADCAST = 518, MAC_RX_UNICAST = 1525, MAC_TX_UNICAST_SUCCESS = 756, MAC_TX_UNICAST_RETRY = 64, MAC_TX_UNICAST_FAILED = 2, APS_DATA_RX_BROADCAST = 7, APS_DATA_TX_BROADCAST = 7, APS_DATA_RX_UNICAST = 438, APS_DATA_TX_UNICAST_SUCCESS = 365, APS_DATA_TX_UNICAST_RETRY = 13, APS_DATA_TX_UNICAST_FAILED = 3, ROUTE_DISCOVERY_INITIATED = 6, NEIGHBOR_ADDED = 2, NEIGHBOR_REMOVED = 0, NEIGHBOR_STALE = 3, JOIN_INDICATION = 0, CHILD_REMOVED = 0, ASH_OVERFLOW_ERROR = 0, ASH_FRAMING_ERROR = 0, ASH_OVERRUN_ERROR = 0, NWK_FRAME_COUNTER_FAILURE = 0, APS_FRAME_COUNTER_FAILURE = 0, UTILITY = 0, APS_LINK_KEY_NOT_AUTHORIZED = 0, NWK_DECRYPTION_FAILURE = 0, APS_DECRYPTION_FAILURE = 0, ALLOCATE_PACKET_BUFFER_FAILURE = 0, RELAYED_UNICAST = 0, PHY_TO_MAC_QUEUE_LIMIT_REACHED = 0, PACKET_VALIDATE_LIBRARY_DROPPED_COUNT = 0, TYPE_NWK_RETRY_OVERFLOW = 0, PHY_CCA_FAIL_COUNT = 0, BROADCAST_TABLE_FULL = 0, PTA_LO_PRI_REQUESTED = 0, PTA_HI_PRI_REQUESTED = 0, PTA_LO_PRI_DENIED = 0, PTA_HI_PRI_DENIED = 0, PTA_LO_PRI_TX_ABORTED = 0, PTA_HI_PRI_TX_ABORTED = 0, ADDRESS_CONFLICT_SENT = 0, EZSP_FREE_BUFFERS = 242]
2022-05-07 11:22:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x811C:1:0x0b04]: async_update
2022-05-07 11:22:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x811C:1:0x0b04]: Reading attributes in chunks: ['active_power']
2022-05-07 11:22:37 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=222, command_id=<GeneralCommand.Read_Attributes: 0>, *is_reply=False)
2022-05-07 11:22:37 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291])
2022-05-07 11:22:37 DEBUG (MainThread) [bellows.ezsp.protocol] Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x811C, EmberApsFrame(profileId=260, clusterId=2820, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=222), 223, b'\x00\xde\x00\x0b\x05')
2022-05-07 11:22:37 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'618f21a9602a15aed8904b21a15493099d4e277532cb6755fdcd668c4c7e'
2022-05-07 11:22:37 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'178fa1a9602a15b80e927e'
2022-05-07 11:22:37 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'82503a7e'
2022-05-07 11:22:37 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 52 (sendUnicast) received: b'000a'
2022-05-07 11:22:37 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'278fb1a96b2a15aed8904b21a15493099d4e27a132ce67f97d7e'
2022-05-07 11:22:37 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'83401b7e'
2022-05-07 11:22:37 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 63 (messageSentHandler) received: b'001c810401040b0101400100000adf0000'
2022-05-07 11:22:37 DEBUG (MainThread) [bellows.zigbee.application] Received messageSentHandler frame with [<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 33052, EmberApsFrame(profileId=260, clusterId=2820, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=10), 223, <EmberStatus.SUCCESS: 0>, b'']
2022-05-07 11:22:37 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'378fb1a9112a15b658904124ab5593499c3c5b10f14f9874f4debd88f77b3f8eebcddc04037e'
2022-05-07 11:22:37 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8430fc7e'
2022-05-07 11:22:37 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 69 (incomingMessageHandler) received: b'000401040b010100010000727cbb1c81ffff0918de010b050029000002'
2022-05-07 11:22:37 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=2820, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=114), 124, -69, 0x811c, 255, 255, b'\x18\xde\x01\x0b\x05\x00)\x00\x00']
2022-05-07 11:22:37 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0b04] Received ZCL frame: b'\x18\xde\x01\x0b\x05\x00)\x00\x00'
2022-05-07 11:22:37 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, is_reply=1, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=222, command_id=1, *is_reply=True)
2022-05-07 11:22:37 DEBUG (MainThread) [zigpy.zcl] [0x811C:1:0x0b04] Decoded ZCL frame: ElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x050B, status=<Status.SUCCESS: 0>, value=TypeValue(type=int16s, value=0))])
2022-05-07 11:22:41 DEBUG (MainThread) [bellows.ezsp.protocol] Send command readCounters: ()
2022-05-07 11:22:41 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'748c21a9a52ae1827e'
2022-05-07 11:22:41 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'408ca1a9a52a34b257945725a15592499c4e27abedce758bf4c66389fc7e3fa7ebcdde6f8fffc7dbd5d2698c4623a9ec763ba5ea758241984c2613b1e070381c0e07bbe5ca658a459a4d9e4f9ff7c3d9d46a35a251904824cd567e'
2022-05-07 11:22:41 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8520dd7e'
2022-05-07 11:22:41 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 241 (readCounters) received: b'21000e001d000b000000000000000000120009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
2022-05-07 11:22:41 DEBUG (MainThread) [bellows.ezsp.protocol] Send command getValue: (<EzspValueId.VALUE_FREE_BUFFERS: 3>,)
2022-05-07 11:22:41 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'058d21a9fe2a16ca677e'
2022-05-07 11:22:41 DEBUG (bellows.thread_0) [bellows.uart] Data frame: b'518da1a9fe2a15b3abc8607e'
2022-05-07 11:22:41 DEBUG (bellows.thread_0) [bellows.uart] Sending: b'8610be7e'
2022-05-07 11:22:41 DEBUG (MainThread) [bellows.ezsp.protocol] Application frame 170 (getValue) received: b'0001f2'
2022-05-07 11:22:41 DEBUG (MainThread) [bellows.zigbee.application] Free buffers status EzspStatus.SUCCESS, value: 242
2022-05-07 11:22:41 DEBUG (MainThread) [bellows.zigbee.application] ezsp_counters: [MAC_RX_BROADCAST = 858, MAC_TX_BROADCAST = 518, MAC_RX_UNICAST = 1527, MAC_TX_UNICAST_SUCCESS = 757, MAC_TX_UNICAST_RETRY = 64, MAC_TX_UNICAST_FAILED = 2, APS_DATA_RX_BROADCAST = 7, APS_DATA_TX_BROADCAST = 7, APS_DATA_RX_UNICAST = 439, APS_DATA_TX_UNICAST_SUCCESS = 366, APS_DATA_TX_UNICAST_RETRY = 13, APS_DATA_TX_UNICAST_FAILED = 3, ROUTE_DISCOVERY_INITIATED = 6, NEIGHBOR_ADDED = 2, NEIGHBOR_REMOVED = 0, NEIGHBOR_STALE = 3, JOIN_INDICATION = 0, CHILD_REMOVED = 0, ASH_OVERFLOW_ERROR = 0, ASH_FRAMING_ERROR = 0, ASH_OVERRUN_ERROR = 0, NWK_FRAME_COUNTER_FAILURE = 0, APS_FRAME_COUNTER_FAILURE = 0, UTILITY = 0, APS_LINK_KEY_NOT_AUTHORIZED = 0, NWK_DECRYPTION_FAILURE = 0, APS_DECRYPTION_FAILURE = 0, ALLOCATE_PACKET_BUFFER_FAILURE = 0, RELAYED_UNICAST = 0, PHY_TO_MAC_QUEUE_LIMIT_REACHED = 0, PACKET_VALIDATE_LIBRARY_DROPPED_COUNT = 0, TYPE_NWK_RETRY_OVERFLOW = 0, PHY_CCA_FAIL_COUNT = 0, BROADCAST_TABLE_FULL = 0, PTA_LO_PRI_REQUESTED = 0, PTA_HI_PRI_REQUESTED = 0, PTA_LO_PRI_DENIED = 0, PTA_HI_PRI_DENIED = 0, PTA_LO_PRI_TX_ABORTED = 0, PTA_HI_PRI_TX_ABORTED = 0, ADDRESS_CONFLICT_SENT = 0, EZSP_FREE_BUFFERS = 242]

BlastyCZ avatar May 07 '22 09:05 BlastyCZ

I have no idea why your device looks so differently..

Could you send me a debug log while pressing a few buttons? Maybe I can recognize a pattern

Hi, I'm new to quirks but from your discussion i think i have the same problem with only 3 endpoints (1, 2, 242) being shown when i add this device to ZHA. I added your custom quirk but it doesn't recognise it. I have 2 of these H1 double rocker switches and really want to be able to decouple the button from the relay... Anything i can do to help?

nclapham01 avatar Jul 17 '22 10:07 nclapham01

I am kind of clueless why they are so different. You could try:

  1. Disconnect the device from power
  2. remove the device from ZHA
  3. Restart HA
  4. Join the device

Maybe retry this a couple of times and check whether the device changes it's endpoints

dumpfheimer avatar Jul 17 '22 10:07 dumpfheimer

Thanks will do. Could it be the firmware being different? In the device page i see: Device info lumi.switch.n2aeu1 by LUMI Connected via [Zigbee Coordinator] Firmware: 0x00000b16

Is your firmware the same?

nclapham01 avatar Jul 17 '22 11:07 nclapham01

I do not see a firmware version on the device page

dumpfheimer avatar Jul 17 '22 11:07 dumpfheimer

Any success?

dumpfheimer avatar Jul 19 '22 15:07 dumpfheimer

Sorry for the wait. I tried but still no luck. Endpoints always stay the same. I took a copy of the log when the switch was pairing. Is that helpful?

nclapham01 avatar Jul 24 '22 20:07 nclapham01

What coordinator and firmware are you on. Maybe there is a pattern here..?

dumpfheimer avatar Jul 25 '22 08:07 dumpfheimer

Coordinator: Texas_Instruments_TI_CC2531 Firmware: do you mean for the coordinator or the switch? I cant find a firmware version for the coordinator. switch firmware shows up as 0x00000b16. When I pair the switch, it includes this line in the log: OTA query_next_image handler for 'LUMI lumi.switch.n2aeu1': field_control=FieldControl.0, manufacture_id=4447, image_type=5532, current_file_version=2838, hardware_version=None, model=lumi.switch.n2aeu1 No OTA image is available

Is that enough info or do you need anything else?

nclapham01 avatar Jul 25 '22 20:07 nclapham01

Hi, regarding the different endpoints: I have three of the H1 double rocker switches with neutral. One of them exposes with all the endpoints like implemented in this pull request. The other two (likely newer, since the shop had only one switch in stock when i ordered) expose three endpoints as mentioned by nclapham01. However... all work the same, so by adding a new signature and leaving the replace / trigger part it functions like the other version. This is what I appended to opple_switch.py:

class XiaomiOpple2ButtonSwitch2(XiaomiCustomDevice):
    """Xiaomi Opple 2 Button Switch."""

    manufacturer_id_override = 0x115F

    signature = {
        ENDPOINTS: {
            # input_clusters=[0, 2, 3, 4, 5, 6, 18, 64704], output_clusters=[10, 25]
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,  # 0
                    DeviceTemperature.cluster_id,  # 2
                    Identify.cluster_id,  # 3
                    Groups.cluster_id,  # 4
                    Scenes.cluster_id,  # 5
                    OnOff.cluster_id,  # 6
                    Alarms.cluster_id, # 9
                    Metering.cluster_id, # 0x0702
                    0x0b04,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            # input_clusters=[0, 3, 4, 5, 6, 18, 64704], output_clusters=[]
            2: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,  # 0
                    Identify.cluster_id,  # 3
                    Groups.cluster_id,  # 4
                    Scenes.cluster_id,  # 5
                    OnOff.cluster_id,  # 6
                ],
                OUTPUT_CLUSTERS: [],
            },
            242: {
                PROFILE_ID: 41440,
                DEVICE_TYPE: 0x0061,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH,
                INPUT_CLUSTERS: [
                    BasicCluster,
                    DeviceTemperatureCluster,  # 2
                    Identify.cluster_id,  # 3
                    Groups.cluster_id,  # 4
                    Scenes.cluster_id,  # 5
                    OnOffCluster,  # 6
                    #MultistateInputCluster,  # 18
                    OppleSwitchCluster,  # 0xFCC0 / 64704
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            2: {
                DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH,
                INPUT_CLUSTERS: [
                    BasicCluster,
                    Identify.cluster_id,  # 3
                    Groups.cluster_id,  # 4
                    Scenes.cluster_id,  # 5
                    OnOffCluster,  # 6
                    #MultistateInputCluster,  # 18
                    OppleSwitchCluster,  # 0xFCC0 / 64704
                ],
                OUTPUT_CLUSTERS: [],
            },
            # input_clusters=[12], output_clusters=[]
            21: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    AnalogInput.cluster_id,  # 12
                ],
                OUTPUT_CLUSTERS: [],
            },
            # input_clusters=[12], output_clusters=[]
            31: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    AnalogInput.cluster_id,  # 12
                ],
                OUTPUT_CLUSTERS: [],
            },
            # input_clusters=[18], output_clusters=[]
            41: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    MultistateInputCluster,  # 18
                ],
                OUTPUT_CLUSTERS: [],
            },
            # input_clusters=[18], output_clusters=[]
            42: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    MultistateInputCluster,  # 18
                ],
                OUTPUT_CLUSTERS: [],
            },
            # input_clusters=[18], output_clusters=[]
            51: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    MultistateInputCluster,  # 18
                ],
                OUTPUT_CLUSTERS: [],
            },
            # input_clusters=[18], output_clusters=[]
            61: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
                INPUT_CLUSTERS: [
                    MultistateInputCluster,  # 18
                ],
                OUTPUT_CLUSTERS: [],
            },
            242: {
                PROFILE_ID: 41440,
                DEVICE_TYPE: 97,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        }
    }

    device_automation_triggers = {
        (COMMAND_BUTTON_SINGLE, BUTTON_1): {
            ENDPOINT_ID: 41,
            CLUSTER_ID: 18,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x0055, PRESS_TYPE: COMMAND_SINGLE, VALUE: 1},
        },
        (COMMAND_BUTTON_DOUBLE, BUTTON_1): {
            ENDPOINT_ID: 41,
            CLUSTER_ID: 18,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x0055, PRESS_TYPE: COMMAND_DOUBLE, VALUE: 2},
        },
        (COMMAND_BUTTON_HOLD, BUTTON_1): {
            ENDPOINT_ID: 1,
            CLUSTER_ID: 0xFCC0,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x00FC, VALUE: False},
        },
        (COMMAND_BUTTON_SINGLE, BUTTON_2): {
            ENDPOINT_ID: 42,
            CLUSTER_ID: 18,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x0055, PRESS_TYPE: COMMAND_SINGLE, VALUE: 1},
        },
        (COMMAND_BUTTON_DOUBLE, BUTTON_2): {
            ENDPOINT_ID: 42,
            CLUSTER_ID: 18,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x0055, PRESS_TYPE: COMMAND_DOUBLE, VALUE: 2},
        },
        (COMMAND_BUTTON_HOLD, BUTTON_2): {
            ENDPOINT_ID: 1,
            CLUSTER_ID: 0xFCC0,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x00FC, VALUE: False},
        },
        (COMMAND_BUTTON_SINGLE, BOTH_BUTTONS): {
            ENDPOINT_ID: 51,
            CLUSTER_ID: 18,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x0055, PRESS_TYPE: COMMAND_SINGLE, VALUE: 1},
        },
        (COMMAND_BUTTON_DOUBLE, BOTH_BUTTONS): {
            ENDPOINT_ID: 51,
            CLUSTER_ID: 18,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x0055, PRESS_TYPE: COMMAND_DOUBLE, VALUE: 2},
        },
        (COMMAND_BUTTON_HOLD, BOTH_BUTTONS): {
            ENDPOINT_ID: 1,
            CLUSTER_ID: 0xFCC0,
            # COMMAND: COMMAND_ATTRIBUTE_UPDATED,
            ARGS: {ATTR_ID: 0x00FC, VALUE: 0},
        },
    }

Some features that dont work right now:

  • device temperature shows 0.3 in home assistant
  • power / energy reporting sensors in home assistant

wrieden avatar Aug 09 '22 11:08 wrieden

Hi, regarding the different endpoints: I have three of the H1 double rocker switches with neutral. One of them exposes with all the endpoints like implemented in this pull request. The other two (likely newer, since the shop had only one switch in stock when i ordered) expose three endpoints as mentioned by nclapham01. However... all work the same, so by adding a new signature and leaving the replace / trigger part it functions like the other version. This is what I appended to opple_switch.py:

Some features that dont work right now:

  • device temperature shows 0.3 in home assistant
  • power / energy reporting sensors in home assistant

Thanks @wRieDen that sounds great! Unfortunately when i tried creating a custom quirk including what you've added, i get this error after restarting: File "/config/custom_zha_quirks/opple_switch(test).py", line 781, in XiaomiOpple2ButtonSwitch2 Alarms.cluster_id, # 9 NameError: name 'Alarms' is not defined

I'm a novice when it comes to creating these quirks, so forgive me if I'm missing something obvious, but I cant see where "Alarms" is defined... can you help me fix this? Thanks.

nclapham01 avatar Aug 10 '22 23:08 nclapham01