feat: add support for Mopeka Standard "Check" sensors - #97
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
==========================================
+ Coverage 91.48% 94.00% +2.51%
==========================================
Files 3 3
Lines 94 150 +56
Branches 5 12 +7
==========================================
+ Hits 86 141 +55
Misses 5 5
- Partials 3 4 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The Standard sensor (service 0xADA0) is a different protocol from the Pro line: it broadcasts raw ultrasonic echo data, so the client runs the peak-detection + LPG speed-of-sound math itself. This ports ESPHome's mopeka_std_check algorithm. _start_update dispatches Standard adverts to a new _update_std; the existing Pro path is unchanged. Emits tank_level (mm), temperature, battery, battery_voltage, and reading_quality. Validated against real hardware (matches the Mopeka Check app).
b9d72db to
71c43e3
Compare
PR Review — feat: add support for Mopeka Standard "Check" sensorsApprove with nits. I verified the decode bit-for-bit against the ESPHome reference — the algorithm is faithful, and every test assertion is arithmetically correct. All findings are non-blocking. Specific things done well:
What I could not verify: no environment with Key issues (all
On your open question about test style: converting to the full 🟢 Suggestions
1. Advert length constant is the struct size (19), not the wire length (23) ESPHome validates
|
bluetoothbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
What / why
The decode in
mopeka-iot-blecurrently supports only the Pro family (Nordic manufacturer0x59, service0xFEE5). The original Standard "Check" sensor (e.g. Mopeka8015004) is a different device — a TI chip advertising service UUID0xADA0— and is silently dropped today.Unlike the Pro (which computes the level on-device), the Standard sensor broadcasts raw ultrasonic echo data (12 time/amplitude pairs); the client must run peak-detection and the LPG speed-of-sound calculation. This ports that algorithm from ESPHome's
mopeka_std_check.Changes
_start_updategains one guard that routes Standard adverts (service0xADA0) to a new_update_stdmethod. The existing Pro path is untouched._update_stdemits the same keys as the Pro path where applicable:tank_level(mm),temperature,battery,battery_voltage,reading_quality,reading_quality_raw.0x02), XL (0x03), Standard-Alt (0x44), eTrailer (0x46).tests/test_standard.py: full decode, no-usable-echo, unsupported-id, and a Pro-path regression check.Validation
Validated against real hardware — a Mopeka Standard Check sensor decodes to values matching the Mopeka Check phone app (20 lb tank reading, temperature, battery). Tests use constructed advertisements with hand-verified expected outputs.
Notes
SensorUpdatesnapshot style used intest_parser.py).0xADA0Bluetooth matcher to themopekaintegration manifest so these are discovered; the existing config flow + sensor descriptions already handle the emitted entities.Credit: decoding algorithm ported from ESPHome (
mopeka_std_check).