Fix POP01 encoding bug + harden grid-cal revert verification
Root cause of the grid-calibration auto-revert silently failing: lvx-control and flash.py encode output_priority solar_battery_utility as "POP01", but PI18 POP is single-digit — the inverter silently rejects "POP01" (raw "POP1" works, matches the POP_PIRI decoder). Compounded by powermon's adhoc queue wedging, which dropped commands entirely until a restart. So the monitor logged "revert done" while the cluster sat in SUB/grid mode for ~1.5h (no harm: battery full, just running loads on grid). - lvx-control + flash.py: POP_MAP "01" -> "1" (also patched the live /usr/local/bin/lvx-control + restarted; verified it now emits POP1). - grid-cal-monitor: revert now VERIFIES via behavior (line_power_direction leaves 'input'), and on failure restarts powermon and re-sends raw POP1/PCP0,0, with a loud manual-fallback message. No more trust-the-publish. Recovery for the live run: restarted powermon (unstuck adhoc) + raw POP1 + PCP0,0; confirmed POP=Solar-Battery-Utility, PCP=Solar First, mode=Battery, line_dir=donothing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ ADHOC_TOPICS = (
|
||||
# Intentionally a strict subset of flash.py's SCHEDULE — only the safe,
|
||||
# day-to-day knobs. The risky-end calibration setters live in flash.py.
|
||||
|
||||
POP_MAP = {"solar_utility_battery": "0", "solar_battery_utility": "01"}
|
||||
POP_MAP = {"solar_utility_battery": "0", "solar_battery_utility": "1"} # PI18 POP is single-digit; "01" is malformed -> inverter silently rejects (confirmed 2026-06-25, broke a calibration auto-revert)
|
||||
PCP_MAP = {"solar_first": "0", "solar_and_utility": "1", "solar_only": "2"}
|
||||
PSP_MAP = {"battery_load_utility_ac": "0", "load_battery_utility": "1"}
|
||||
ALLOWED_MCHGC = (10, 20, 30, 40, 50, 60, 70, 80)
|
||||
|
||||
Reference in New Issue
Block a user