question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Device Support Request] Aqara Light Sensor T1 shows up as mains power instead of battery

See original GitHub issue

Is 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.

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:35 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
javicallecommented, Apr 16, 2022

Which way would you use/recommend?

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 🤷🏻‍♂️

2reactions
Tropaioncommented, Apr 15, 2022

@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 provided NODE_DESCRIPTOR and doesn’t “replace” it entirely.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aqara Lumi light sensor power as mains instead of battery?
Report a new issue as a “Device support request” to the ZHA Device ... the light sensor but it still shows up as...
Read more >
Faq - Aqara
2. The battery is low or dead; 3. The sensor is installed on a metal surface and the signal is disturbed." 4.How to...
Read more >
Low Battery Issue - Aqara Single Switch Module T1 ... - GitHub
Single Switch module shows with a not existing empty battery in Homebridge when setup in Phoscon as "lumi.switch.n0agl1", Describe the bug ...
Read more >
[ST Edge/Beta] Xiaomi/Aqara/Tuya zigbee sensors driver
It is normal that you see battery 0% for up to 2 hours after pairing. If the problem persists, please collect logs for...
Read more >
Aqara Zigbee Hubs and Their Differences (updated 27/04/22)
The Aqara hub is capable of supporting up to 32 child devices and uses an ... AC units that require more power, using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found