[Device Support Request] Aqara Light Sensor T1 shows up as mains power instead of battery
See original GitHub issueIs your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I’m always frustrated when […]
I have paired the device about 3 times and have also updated my coordinator (Tubes ZB CC2652P2) to the latest firmware, but the device still shows up as mains power instead of battery (the light sensor is working fine though)
Describe the solution you’d like A clear and concise description of what you want to happen.
Shows battery with the battery level instead of showing as mains power
Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|MainsPowered: 132>, manufacturer_code=4718, 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=True, *is_full_function_device=False, *is_mains_powered=True, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0106",
"in_clusters": [
"0x0000",
"0x0001",
"0x0003",
"0x0400"
],
"out_clusters": [
"0x0003"
]
}
},
"manufacturer": "LUMI",
"model": "lumi.sen_ill.agl01",
"class": "zigpy.device.Device"
}
Additional context Add any other context or screenshots about the feature request here.
Issue Analytics
- State:
- Created a year ago
- Comments:35 (11 by maintainers)
Top GitHub Comments
There is no best or recommended way, it’s a matter of programmer preference.
replacement
is a more ‘declarative’ way, while the other is more ‘programmatic’. Each has its advantages and disadvantages. The important thing is that it is clear to understand (and to maintain). The way you’ve proposed is much clearer, but requires setting ‘more places’ (__init__
&get_node_descriptor
).The more things we learn, the more ability to fix broken things 🤷🏻♂️
@javicalle I followed this quirk which @MattWestb posted which had the same problem: https://github.com/marciogranzotto/zha-device-handlers/blob/0daea0320571c185e423e203c9da7c73d4cbb90c/zhaquirks/tuya/ts0201_zemismart.py It uses
__init__
to clear the Mains bit, I thought this is a bit better since it only clears one bit from the providedNODE_DESCRIPTOR
and doesn’t “replace” it entirely.