Fix Aqara FP1E using incorrect manufacturer code#4749
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4749 +/- ##
=======================================
Coverage 92.32% 92.32%
=======================================
Files 371 371
Lines 12195 12195
=======================================
Hits 11259 11259
Misses 936 936 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Z2M ignores the manufacturer code for attribute reports. For writing, it's using it for this device for both the restart and spatial learning writes ( However, using both buttons in ZHA seems to work fine without the manufacturer code/bit, so I think we're actually doing this more correct with this PR, though the sensor seems to ignore it anyway. |
|
Paired an FP1E on HA 2026.2.1, reproduced the issue, applied the fix from this PR, and could no longer reproduce it. |
There was a problem hiding this comment.
Pull request overview
This PR fixes the Aqara FP1E (lumi.sensor_occupy.agl1) presence sensor quirk to correctly handle attribute reports from the device. The device sends manufacturer-specific attribute reports without the manufacturer code bit set, which prevented ZHA from parsing them correctly. The fix migrates from the deprecated is_manufacturer_specific=True pattern to the modern manufacturer_code=None approach.
Changes:
- Replaced
is_manufacturer_specific=Truewithmanufacturer_code=Nonefor all 7 manufacturer-specific attributes in the OppleCluster class
|
Ok, so I wasn't sure why this actually broke now, as you mentioned we still somewhat process attribute reports if the manufacturer code doesn't match the definition, but the reason is kind of stupid if I'm correct: From what I understand, we took this path (without the PR):
This isn't great because we first match with manufacturer code and fail to find a definition, but That should be somewhat improved with zigpy/zigpy#1760 and TheJulianJES/zigpy@tjj/manufacturer_update_fix...TheJulianJES:zigpy:tjj/manufacturer_update_fix_with_mfr_attr_fix_zcl_cache. But I think it still needs to be looked at afterwards. The behavior will be more consistent with those PRs, but yeah. Maybe not fully perfect yet if we can't find a definition. |
Proposed change
This changes the attribute definition's manufacturer codes to
Nonefor the Aqara FP1E mm-wave sensor.Otherwise, we aren't parsing the attribute reports from the device, since they don't have the manufacturer bit set.
For writes, it looks like the manufacturer code doesn't matter at all(??)
Additional information
Should address home-assistant/core#162484
Device diagnostics
zha-01KAH6BZ8GBKBJXCPX8V4BB4KP-Aqara Presence Sensor FP1E-73e318d90a5606426bd23584f7e84776.json
Checklist
pre-commitchecks pass / the code has been formatted using Black