Set min/max normal and min/max warning display bands for each probe using historical data. Use when the dashboard gauges show incorrect ranges or the user wants the UI calibrated to their tank.
Start by calling get_agent_context to load tank facts and persona settings.
Load context — call get_agent_context. Note the tank type (reef, FOWLR, freshwater) and any target parameters revealed by alert rules.
Fetch current parameters — call get_current_parameters to get all probe names and live values.
Fetch probe configs — call list_probe_configs to see which probes already have display bands configured and what the current values are.
Fetch historical data — call get_probe_history for each probe (period: 30d). Compute:
Determine display bands for each probe using this logic:
Normal band ( / ) — the range where the probe reads "healthy". Should encompass the probe's typical variation without alarming the user.
min_normalmax_normalWarning band (min_warning / max_warning) — the outer limit before the gauge turns red. Beyond this, something is wrong.
Flat probes (daily swing < 0.5% of range): use a tight normal band centered on the observed mean; keep warning band wide.
Present a calibration plan in a table:
| Probe | Current Value | Min Warning | Min Normal | Max Normal | Max Warning | Basis |
|---|
Mark probes that already have correct config as ✓, probes that need updating as ⚠.
Confirm before applying — ask the user to review the table and approve before writing any changes. Allow the user to adjust individual values before confirming.
Apply approved changes — for each confirmed probe, call update_probe_config with the new band values.
Log the calibration — call add_journal_entry (category: maintenance, sentiment: neutral) noting how many probes were calibrated and the basis (30-day historical data).