Commit Graph

17 Commits

Author SHA1 Message Date
4bfa021719 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>
2026-06-25 21:37:16 -04:00
76765a95ed Grid calibration: correct lever is output-priority SUB, add grid-cal-monitor
Discovered live 2026-06-25 driving an actual grid calibration: forcing a full
grid charge is done via OUTPUT PRIORITY, not voltage thresholds.
- SBU (everyday) won't grid-charge unless the bank is critically low; setting
  charger_priority=solar_and_utility alone does nothing at 52V.
- SUB (output_priority=solar_utility_battery) runs loads on grid AND charges the
  battery to full. Combined with charger_priority=solar_and_utility, grid charging
  engages (device_mode->Hybrid/Line, line_dir->input, pack current jumps to ~120A).
- Both POP/PCP set via lvx-control (all-mode-safe, atomic, no flash/USB). Revert
  POP->solar_battery_utility, PCP->solar_first when done.

The re_discharge/flash.py approach is dead (firmware NAKs stop_charge>float);
profile eg4-lp4-v2-calibration.yaml marked DEPRECATED.

- grid-cal-monitor: supervises a SUB grid charge, safety aborts (cell>3.60V/
  temp>45C), detects re-anchor (all 6 packs ->100%), auto-reverts POP+PCP (trap).
- calibration-charge skill §3 rewritten to the POP lever.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 12:35:51 -04:00
4d6c6c109b Correct PV analysis: no down string; peak is charge-cap-limited
Clear-noon peak (2026-06-24 13:44, HA recorder): each inverter ~4.7kW @ ~300V
@ ~16A. A down string reads ~10A; ~16A = both parallel strings live. The
"one string down per inverter" belief was from confounded afternoon/rainy
samples + transient pv_loss_warning (now off) and is refuted.

~66% of nameplate at peak is explained by 45-deg tilt (wrong for high June sun),
heat derate, and tree shading. AND the peak was demand-limited: battery charge
pinned at the 120A cap (121A) at 65% SoC with only 3.3kW load -- reversing the
earlier off-peak "not clipping" note. Documented the throttle test to resolve
true array ceiling before raising max_charging_current.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:41:32 -04:00
5e175d4d0b Fix calibration grid-assist lever: firmware NAKs stop_charge=0/Full
Live run 2026-06-24: flash.py apply NAK'd BUCD480,000 on both inverters — the
firmware rejects stop_charge_voltage=0 ("Full"). flash.py aborts on first setter
failure, so nothing changed and the cluster stayed in sync (verified).

The field flash.py calls stop_charge_voltage is actually the inverter's
battery_re_discharge_voltage (HA: sensor.lvx6048_*_battery_re_discharge_voltage):
the V at which loads switch back to battery after grid charging. 54.0 tops grid
charge to ~54V; raising to 56.0 is the corrected (but UNVALIDATED) lever and may
band-oscillate rather than hold absorption.

- calibration profile: 0 -> 56.0, with the finding documented.
- skill: solar-only is now the RECOMMENDED/known-good method; grid-assist demoted
  to advanced/unvalidated with a mandatory diff-preview gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:14:35 -04:00
f1128e807a Record decision to keep 48.0V discharge floor (improvement #3)
Reviewed the cutoff/stop-discharge floor; deliberately kept at 48.0V (3.00
V/cell) for cycle-life margin. Lowering to 46-47V unlocks only a few % of LFP
capacity and isn't worth deeper cycling on this large, non-capacity-constrained
bank. Comment only; no value change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 12:28:44 -04:00
b5b69f95c1 Correct EG4 profile sizing 3->6 packs; keep 60A charge cap (improvement #2)
- eg4-lp4-v2.yaml: rationale updated 300Ah->600Ah/~30.7kWh; 120A combined is
  now ~0.2C. Charge current deliberately NOT raised to 80A: not clipping — at
  solar noon on a clear day (2026-06-24, ~5.8kW PV) the bank took only 71A of
  the 120A cap. Real harvest limiter is PV (5.8 of 14.4kW nameplate, suspected
  down strings), not the ceiling.
- REFERENCE: pack HA entity_ids are triple-prefixed
  (sensor.eg4_lifepower4_lifepower4_1_lifepower4_1_*) — discover, don't construct.

No setting values changed; documentation/accuracy only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 12:25:48 -04:00
56b2cc2bf1 Add calibration-charge skill to fix EG4 SoC counter drift (improvement #1)
The everyday profile caps grid charging at 54V, so the bank can go weeks
without a full charge and the EG4 BMS coulomb counters drift (proven: pack 6
read 76% SoC while at the same 53.4V/3.337V-per-cell as packs reading 50-55%
— all paralleled, so physically equal charge; the spread is pure drift).

- profiles/eg4-lp4-v2-calibration.yaml: temporary profile, identical to
  canonical except stop_charge_voltage 54.0 -> 0 (Full), so grid can finish a
  full charge to the 56.4V absorption hold that re-anchors every pack to 100%.
- calibration-charge skill: guided runbook (pre-flight safety, two methods
  solar-only / grid-assist, live monitoring with cell-voltage/temp aborts,
  re-anchor verification, mandatory revert).
- REFERENCE: scoped action-policy exception (this skill alone may flip
  stop_charge, both units, user-confirmed, must revert); corrected pack-6 /
  SoC-drift notes to the verified equal-voltage-different-SoC signature.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 12:11:47 -04:00
5484bb5fa6 commissioned 2026-06-23 18:49:47 -04:00
df3fb3466a updates to evse 2026-05-09 11:34:26 -04:00
8c7b5fb711 fixed resolver 2026-05-09 10:18:57 -04:00
a1acf479f0 fix 5min spikes 2026-05-01 19:10:21 -04:00
e1b180e230 lvx, eg4, and evse 2026-05-01 16:56:37 -04:00
7688fc1dd3 Resilience pass: bulletproof recovery + FWS / fault polling + EG4 discovery refresh 2026-04-28 18:10:00 -04:00
04720c3b92 add controls to lvx 2026-04-27 06:50:04 -04:00
00ab311d92 working in production - not entirely validated. parallel mode working. 2026-04-26 19:26:44 -04:00
f771ec2b46 Cleaned up inverter mqtt 2026-04-26 08:49:05 -04:00
9aca623336 initialize 2026-04-24 16:34:10 -04:00