Repository: zigpy/zha-device-handlers
Pull request #2513 (2023-08-05 16:53:05)

Add Aqara T1 relay (with neutral) support
Found this quirck here: https://community.home-assistant.io/t/lumi-switch-n0agl1-not-working-in-zha/439772
So all credits to those people

And it does work for my lumi.switch.n0acn2 relay from aqara

Fixes https://github.com/zigpy/zha-device-handlers/issues/1231


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/zigpy/zha-device-handlers/pull/2513?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy) Report
Patch coverage: **`100.00%`** and project coverage change: **`+0.03%`** :tada:
> Comparison is base [(`9c985b4`)](https://app.codecov.io/gh/zigpy/zha-device-handlers/commit/9c985b47907b85c59c3c4fe2a9d3c46f0b507db1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy) 85.37% compared to head [(`de3be6f`)](https://app.codecov.io/gh/zigpy/zha-device-handlers/pull/2513?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy) 85.41%.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##              dev    #2513      +/-   ##
==========================================
+ Coverage   85.37%   85.41%   +0.03%     
==========================================
  Files         272      273       +1     
  Lines        8542     8562      +20     
==========================================
+ Hits         7293     7313      +20     
  Misses       1249     1249              
```


| [Files Changed](https://app.codecov.io/gh/zigpy/zha-device-handlers/pull/2513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy) | Coverage Δ | |
|---|---|---|
| [zhaquirks/xiaomi/aqara/switch\_n0agl1.py](https://app.codecov.io/gh/zigpy/zha-device-handlers/pull/2513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy#diff-emhhcXVpcmtzL3hpYW9taS9hcWFyYS9zd2l0Y2hfbjBhZ2wxLnB5) | `100.00% <100.00%> (ø)` | |


</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/zigpy/zha-device-handlers/pull/2513?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy).

vermaete: @TheJulianJES I have tested the latest version in my Home Assistant and it works.

One of my 7 relay is behaving strange when switching off.  If switches first of, then on, and then off.
Here is the log of that one relay.  However it could be considered as another issue and should not block the merge.

Thanks

```
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.7.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.4",
    "docker": true,
    "arch": "armv7l",
    "timezone": "Europe/Brussels",
    "os_name": "Linux",
    "os_version": "6.1.21-v7l",
    "supervisor": "2023.08.1",
    "host_os": "Home Assistant OS 10.3",
    "docker_version": "23.0.6",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "nodered": {
      "version": "2.1.0",
      "requirements": []
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "after_dependencies": [
      "onboarding",
      "usb"
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga",
      "@puddly"
    ],
    "config_flow": true,
    "dependencies": [
      "file_upload"
    ],
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "requirements": [
      "bellows==0.35.8",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.101",
      "zigpy-deconz==0.21.0",
      "zigpy==0.56.2",
      "zigpy-xbee==0.18.1",
      "zigpy-zigate==0.11.0",
      "zigpy-znp==0.11.3"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "1A86",
        "pid": "55D4",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus v2"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      },
      {
        "type": "_zigstar_gw._tcp.local.",
        "name": "*zigstar*"
      },
      {
        "type": "_slzb-06._tcp.local.",
        "name": "slzb-06*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 5277,
    "manufacturer": "LUMI",
    "model": "lumi.switch.n0acn2",
    "name": "LUMI lumi.switch.n0acn2",
    "quirk_applied": true,
    "quirk_class": "relay_n0acn2.SwitchT1",
    "manufacturer_code": 4447,
    "power_source": "Mains",
    "lqi": 255,
    "rssi": -64,
    "last_seen": "2023-08-12T09:34:41",
    "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.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4447, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": "0x0104",
          "device_type": "0x0000",
          "input_clusters": [
            "0x0000",
            "0x0002",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0009",
            "0x000a",
            "0x0702",
            "0x0b04",
            "0xfcc0"
          ],
          "output_clusters": [
            "0x0006",
            "0x000a",
            "0x0019"
          ]
        },
        "21": {
          "profile_id": "0x0104",
          "device_type": "0x0000",
          "input_clusters": [],
          "output_clusters": []
        },
        "31": {
          "profile_id": "0x0104",
          "device_type": "0x0000",
          "input_clusters": [],
          "output_clusters": []
        },
        "41": {
          "profile_id": "0x0104",
          "device_type": "0x0000",
          "input_clusters": [],
          "output_clusters": []
        },
        "242": {
          "profile_id": "0xa1e0",
          "device_type": "0x0061",
          "input_clusters": [],
          "output_clusters": [
            "0x0021"
          ]
        }
      },
      "manufacturer": "LUMI",
      "model": "lumi.switch.n0acn2"
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "sensor.relais_living_apparent_power",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "sensor.relais_living_rms_current",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "sensor.relais_living_rms_voltage",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "sensor.relais_living_ac_frequency",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "sensor.lumi_lumi_switch_n0acn2_power_factor_5",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "sensor.lumi_lumi_switch_n0acn2_device_temperature_2",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "sensor.lumi_lumi_switch_n0acn2_active_power_5",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "button.lumi_lumi_switch_n0acn2_identify_2",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "select.lumi_lumi_switch_n0acn2_start_up_behavior",
        "name": "LUMI lumi.switch.n0acn2"
      },
      {
        "entity_id": "switch.lumi_lumi_switch_n0acn2_switch_5",
        "name": "LUMI lumi.switch.n0acn2"
      }
    ],
    "neighbors": [
      {
        "device_type": "Coordinator",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x0000",
        "permit_joining": "Unknown",
        "depth": "0",
        "lqi": "140"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x1D31",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "49"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x24C3",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "103"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x305C",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "12"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x4C61",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "92"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x587C",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "1"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x5C34",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "103"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x63CB",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "87"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x9F23",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "108"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0xB402",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "143"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0xE377",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "148"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Parent",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0xF852",
        "permit_joining": "Unknown",
        "depth": "15",
        "lqi": "147"
      },
      {
        "device_type": "EndDevice",
        "rx_on_when_idle": "Off",
        "relationship": "Child",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0xBF42",
        "permit_joining": "NotAccepting",
        "depth": "6",
        "lqi": "149"
      },
      {
        "device_type": "EndDevice",
        "rx_on_when_idle": "Off",
        "relationship": "Child",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x5042",
        "permit_joining": "NotAccepting",
        "depth": "6",
        "lqi": "42"
      }
    ],
    "routes": [
      {
        "dest_nwk": "0x0000",
        "route_status": "Active",
        "memory_constrained": false,
        "many_to_one": true,
        "route_record_required": false,
        "next_hop": "0x0000"
      },
      {
        "dest_nwk": "0x2516",
        "route_status": "Active",
        "memory_constrained": false,
        "many_to_one": false,
        "route_record_required": false,
        "next_hop": "0x2516"
      },
      {
        "dest_nwk": "0x587C",
        "route_status": "Active",
        "memory_constrained": false,
        "many_to_one": false,
        "route_record_required": false,
        "next_hop": "0x587C"
      },
      {
        "dest_nwk": "0xC7EA",
        "route_status": "Active",
        "memory_constrained": false,
        "many_to_one": false,
        "route_record_required": false,
        "next_hop": "0xC7EA"
      },
      {
        "dest_nwk": "0x4C61",
        "route_status": "Active",
        "memory_constrained": false,
        "many_to_one": false,
        "route_record_required": false,
        "next_hop": "0x4C61"
      }
    ],
    "endpoint_names": [
      {
        "name": "ON_OFF_SWITCH"
      },
      {
        "name": "ON_OFF_SWITCH"
      },
      {
        "name": "ON_OFF_SWITCH"
      },
      {
        "name": "ON_OFF_SWITCH"
      },
      {
        "name": "PROXY_BASIC"
      }
    ],
    "user_given_name": "relais - living",
    "device_reg_id": "2bff6c1d8f9531ced690b4b160ceed08",
    "area_id": "living",
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "ON_OFF_SWITCH",
          "id": 0
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0001": {
                "attribute_name": "app_version",
                "value": 35
              },
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "LUMI"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "lumi.switch.n0acn2"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0002": {
            "endpoint_attribute": "device_temperature",
            "attributes": {
              "0x0000": {
                "attribute_name": "current_temperature",
                "value": 2700
              }
            },
            "unsupported_attributes": {}
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {
              "0x0000": {
                "attribute_name": "on_off",
                "value": 1
              },
              "0x4003": {
                "attribute_name": "start_up_on_off",
                "value": 0
              }
            },
            "unsupported_attributes": {}
          },
          "0x0009": {
            "endpoint_attribute": "alarms",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0702": {
            "endpoint_attribute": "smartenergy_metering",
            "attributes": {},
            "unsupported_attributes": {
              "0x0300": {
                "attribute_name": "unit_of_measure"
              },
              "0x0301": {
                "attribute_name": "multiplier"
              },
              "0x0302": {
                "attribute_name": "divisor"
              },
              "0x0303": {
                "attribute_name": "summation_formatting"
              },
              "0x0304": {
                "attribute_name": "demand_formatting"
              },
              "0x0400": {
                "attribute_name": "instantaneous_demand"
              },
              "0x0306": {
                "attribute_name": "metering_device_type"
              },
              "0x0000": {
                "attribute_name": "current_summ_delivered"
              },
              "0x0100": {
                "attribute_name": "current_tier1_summ_delivered"
              },
              "0x0102": {
                "attribute_name": "current_tier2_summ_delivered"
              },
              "0x0104": {
                "attribute_name": "current_tier3_summ_delivered"
              },
              "0x0106": {
                "attribute_name": "current_tier4_summ_delivered"
              },
              "0x0108": {
                "attribute_name": "current_tier5_summ_delivered"
              },
              "0x010a": {
                "attribute_name": "current_tier6_summ_delivered"
              },
              "0x0200": {
                "attribute_name": "status"
              }
            }
          },
          "0x0b04": {
            "endpoint_attribute": "electrical_measurement",
            "attributes": {
              "0x0605": {
                "attribute_name": "ac_power_divisor",
                "value": 10
              },
              "0x0604": {
                "attribute_name": "ac_power_multiplier",
                "value": 1
              },
              "0x050b": {
                "attribute_name": "active_power",
                "value": 0
              },
              "0x0000": {
                "attribute_name": "measurement_type",
                "value": 8
              }
            },
            "unsupported_attributes": {
              "0x0600": {
                "attribute_name": "ac_voltage_multiplier"
              },
              "0x0601": {
                "attribute_name": "ac_voltage_divisor"
              },
              "0x0602": {
                "attribute_name": "ac_current_multiplier"
              },
              "0x0603": {
                "attribute_name": "ac_current_divisor"
              },
              "0x0401": {
                "attribute_name": "ac_frequency_divisor"
              },
              "0x0400": {
                "attribute_name": "ac_frequency_multiplier"
              },
              "0x0403": {
                "attribute_name": "power_divisor"
              },
              "0x0402": {
                "attribute_name": "power_multiplier"
              },
              "0x050d": {
                "attribute_name": "active_power_max"
              },
              "0x0508": {
                "attribute_name": "rms_current"
              },
              "0x050a": {
                "attribute_name": "rms_current_max"
              },
              "0x0505": {
                "attribute_name": "rms_voltage"
              },
              "0x0507": {
                "attribute_name": "rms_voltage_max"
              },
              "0x050f": {
                "attribute_name": "apparent_power"
              },
              "0x0300": {
                "attribute_name": "ac_frequency"
              },
              "0x0302": {
                "attribute_name": "ac_frequency_max"
              }
            }
          },
          "0xfcc0": {
            "endpoint_attribute": "aqara_cluster",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      },
      "21": {
        "device_type": {
          "name": "ON_OFF_SWITCH",
          "id": 0
        },
        "profile_id": 260,
        "in_clusters": {},
        "out_clusters": {}
      },
      "31": {
        "device_type": {
          "name": "ON_OFF_SWITCH",
          "id": 0
        },
        "profile_id": 260,
        "in_clusters": {},
        "out_clusters": {}
      },
      "41": {
        "device_type": {
          "name": "ON_OFF_SWITCH",
          "id": 0
        },
        "profile_id": 260,
        "in_clusters": {},
        "out_clusters": {}
      },
      "242": {
        "device_type": {
          "name": "PROXY_BASIC",
          "id": 97
        },
        "profile_id": 41440,
        "in_clusters": {},
        "out_clusters": {
          "0x0021": {
            "endpoint_attribute": "green_power",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}
```


TheJulianJES: > One of my 7 relay is behaving strange when switching off. It switches first off, then on, and then off again.

Hmm, did you try re-pairing that particular relay? 
TheJulianJES: @vermaete I've made some more changes. Can you install that new (custom) quirk, restart HA, and then completely remove one device and then pair it again?

Please let me know if:
1. the new custom attributes work
2. On/Off still works with the cluster removed from `OUTPUT_CLUSTERS`
3. energy metering works correctly (no random drops to zero) (only power factor is expected to be "unknown")
4. there's a new binary sensor for the switch
5. you encounter any issues
vermaete: > * the new custom attributes work
With the latest commit in the merge request all devices are working.  The one with the strange off behavior still has it.
> * On/Off still works with the cluster removed from `OUTPUT_CLUSTERS`
Yes, all relay are switching on and off
> * energy metering works correctly (no random drops to zero) (only power factor is expected to be "unknown")
Seems to be okay.  Some of them has no load, so indicating zero Watt, what is also okay.
> * there's a new binary sensor for the switch
> * you encounter any issues
Well, none except that one switch that switch on and off when switching off.
I'm not 100% sure this is the correct log for you:
```
2023-08-16 18:25:03.130 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2670941200] 
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 310, in request
    return await req.result
           ^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service
    return await cast(
           ^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call
    response_data = task.result()  # pop exception if have
                    ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/switch.py", line 96, in async_turn_off
    result = await self._on_off_cluster_handler.turn_off()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/general.py", line 407, in turn_off
    result = await self.off()
             ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/util.py", line 132, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 309, in request
    async with asyncio_timeout(timeout):
  File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
2023-08-16 18:25:06.331 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2670941200] 
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 310, in request
    return await req.result
           ^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service
    return await cast(
           ^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call
    response_data = task.result()  # pop exception if have
                    ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/switch.py", line 89, in async_turn_on
    result = await self._on_off_cluster_handler.turn_on()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/general.py", line 399, in turn_on
    result = await self.on()
             ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/util.py", line 132, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 309, in request
    async with asyncio_timeout(timeout):
  File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
```



TheJulianJES: The timeout error is likely a network/device issue and not a quirks one.

For adding some tests, can you turn on debug logging (can be done through integrations page), let it sit a bit enabled, and then check the logs for something like this from one of your T1 relays:
```python
2023-08-17 05:28:34.586 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x3E8D), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=64704, data=Serialized[b"\x1c_\x11\x06\n\xf7\x00A=d\x10\x01\x03(\x1f\x989{\x14HB\x959\xd1P\x8dB\x969\x00\x80\tE\x979\x17]cC\x05!\x04\x00\x9a \x00\x08!\x16\x01\x07'\x00\x00\x00\x00\x00\x00\x00\x00\t!\x01\r\x0b \x00\x9b\x10\x01"], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=65, rssi=None)
2023-08-17 05:28:34.587 DEBUG (MainThread) [zigpy.zcl] [0x3E8D:1:0xfcc0] Received ZCL frame: b"\x1c_\x11\x06\n\xf7\x00A=d\x10\x01\x03(\x1f\x989{\x14HB\x959\xd1P\x8dB\x969\x00\x80\tE\x979\x17]cC\x05!\x04\x00\x9a \x00\x08!\x16\x01\x07'\x00\x00\x00\x00\x00\x00\x00\x00\t!\x01\r\x0b \x00\x9b\x10\x01"
2023-08-17 05:28:34.587 DEBUG (MainThread) [zigpy.zcl] [0x3E8D:1:0xfcc0] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=True, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), manufacturer=4447, tsn=6, command_id=10, *direction=<Direction.Client_to_Server: 1>)
2023-08-17 05:28:34.587 DEBUG (MainThread) [zigpy.zcl] [0x3E8D:1:0xfcc0] Decoded ZCL frame: OppleCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x00F7, value=TypeValue(type=LVBytes, value=b"d\x10\x01\x03(\x1f\x989{\x14HB\x959\xd1P\x8dB\x969\x00\x80\tE\x979\x17]cC\x05!\x04\x00\x9a \x00\x08!\x16\x01\x07'\x00\x00\x00\x00\x00\x00\x00\x00\t!\x01\r\x0b \x00\x9b\x10\x01"))])
2023-08-17 05:28:34.587 DEBUG (MainThread) [zigpy.zcl] [0x3E8D:1:0xfcc0] Received command 0x0A (TSN 6): Report_Attributes(attribute_reports=[Attribute(attrid=0x00F7, value=TypeValue(type=LVBytes, value=b"d\x10\x01\x03(\x1f\x989{\x14HB\x959\xd1P\x8dB\x969\x00\x80\tE\x979\x17]cC\x05!\x04\x00\x9a \x00\x08!\x16\x01\x07'\x00\x00\x00\x00\x00\x00\x00\x00\t!\x01\r\x0b \x00\x9b\x10\x01"))])
2023-08-17 05:28:34.587 DEBUG (MainThread) [zigpy.zcl] [0x3E8D:1:0xfcc0] Attribute report received: 0x00F7=b"d\x10\x01\x03(\x1f\x989{\x14HB\x959\xd1P\x8dB\x969\x00\x80\tE\x979\x17]cC\x05!\x04\x00\x9a \x00\x08!\x16\x01\x07'\x00\x00\x00\x00\x00\x00\x00\x00\t!\x01\r\x0b \x00\x9b\x10\x01"
2023-08-17 05:28:34.588 DEBUG (MainThread) [zhaquirks.xiaomi] xx:xx:xx:xx:xx:xx:xx:xx - Attribute report. attribute_id: [247] value: [{'0xff01-100': <Bool.true: 1>, 'temperature': 31, 'power': 50.02000045776367, 'consumption': 70.65784454345703, 'voltage': 2200.0, '0xff01-151': 227.36363220214844, 'X-attrib-5': 4, '0xff01-154': 0, '0xff01-8': 278, '0xff01-7': 0, '0xff01-9': 3329, '0xff01-11': 0, '0xff01-155': <Bool.true: 1>}]
```

So you can search for something like `Attribute report. attribute_id` and then send that and especially the lines before that.
(I can then add tests for this device)
vermaete: @TheJulianJES This should be the log you where asking for.
```
2023-08-17 18:44:39.913 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0583), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=None, profile_id=260, cluster_id=64704, data=Serialized[b'\x1c_\x11\x01\n\xf7\x00A0d\x10\x00\x03(\x1e\x989\x00\x00\x00\x00\x959\x00\x00\x00\x00\x969~\xb8\rE\x979\x00\x00\x00\x00\x05!\x05\x00\x9a \x10\x0b \x00\x08!#\x01\t!\x00\x0c'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-64)
2023-08-17 18:44:39.915 DEBUG (MainThread) [zigpy.zcl] [0x0583:1:0xfcc0] Received ZCL frame: b'\x1c_\x11\x01\n\xf7\x00A0d\x10\x00\x03(\x1e\x989\x00\x00\x00\x00\x959\x00\x00\x00\x00\x969~\xb8\rE\x979\x00\x00\x00\x00\x05!\x05\x00\x9a \x10\x0b \x00\x08!#\x01\t!\x00\x0c'
2023-08-17 18:44:39.916 DEBUG (MainThread) [zigpy.zcl] [0x0583:1:0xfcc0] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=True, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), manufacturer=4447, tsn=1, command_id=10, *direction=<Direction.Client_to_Server: 1>)
2023-08-17 18:44:39.917 DEBUG (MainThread) [zigpy.zcl] [0x0583:1:0xfcc0] Decoded ZCL frame: XiaomiAqaraT1Cluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x00F7, value=TypeValue(type=LVBytes, value=b'd\x10\x00\x03(\x1e\x989\x00\x00\x00\x00\x959\x00\x00\x00\x00\x969~\xb8\rE\x979\x00\x00\x00\x00\x05!\x05\x00\x9a \x10\x0b \x00\x08!#\x01\t!\x00\x0c'))])
2023-08-17 18:44:39.918 DEBUG (MainThread) [zigpy.zcl] [0x0583:1:0xfcc0] Received command 0x0A (TSN 1): Report_Attributes(attribute_reports=[Attribute(attrid=0x00F7, value=TypeValue(type=LVBytes, value=b'd\x10\x00\x03(\x1e\x989\x00\x00\x00\x00\x959\x00\x00\x00\x00\x969~\xb8\rE\x979\x00\x00\x00\x00\x05!\x05\x00\x9a \x10\x0b \x00\x08!#\x01\t!\x00\x0c'))])
2023-08-17 18:44:39.919 DEBUG (MainThread) [zigpy.zcl] [0x0583:1:0xfcc0] Attribute report received: 0x00F7=b'd\x10\x00\x03(\x1e\x989\x00\x00\x00\x00\x959\x00\x00\x00\x00\x969~\xb8\rE\x979\x00\x00\x00\x00\x05!\x05\x00\x9a \x10\x0b \x00\x08!#\x01\t!\x00\x0c'
2023-08-17 18:44:39.920 DEBUG (MainThread) [zhaquirks.xiaomi] 54:ef:44:10:00:08:9e:05 - Attribute report. attribute_id: [247] value: [{'0xff01-100': <Bool.false: 0>, 'temperature': 30, '0xff01-152': 0.0, '0xff01-149': 0.0, '0xff01-150': 2267.53076171875, '0xff01-151': 0.0, 'X-attrib-5': 5, '0xff01-154': 16, '0xff01-11': 0, '0xff01-8': 291, '0xff01-9': 3072}]
```

I agree the timeout could be something else.  For now I replaced the device by another :-)
TheJulianJES: Thanks! The next HA/quirks version will have some "fundamental" changes that remove the `Bus` stuff from Xiaomi quirks.
So I'll make some changes that will be harder for you to test. (Hopefully I'll get this ready for the next major HA version.)

However, with whatever version you currently have of the quirk, please replace `OnOffCluster` in the replacement with just `OnOff.cluster_id`. Then, let me know if on/off through HA/switch and so on still works. ([Link for that quirk with it replaced](https://dpaste.org/Zmqbk/raw))
(I don't think we need that custom `OnOffCluster` and the normal "OnOff" cluster should be enough for this device.)
TheJulianJES: I've rebased your fork now. HA Core 2023.9.x and later won't require bus initialization anymore, hence I've removed it.
You'll still need it for older HA versions though (when using a custom quirk).

I've made some more changes, but I think everything should work as expected, as it's very similar to how the EU plugs behave.
It would be amazing if you could try the HA 2023.9.0 betas as soon as they're out to confirm that everything works. If not, please open an issue and tag me.

Patch:
diff --git a/zhaquirks/xiaomi/__init__.py b/zhaquirks/xiaomi/__init__.py
index eb2a866..c945b36 100644
--- a/zhaquirks/xiaomi/__init__.py
+++ b/zhaquirks/xiaomi/__init__.py
@@ -367,6 +367,8 @@ class XiaomiCluster(CustomCluster):
             "lumi.plug.maeu01",
             "lumi.plug.mmeu01",
             "lumi.relay.c2acn01",
+            "lumi.switch.n0agl1",
+            "lumi.switch.n0acn2",
         ]:
             attribute_names.update({149: CONSUMPTION, 150: VOLTAGE, 152: POWER})
         elif self.endpoint.device.model == "lumi.sensor_motion.aq2":
diff --git a/zhaquirks/xiaomi/aqara/switch_t1.py b/zhaquirks/xiaomi/aqara/switch_t1.py
new file mode 100644
index 0000000..63ac57c
--- /dev/null
+++ b/zhaquirks/xiaomi/aqara/switch_t1.py
@@ -0,0 +1,202 @@
+"""Aqara T1 (with neutral) relays."""
+from zigpy import types as t
+from zigpy.profiles import zgp, zha
+from zigpy.zcl.clusters.general import (
+    Alarms,
+    AnalogInput,
+    Basic,
+    DeviceTemperature,
+    GreenPowerProxy,
+    Groups,
+    Identify,
+    MultistateInput,
+    OnOff,
+    Ota,
+    Scenes,
+    Time,
+)
+
+from zhaquirks.const import (
+    DEVICE_TYPE,
+    ENDPOINTS,
+    INPUT_CLUSTERS,
+    MODELS_INFO,
+    OUTPUT_CLUSTERS,
+    PROFILE_ID,
+)
+from zhaquirks.xiaomi import (
+    LUMI,
+    AnalogInputCluster,
+    BasicCluster,
+    DeviceTemperatureCluster,
+    ElectricalMeasurementCluster,
+    MeteringCluster,
+    XiaomiAqaraE1Cluster,
+    XiaomiCustomDevice,
+)
+from zhaquirks.xiaomi.aqara.opple_remote import MultistateInputCluster
+
+
+class OppleCluster(XiaomiAqaraE1Cluster):
+    """Xiaomi Aqara T1 relay cluster."""
+
+    ep_attribute = "opple_cluster"
+    attributes = {
+        0x000A: ("switch_type", t.uint8_t, True),
+        0x0201: ("power_outage_memory", t.Bool, True),
+        0x0203: ("do_not_disturb", t.Bool, True),
+    }
+
+
+class SwitchT1(XiaomiCustomDevice):
+    """Aqara T1 relay switch."""
+
+    signature = {
+        MODELS_INFO: [(LUMI, "lumi.switch.n0agl1"), (LUMI, "lumi.switch.n0acn2")],
+        ENDPOINTS: {
+            1: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [
+                    Basic.cluster_id,
+                    DeviceTemperature.cluster_id,
+                    Identify.cluster_id,
+                    Groups.cluster_id,
+                    Scenes.cluster_id,
+                    Alarms.cluster_id,
+                    Time.cluster_id,
+                    OppleCluster.cluster_id,
+                ],
+                OUTPUT_CLUSTERS: [
+                    Ota.cluster_id,
+                ],
+            },
+            21: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [AnalogInput.cluster_id],
+                OUTPUT_CLUSTERS: [],
+            },
+            31: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [AnalogInput.cluster_id],
+                OUTPUT_CLUSTERS: [],
+            },
+            41: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [MultistateInput.cluster_id],
+                OUTPUT_CLUSTERS: [],
+            },
+            242: {
+                PROFILE_ID: zgp.PROFILE_ID,
+                DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
+                INPUT_CLUSTERS: [],
+                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
+            },
+        },
+    }
+
+    replacement = {
+        ENDPOINTS: {
+            1: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH,
+                INPUT_CLUSTERS: [
+                    BasicCluster,
+                    DeviceTemperatureCluster,
+                    Identify.cluster_id,
+                    Groups.cluster_id,
+                    Scenes.cluster_id,
+                    OnOff.cluster_id,
+                    Alarms.cluster_id,
+                    Time.cluster_id,
+                    MeteringCluster,
+                    ElectricalMeasurementCluster,
+                    OppleCluster,
+                ],
+                OUTPUT_CLUSTERS: [
+                    Time.cluster_id,
+                    Ota.cluster_id,
+                ],
+            },
+            21: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH,
+                INPUT_CLUSTERS: [AnalogInputCluster],
+                OUTPUT_CLUSTERS: [],
+            },
+            31: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH,
+                INPUT_CLUSTERS: [AnalogInput.cluster_id],
+                OUTPUT_CLUSTERS: [],
+            },
+            41: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH,
+                INPUT_CLUSTERS: [MultistateInputCluster],
+                OUTPUT_CLUSTERS: [],
+            },
+            242: {
+                PROFILE_ID: zgp.PROFILE_ID,
+                DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
+                INPUT_CLUSTERS: [],
+                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
+            },
+        }
+    }
+
+
+class SwitchT1Alt1(SwitchT1):
+    """Aqara T1 relay switch with alternative signature."""
+
+    signature = {
+        MODELS_INFO: [(LUMI, "lumi.switch.n0agl1"), (LUMI, "lumi.switch.n0acn2")],
+        ENDPOINTS: {
+            1: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [
+                    Basic.cluster_id,
+                    DeviceTemperature.cluster_id,
+                    Identify.cluster_id,
+                    Groups.cluster_id,
+                    Scenes.cluster_id,
+                    Alarms.cluster_id,
+                    Time.cluster_id,
+                    OppleCluster.cluster_id,
+                ],
+                OUTPUT_CLUSTERS: [
+                    Time.cluster_id,
+                    Ota.cluster_id,
+                    0xFFFF,
+                ],
+            },
+            21: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [AnalogInput.cluster_id],
+                OUTPUT_CLUSTERS: [],
+            },
+            31: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [AnalogInput.cluster_id],
+                OUTPUT_CLUSTERS: [],
+            },
+            41: {
+                PROFILE_ID: zha.PROFILE_ID,
+                DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
+                INPUT_CLUSTERS: [MultistateInput.cluster_id],
+                OUTPUT_CLUSTERS: [],
+            },
+            242: {
+                PROFILE_ID: zgp.PROFILE_ID,
+                DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
+                INPUT_CLUSTERS: [],
+                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
+            },
+        },
+    }


Test patch:
diff --git a/tests/test_xiaomi.py b/tests/test_xiaomi.py
index 967933f..624f19e 100644
--- a/tests/test_xiaomi.py
+++ b/tests/test_xiaomi.py
@@ -72,6 +72,7 @@ import zhaquirks.xiaomi.aqara.plug
 import zhaquirks.xiaomi.aqara.plug_eu
 import zhaquirks.xiaomi.aqara.roller_curtain_e1
 import zhaquirks.xiaomi.aqara.smoke
+import zhaquirks.xiaomi.aqara.switch_t1
 import zhaquirks.xiaomi.aqara.weather
 import zhaquirks.xiaomi.mija.motion
 
@@ -515,9 +516,15 @@ async def test_xiaomi_eu_plug_binding(zigpy_device_from_quirk, quirk):
         )
 
 
-@pytest.mark.parametrize("quirk", (zhaquirks.xiaomi.aqara.plug_eu.PlugMAEU01,))
-async def test_xiaomi_eu_plug_power(zigpy_device_from_quirk, quirk):
-    """Test current power consumption, total power consumption, and current voltage on Xiaomi EU plug."""
+@pytest.mark.parametrize(
+    "quirk",
+    (
+        zhaquirks.xiaomi.aqara.plug_eu.PlugMAEU01,
+        zhaquirks.xiaomi.aqara.switch_t1.SwitchT1,
+    ),
+)
+async def test_xiaomi_plug_power(zigpy_device_from_quirk, quirk):
+    """Test current power consumption, total power consumption, and current voltage on Xiaomi EU plug and T1 relay."""
 
     device = zigpy_device_from_quirk(quirk)
     basic_cluster = device.endpoints[1].basic