Skip to content
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

Fix Aqara motion sensor erroneous motion events #2779

Merged

Conversation

TheJulianJES
Copy link
Collaborator

@TheJulianJES TheJulianJES commented Nov 27, 2023

Proposed change

The Aqara T1 motion sensor sends false attribute reports about every hour or so on the Occupancy cluster. Just using a LocalDataCluster doesn't ignore them, so we override handle_cluster_general_request.
The same fix is also applied for the Aqara "high-precision" agl04 motion sensor.

This was reported via Discord.

Additional information

We should also consider using a LocalMotionCluster for this sensor in the future (like the P1 quirk already does).
A 60 second timeout also works for this sensor.

Ideally, we should also figure out if this is needed for the "high-precision" agl04 motion sensor.
-> yes, see home-assistant/core#114129

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

@TheJulianJES TheJulianJES added the bugfix This PR fixes a bug label Nov 27, 2023
@TheJulianJES TheJulianJES changed the title Use LocalDataCluster for Occupancy cluster Fix Aqara T1 motion sensor erroneous motion events Nov 27, 2023
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.90%. Comparing base (ef83953) to head (7503f7f).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2779   +/-   ##
=======================================
  Coverage   87.90%   87.90%           
=======================================
  Files         300      300           
  Lines        9218     9222    +4     
=======================================
+ Hits         8103     8107    +4     
  Misses       1115     1115           

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

@TheJulianJES TheJulianJES added the Xiaomi Request/PR regarding a Xiaomi device label Dec 24, 2023
@TheJulianJES
Copy link
Collaborator Author

Unfortunately, the person who had these issues and was testing this is no longer responding.

For anyone else with the Aqara T1 motion sensor who experiences "ghost detections", please test this as a custom quirk and report back if that corrects it.

@TheJulianJES TheJulianJES force-pushed the tjj/fix_aqara_t1_motion_sensor_part_2 branch from 2cf6736 to 86b91e0 Compare March 27, 2024 14:33
@TheJulianJES TheJulianJES marked this pull request as ready for review March 27, 2024 14:34
Works, but I don't want to change it in this PR.
@TheJulianJES TheJulianJES changed the title Fix Aqara T1 motion sensor erroneous motion events Fix Aqara motion sensor erroneous motion events Mar 27, 2024
@TheJulianJES TheJulianJES merged commit 9ccb69a into zigpy:dev Mar 27, 2024
6 checks passed
@HA-smart
Copy link

image
I don't really understand what I need to change

@TheJulianJES
Copy link
Collaborator Author

I don't really understand what I need to change

There are fixes for the Aqara T1 motion sensor and Aqara high-precision motion sensor in Home Assistant Core 2024.4.0 (in beta currently). There's nothing for you to change.

@stast1
Copy link

stast1 commented Apr 6, 2024

lumi.motion.agl04 does not work after update. Does not detect motion. Never.

@TheJulianJES
Copy link
Collaborator Author

@stast1 Please create a new issue. Also, try re-pairing the sensor.

@stast1
Copy link

stast1 commented Apr 6, 2024

home-assistant/core#115027
Re-pairing doesn't help

lgraf pushed a commit to lgraf/zha-device-handlers that referenced this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR fixes a bug Xiaomi Request/PR regarding a Xiaomi device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants