feat: add BGT and WBGT temperature data point support - #1401
feat: add BGT and WBGT temperature data point support#1401timothybrown wants to merge 2 commits into
Conversation
Ecowitt gateways with WH32/WN38 BGT sensors send `bgt` (Black Globe Temperature) and `wbgt` (Wet Bulb Globe Temperature) fields in their HTTP payload. These values are always in Fahrenheit and were previously unrecognized, causing raw values to pass through without unit conversion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1401 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 33 33
Lines 1797 1799 +2
=========================================
+ Hits 1797 1799 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There hasn't been any activity on this pull request recently, so it has automatically been marked as stale and will be closed if no further action occurs within 7 days. Thank you for your contributions. |
The `format` pre-commit hook (ruff 0.7.3) collapsed three multi-line signatures and two parametrize entries that fit on one line, failing the Linting & Static Analysis CI job. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Should be fixed. The only failing hook was One I can't fix from here: the Docker publish job fails with "Username and password required" since fork PRs don't get the repo secrets. It failed the same way on the previous run. Looks like CI needs your approval to run on the new commit. |
Describe what the PR does:
Adds explicit data point support for BGT (Black Globe Temperature) and WBGT (Wet Bulb Globe Temperature), which are reported by Ecowitt gateways (e.g., GW3000B) when a WH32-based black globe thermometer sensor is connected.
Currently,
bgtandwbgtpayload keys are not recognized by theCALCULATOR_MAP. When--output-unit-system metricis set, theTemperatureCalculatoris never invoked for these fields, so the raw Fahrenheit values are passed through to MQTT unconverted. Downstream consumers receive values in Fahrenheit despite requesting metric output.This PR adds
DATA_POINT_BGTandDATA_POINT_WBGTconstants and maps them toTemperatureCalculator, so they follow the same unit conversion path as all other temperature data points.bgtbatt(the BGT sensor's battery status) already works correctly viaglob_searchsubstring matching on "batt" — no changes needed, but a test is included to confirm this.Does this fix a specific issue?
No existing issue — discovered while building a dashboard that consumes ecowitt2mqtt output.
Checklist:
README.mdwith any new documentation.README update not included — BGT/WBGT are standard Ecowitt payload fields that now "just work" like any other temperature field. Happy to add documentation if preferred.