-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add signature for Aqara H1 double switch lumi.switch.n2aeu1
#2826
Conversation
This uses `XiaomiOpple2ButtonSwitch1` and `XiaomiOpple2ButtonSwitch4` from `opple_switch.py` for the double H1 rocker switches (with neutral), but still keeps them in the separate `switch_h1_double.py` file.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2826 +/- ##
=======================================
Coverage 87.37% 87.37%
=======================================
Files 287 287
Lines 8847 8848 +1
=======================================
+ Hits 7730 7731 +1
Misses 1117 1117 ☔ View full report in Codecov by Sentry. |
}, | ||
ENDPOINTS: XiaomiOpple2ButtonSwitch1.signature[ENDPOINTS], | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheJulianJES It looks to me like there may be another signature missing here for the Aqara H1 Double Rocker Switch (with neutral) model lumi.switch.n2aeu1.
I have a ""lumi.switch.n2aeu1" device with the following 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=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": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x0000",
"0x0002",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0009",
"0x0702",
"0x0b04"
],
"output_clusters": [
"0x000a",
"0x0019"
]
},
"2": {
"profile_id": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x0000",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0012",
"0xfcc0"
],
"output_clusters": []
},
"242": {
"profile_id": "0xa1e0",
"device_type": "0x0061",
"input_clusters": [],
"output_clusters": [
"0x0021"
]
}
},
"manufacturer": "LUMI",
"model": "lumi.switch.n2aeu1",
"class": "zigpy.device.Device"
}
Which seems to match XiaomiOpple2ButtonSwitch3
Do you think this variant could be added as well? Or am I overlooking something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll PR it. When you delete it from ZHA and re-pair it (maybe repeating that multiple times), does it also report a different signature sometimes? Wondering if XiaomiOpple2ButtonSwitch2
also matches these EU switches sometimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually yes, re-pairing gives different signatures as well unfortunately.
I just got the following 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=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": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x0000",
"0x0002",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0012",
"0xfcc0"
],
"output_clusters": [
"0x000a",
"0x0019"
]
},
"2": {
"profile_id": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x0000",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0012",
"0xfcc0"
],
"output_clusters": []
},
"21": {
"profile_id": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x000c"
],
"output_clusters": []
},
"31": {
"profile_id": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x000c"
],
"output_clusters": []
},
"41": {
"profile_id": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x0012"
],
"output_clusters": []
},
"42": {
"profile_id": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x0012"
],
"output_clusters": []
},
"51": {
"profile_id": "0x0104",
"device_type": "0x0100",
"input_clusters": [
"0x0012"
],
"output_clusters": []
},
"242": {
"profile_id": "0xa1e0",
"device_type": "0x0061",
"input_clusters": [],
"output_clusters": [
"0x0021"
]
}
},
"manufacturer": "LUMI",
"model": "lumi.switch.n2aeu1",
"class": "zigpy.device.Device"
}
Which is again different than before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one is already addressed in HA Core 2023.12.4.
…2826) * Remove double space in comment * Add/fix cluster id comments * Use `OppleSwitchCluster.cluster_id` instead of `0xFCC0` * Use `ElectricalMeasurement.cluster_id` instead of `0x0B04` * Add alternative signature based on `XiaomiOpple2ButtonSwitch` * Add commas at end of list to be consistent * Deduplicate `lumi.switch.n2aeu1` signatures This uses `XiaomiOpple2ButtonSwitch1` and `XiaomiOpple2ButtonSwitch4` from `opple_switch.py` for the double H1 rocker switches (with neutral), but still keeps them in the separate `switch_h1_double.py` file.
…2826) * Remove double space in comment * Add/fix cluster id comments * Use `OppleSwitchCluster.cluster_id` instead of `0xFCC0` * Use `ElectricalMeasurement.cluster_id` instead of `0x0B04` * Add alternative signature based on `XiaomiOpple2ButtonSwitch` * Add commas at end of list to be consistent * Deduplicate `lumi.switch.n2aeu1` signatures This uses `XiaomiOpple2ButtonSwitch1` and `XiaomiOpple2ButtonSwitch4` from `opple_switch.py` for the double H1 rocker switches (with neutral), but still keeps them in the separate `switch_h1_double.py` file.
Proposed change
Adds an alternative signature for the Aqara H1 double rocker switch (with neutral)
lumi.switch.n2aeu1
.The following small changes are also done:
cluster.cluster_id
signature
are added to be consistent with the other Opple/H1 switch quirksWhy use part of the signature from
opple_switch.py
instead of just adding new model info there?The
opple_switch.py
file contains signatures strictly from the USlumi.switch.b2naus01
switch now.The
switch_h1_double.py
file contains signatures for H1 double switches, but now also bases two quirks off the signatures inopple_switch.py
and only changes theMODELS_INFO
in itssignature
.To avoid the confusion that was caused around this in the past, I've opted to do it this way to keep the US switch vs EU H1 quirks somewhat separate.
All H1 quirks are now either in
switch_h1_double.py
orswitch_h1_single.py
. In the past, they were split in a very non-intuitive way.Additional information
lumi.switch.b2naus01
#2825Checklist
pre-commit
checks pass / the code has been formatted using Black