Skip to content

Add signature variant for lumi.switch.l2aeu1 without extra endpoints#4829

Open
TomK wants to merge 1 commit intozigpy:devfrom
TomK:fix/l2aeu1-no-extra-endpoints
Open

Add signature variant for lumi.switch.l2aeu1 without extra endpoints#4829
TomK wants to merge 1 commit intozigpy:devfrom
TomK:fix/l2aeu1-no-extra-endpoints

Conversation

@TomK
Copy link
Copy Markdown

@TomK TomK commented Mar 16, 2026

Proposed change

Add a new signature variant (AqaraH1DoubleRockerSwitchNoNeutralCompact) for the Aqara H1 Double Rocker Switch (no neutral) lumi.switch.l2aeu1.

Some units report MultistateInput (0x0012) and OppleSwitchCluster (0xfcc0) on both endpoints 1 and 2, but do not expose the additional endpoints 41, 42, and 51. Without a matching signature, the quirk is not applied and Opple cluster configuration (e.g. detached mode) is inaccessible.

Additional information

Related: #4315

This is distinct from PR #4360 which adds a variant where EP1 has Alarms instead of MultistateInput/OppleSwitchCluster. This PR covers the case where both EP1 and EP2 have the Opple cluster but the extra endpoints are absent — likely due to a firmware update on the device.

Device diagnostics

zha-01KKMPDK0P0X01QZ7G3VVKYWZS-LUMI lumi.switch.l2aeu1-2e37219180dd498d0f4dd11404c1606c.json

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

Copilot AI review requested due to automatic review settings March 16, 2026 09:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new v1 quirk signature variant for the Aqara H1 Double Rocker Switch (no neutral) lumi.switch.l2aeu1 to handle devices that expose the Opple cluster on endpoints 1/2 but omit endpoints 41/42/51, ensuring the existing quirk logic can be applied and Opple configuration remains accessible.

Changes:

  • Introduce AqaraH1DoubleRockerSwitchNoNeutralCompact signature variant without endpoints 41/42/51.
  • Add a signature-matching unit test for the new variant.
  • Ensure the relevant quirk module is imported in the Xiaomi test suite.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
zhaquirks/xiaomi/aqara/switch_h1_double.py Adds the new compact signature variant for lumi.switch.l2aeu1 without extra endpoints.
tests/test_xiaomi.py Adds a signature-match test covering the new compact signature variant.

You can also share your feedback on Copilot code review. Take the survey.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.04%. Comparing base (380135d) to head (8c2db6a).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4829   +/-   ##
=======================================
  Coverage   93.04%   93.04%           
=======================================
  Files         397      397           
  Lines       13248    13250    +2     
=======================================
+ Hits        12327    12329    +2     
  Misses        921      921           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheJulianJES TheJulianJES added the Xiaomi Request/PR regarding a Xiaomi or Aqara device label Mar 25, 2026
Copilot AI review requested due to automatic review settings March 28, 2026 06:59
Adds AqaraH1DoubleRockerSwitchNoNeutralAlt2 for devices that report
Alarms cluster on EP1 and MultistateInput + OppleSwitch on EP2.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TomK TomK force-pushed the fix/l2aeu1-no-extra-endpoints branch from 0c7e261 to 8c2db6a Compare March 28, 2026 07:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional v1 quirk signature matching for the Aqara H1 Double Rocker Switch (no neutral) lumi.switch.l2aeu1 so the Xiaomi Opple cluster-based configuration remains available even when some firmware variants omit endpoints 41/42/51.

Changes:

  • Refactors the existing no-neutral quirk into multiple numbered signature variants and adds a new signature for devices missing endpoints 41/42/51.
  • Adds a new test asserting the new “no extra endpoints” signature matches the intended quirk class.
  • Updates Xiaomi tests to import the new quirk module.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

File Description
zhaquirks/xiaomi/aqara/switch_h1_double.py Adds/renames lumi.switch.l2aeu1 signature variants, including one that matches devices without endpoints 41/42/51.
tests/test_xiaomi.py Imports the quirk module and adds a signature-matching test for the new variant.
Comments suppressed due to low confidence (1)

zhaquirks/xiaomi/aqara/switch_h1_double.py:145

  • The new/renamed no-neutral quirk class names (…NoNeutral1/2/3/4) aren’t self-descriptive about what signature each one matches, and the PR description references a variant name (e.g., “...Compact”) that doesn’t exist in code. Consider using descriptive suffixes (e.g., “…NoExtraEndpoints”, “…WithExtraEndpoints”) or otherwise aligning class names with the documented variants to make future maintenance/debugging easier.
class AqaraH1DoubleRockerSwitchNoNeutral2(XiaomiOpple2ButtonSwitchBase):
    """Aqara H1 Double Rocker Switch (no neutral) alternative signature."""

    signature = {

Comment on lines +243 to +247
class AqaraH1DoubleRockerSwitchNoNeutralAlt2(XiaomiOpple2ButtonSwitchBase):
"""Aqara H1 Double Rocker Switch (no neutral). Alarms on EP1, Opple on EP2."""

signature = {
MODELS_INFO: [(LUMI, "lumi.switch.l2aeu1")],
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR’s description/title focus on adding the “Opple on EP1+EP2, no extra endpoints” signature variant, but this diff also adds a new variant for a different signature shape (“Alarms on EP1, Opple on EP2”). Either update the PR description/title to include this additional variant (and why it’s needed here vs PR #4360), or drop this extra change to keep the PR scoped to the stated variant.

Copilot uses AI. Check for mistakes.
Comment on lines +243 to +291
class AqaraH1DoubleRockerSwitchNoNeutralAlt2(XiaomiOpple2ButtonSwitchBase):
"""Aqara H1 Double Rocker Switch (no neutral). Alarms on EP1, Opple on EP2."""

signature = {
MODELS_INFO: [(LUMI, "lumi.switch.l2aeu1")],
ENDPOINTS: {
# input_clusters=[0, 2, 3, 4, 5, 6, 9], output_clusters=[10, 25]
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,
OnOff.cluster_id,
Alarms.cluster_id,
],
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,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
MultistateInput.cluster_id,
OppleSwitchCluster.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [
GreenPowerProxy.cluster_id,
],
},
},
}
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new signature variant class is introduced here, but the added test only asserts signature matching for AqaraH1DoubleRockerSwitchNoNeutral2. If this variant is intended to stay, please add a corresponding assert_signature_matches_quirk test case for AqaraH1DoubleRockerSwitchNoNeutral4 so future refactors don’t silently break matching for this signature shape.

Suggested change
class AqaraH1DoubleRockerSwitchNoNeutralAlt2(XiaomiOpple2ButtonSwitchBase):
"""Aqara H1 Double Rocker Switch (no neutral). Alarms on EP1, Opple on EP2."""
signature = {
MODELS_INFO: [(LUMI, "lumi.switch.l2aeu1")],
ENDPOINTS: {
# input_clusters=[0, 2, 3, 4, 5, 6, 9], output_clusters=[10, 25]
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,
OnOff.cluster_id,
Alarms.cluster_id,
],
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,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
MultistateInput.cluster_id,
OppleSwitchCluster.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [
GreenPowerProxy.cluster_id,
],
},
},
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Xiaomi Request/PR regarding a Xiaomi or Aqara device

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants