Status (2026-12-04): nothing has been changed by this writeup. The two existing offsets (GrowTent2 CO₂ monitor, 2026-11-29) are already live in the Prometheus rule layer. The calibration-table machinery and the weekly loop below are a plan awaiting authorization to deploy. This is the runbook to follow once approved.
This is the durable procedure for keeping the 13 Govee sensors feeding the citrus/greenhouse/tent dashboards accurate — both at day zero (pre-deployment baseline) and week over week (drift), for temperature and humidity.
The chain is: sensor → gateway → Govee cloud → Home Assistant (govee custom component, polls the cloud API every ~5 min) → Prometheus (homeassistant scrape job) → citrus-rules.yml recording rules → Grafana dashboards + unified alerting → ntfy/bark/email.
Raw values arrive as homeassistant_citrus_temperature_c / homeassistant_citrus_humidity_percent / homeassistant_citrus_co2_ppm. Every dashboard and all 15 alert rules read only the recording series (citrus_temperature_c, citrus_humidity_percent, citrus_vpd_kpa, citrus_battery_percent). That makes the recording-rule file the single choke point: one edit there corrects dashboards, VPD math, and alerts together, and Prometheus keeps the offset's history for free.
| Place | Verdict | Why |
|---|---|---|
| Govee Home app "calibration" | keep at zero | All three models support it, but the entry is an absolute target value (type 80 °F, and the device infers the delta), and the offset never reaches this stack: HA core issues #108887 and #121621 show HA reports the pre-calibration value, the cloud API returns raw tem/hum with the calibration as separate display metadata, and grep -i calib inside the HA govee component finds zero calibration code. It also desyncs the Govee app from Grafana and stores no audit trail. |
| Grafana transform at ingest | no | Transforms are per-panel (six citrus dashboards, every future panel), invisible to Prometheus, and absent for alert rules — an alert would evaluate the uncalibrated value while the graph shows the calibrated one. |
| Prometheus recording rules | yes | One edit → every surface + all alerts. Dated edits = permanent drift history. Prometheus is the only place already on the write path that dashboards and alerts share. |
| Model | Qty | Placements | Spec accuracy | Power / transport |
|---|---|---|---|---|
| Govee H5100 | 5 | Greenhouse Floor/Roof, GrowTent1, LivingRoom, UnheatedGarage | ±0.54 °F / ±0.3 °C; ±3 %RH | CR2016, BLE → H5151 Wi-Fi gateway (max 10) |
| GoveeLife H5107 (Thermo-Hygrometer 3 Lite) | 6 | GrowTent2, DeckCitrus, ColdFrame, IchangLemon, WorkoutRoom, Loquat (H5100 fire-yard trio retired 2026-12-04) | ±0.3 °C (0–60 °C), ±0.5 °C below 0 °C; ±3 %RH | 2×AAA, LoRa 915 MHz → kit gateway (max 30), IP65 |
| GoveeLife H5140 (Air Quality Monitor) | 2 | GrowTent2-Co2Monitor, MainBedroom-Co2Monitor | temp ±0.3 °C; RH ±2–3 %; CO₂ ±(40 ppm + 5 %) | USB-C mains, Wi-Fi direct, Sensirion SCD4x NDIR |
Official product pages:

Two offsets exist, both in /var/www/monitoring/prometheus/alerts/citrus-rules.yml since 2026-11-29 (they show up in Grafana because every panel reads the corrected series):
GrowTent2-Co2Monitor temperature: −1.0 °C — the mains-powered unit self-heats (+1.0…2.2 °C vs neighbors when tent lights are on, ~0 at night).GrowTent2-Co2Monitor humidity: +3.5 %RH — reads 2.7–3.8 %RH low, consistent with that same self-heating.These are placement corrections (self-heating), not sensor error. Everything else runs at offset 0. Known blind spot: MainBedroom-Co2Monitor has no co-located sensor, so the weekly consensus below will never see it — only the quarterly anchor round covers it.
Goal: measure each probe's intrinsic error while every sensor is in the same air, and archive those numbers as day zero. Weekly corrections thereafter are expressed relative to this baseline, so intrinsic error and placement effects stay separable.
fleet median − sensor median (temp and RH separately), plus one absolute RH anchor = fleet median − 75.4 (using the bin's air temperature row from the salt table above). Write those rows into the calibration table with basis baseline-bin-YYYYMMDD (see machinery below). These rows are never edited — they are day zero.Co-located battery Govees are interchangeable to ~±0.3 °C, so any group of them is a standing reference for each other. Drift between pair-mates is invisible in a group average (the sum is invariant) but obvious in the difference — which is exactly what to plot.
Consensus groups: GrowTent2 (H5107 + corrected CO₂ monitor) · Greenhouse (Floor+Roof) · indoor comfort (LivingRoom, WorkoutRoom, IchangLemon) · plus any two co-located sensors you add.
Weekly (a cron report, human-gated at first):
quantile_over_time(0.5, (sum(citrus_temperature_c{friendly_name="H5100_GreenhouseRoof"}) - sum(citrus_temperature_c{friendly_name="H5100_GreenhouseFloor"}))[14d:10m]) — the bare sum() wrappers are required: each sensor's series carries its own entity label, so a naive A - B matches nothing.The weekly loop is blind to fleet-wide drift by construction (if all 11 probes drift together, all differences stay zero). That's what Phase C exists for.
RH is the dominant error term for the alerts that matter: at ~77 °F, ±5 %RH moves VPD by ≈0.35 kPa while ±1 °F moves it only ≈0.11 kPa — the VPD > 2.0 kPa stress alert is ~3× more RH-sensitive than temperature-sensitive. So RH calibration is not an add-on; it is the main event. Caveats: never anchor above ~80 %RH (condensation risk biases readings high), expect the tent RH sensor to drift fastest (membrane fouling in persistent high humidity), and remember the CO₂ monitors' RH error is mostly self-heating — correct it in situ, not in a jar.
One CSV is the source of truth; everything else is derived:
# config/govee-calibration.csv (corrected = raw + offset)
friendly_name,entity,quantity,offset,effective_date,basis
GrowTent2-Co2Monitor,growtent2_co2monitor,temp_c,-1.0,2026-11-29,self-heating-mains-unit-vs-h5107-growtent2
GrowTent2-Co2Monitor,growtent2_co2monitor,rh_pct,3.5,2026-11-29,self-heating-mains-unit-vs-h5107-growtent2
H5100_GrowTent1,h5100_growtent1,temp_c,0,2026-12-04,placeholder-every-sensor-has-a-row
entity must equal the home sensor id exactly — it is the join key into the raw scraped series.or-guard gymnastics from the PromQL joins.cal2textfile.py) converts the CSV to node-collector textfile metrics: govee_cal_temp_c{entity="sensor.h5100_growtent1_temperature",...} into the already-scraped textfile dir.- record: citrus_temperature_c
expr: |
label_replace(
avg by (entity, domain, friendly_name) (homeassistant_citrus_temperature_c{friendly_name=~".+"})
+ on(entity) group_left()
last_over_time(govee_cal_temp_c[7d]),
"friendly_name", "$1", "friendly_name", "(.*) Temperature$")
citrus-rules.yml, edit, promtool check rules, reload Prometheus, verify a known panel value moved by exactly the delta, git push same turn. Rollback = restore backup.govee_cal_temp_c - (govee_cal_temp_c offset 90d) — literally "corrections since day zero", plus the raw-vs-calibrated overlay.LivingRoom stays exempt from comfort alerts regardless of calibration.# raw vs corrected for one device
homeassistant_citrus_temperature_c{entity="sensor.h5100_greenhouseroof_temperature"}
citrus_temperature_c{friendly_name="H5100_GreenhouseRoof"}
# 14-day consensus difference between two co-located sensors
# (sum() wrappers required — see "weekly loop" above)
quantile_over_time(0.5,
(sum(citrus_temperature_c{friendly_name="H5100_GreenhouseRoof"})
- sum(citrus_temperature_c{friendly_name="H5100_GreenhouseFloor"}))[14d:10m])
# spread of the whole corrected fleet right now (health of consensus)
stddev(citrus_temperature_c{friendly_name!~".*Co2Monitor.*"})
# its 14-day trend — rising = drift, stable = consensus healthy
stddev_over_time(stddev(citrus_temperature_c{friendly_name!~".*Co2Monitor.*"})[14d:1h])
Sensor swaps: Prometheus cannot rename stored series, so a one-time
citrus_bridge group in the recording rules re-emits the retired device's live series
under the new entity id from swap day forward (with an unless gate so the new sensor
takes over silently the moment it reports). See prometheus/citrus-calibration-rules.yml
in the repo for the exact bridge used when the yard Loquat became H5107_Loquat.
The whole apparatus lives in one small git repo (scripts/, config/,
cron/, prometheus/). Ours is an internal LAN-only remote, so the parts
worth copying are inlined here — nothing about them is secret.
config/consensus-groups.csv — which sensors share the same air:
group,friendly_names
growtent2,GrowTent2-Co2Monitor|H5107_GrowTent2
greenhouse,H5100_GreenhouseRoof|H5100_GreenhouseFloor
# yard-trio,ProbeA|ProbeB|ProbeC # distinct microclimates: consensus needs SAME air
# indoor-comfort,H5100_LivingRoom|H5107_WorkoutRoom|H5107_IchangLemon # distinct rooms
Those commented groups are a live lesson: the first run of the drift loop "proposed" 0.5–40 unit corrections for yard and cross-room pairs — stable placement facts, not drift. The caps caught them; the fix was the group file. Only same-air sensors belong in a group.
scripts/drift_report.py core — per-pair consensus with deadbands and
caps; prints proposals to a side file, never edits the table itself:
def median_diff(metric, a, b, window="14d", step="10m"):
# bare sum() collapses each side to an empty label set so the two
# series match 1:1 (they never share entity/friendly_name values).
q = (f'quantile_over_time(0.5, (sum({metric}{{friendly_name="{a}"}}) - '
f'sum({metric}{{friendly_name="{b}"}}))[{window}:{step}])')
return prom_instant(q)
# deadband ±0.4 C / ±4 %RH; per-change cap ±0.5 C / ±3 %RH;
# running-total cap ±1.5 C / ±5 %RH
scripts/cal2textfile.py keeps the newest non-future row per
sensor+quantity and writes gauges like
govee_cal_temp_c{entity="sensor.h5107_coldframe_temperature",friendly_name="H5107_ColdFrame",effective_date="2026-12-04",basis="..."} -0.4
atomically into the textfile dir. Future-dated rows = staged, not active.
scripts/baseline_session.py takes --start/--end of a bin soak and
emits day-zero CSV rows: per-sensor median vs the fleet median (averaging
±0.3 °C spec noise over 11 sensors beats one reference probe), plus a
fleet-wide RH shift from the salt reference (75.3 %RH at 25 °C).
cron/govee-calibration.cron:
*/5 * * * * root cd /opt/govee-calibration && python3 scripts/cal2textfile.py
15 7 * * 1 root cd /opt/govee-calibration && python3 scripts/drift_report.py --proposed config/govee-calibration.csv.proposed >> /var/log/govee-drift.log 2>&1