Repository navigation
feat: add support for ZenMeasure CO2 Monitor Lite (MHO-H413) - #414
Open
DanielHou315 wants to merge 3 commits into
Open
DanielHou315 wants to merge 3 commits into
DanielHou315 wants to merge 3 commits into
Conversation
Add product ID 0x6BDF and a parser for MiBeacon object 0x4C1D, which the MHO-H413 uses for CO2 concentration (uint16, ppm). Temperature (0x4C01) and humidity (0x4C08) already parse as floats. The device sends one encrypted object per advertisement with frame control 0x5948 (no MAC in the frame), plus unencrypted header-only beacons. Tests use synthetic frames built with a dummy bindkey.
It advertises in bursts with multi-minute gaps, so Home Assistant's learned advertising interval marks it unavailable between bursts.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #414 +/- ##
==========================================
+ Coverage 61.74% 61.87% +0.13%
==========================================
Files 7 7
Lines 1448 1453 +5
Branches 290 291 +1
==========================================
+ Hits 894 899 +5
Misses 430 430
Partials 124 124 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ZenMeasure / Miaomiaoce CO2 Monitor Lite (MHO-H413), a Mijia BLE temperature + humidity + CO2 sensor.
Changes
devices.py: product ID0x6BDF→CO2 Monitor Lite/MHO-H413/ZenMeasuredevices.py: addMHO-H413toSLEEPY_DEVICE_MODELS. It advertises in bursts with gaps of several minutes, so without this Home Assistant flips the entities to unavailable roughly every 5 minutes (seen over 10 h of real use)parser.py: new object0x4C1D→ CO2 (uint16 LE, ppm) viaSensorLibrary.CO2__CONCENTRATION_PARTS_PER_MILLION0x4C01), humidity (0x4C08), CO2 (0x4C1D) and the unencrypted header-only beaconHow the device behaves (captured from a real unit)
0x5830/0x5A30: MAC + capability, no objects)0x5948(encrypted, object included, no MAC in frame), one object per advertisement roughly every 1–2 min:0x4C01float32 → 22.8 °C0x4C08float32 → 54.0 %0x4C1Duint16 → 951 ppm (later 1007 ppm vs 1008 on the device display)Test frames are synthetic (dummy bindkey
00112233…), built to match the real frame layout.Notes
xiaomi_blesensor.pyhas no(CO2, ppm)entry inSENSOR_DESCRIPTIONS, so HA needs a matching one-entry change to expose the CO2 sensor.