Skip to content

foxess_h3_smart 0.12.1: release hold-at-zero when a full pack would curtail PV - #293

Draft
Leitet wants to merge 1 commit into
cursor/foxess-h3-smart-eps-7b81from
cursor/foxess-h3-smart-hold-ratchet-7b81
Draft

Leitet wants to merge 1 commit into
cursor/foxess-h3-smart-eps-7b81from
cursor/foxess-h3-smart-hold-ratchet-7b81

Conversation

@Leitet

@Leitet Leitet commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #292. Does not change the EPS / off-grid behaviour from 0.12.0.

Hold-at-zero (target_w = 0) wrote 46003/46004 = last_pv_w * 0.977. That register is the inverter's AC active power, export-positive. At SoC 99% the pack cannot store the surplus, so the inverter curtails PV down to the cap. The next poll reads the curtailed PV and writes a cap 2.3% lower. On Johan's 1K5-HI-10-V1 on 2026-12-03, after returning to grid, the setpoint walked 791 → 914 → 550 → 343 → 308 → 275 W from 13:02 while about 2.4–3 kW of sun was available (cloud_pct 0) and the house imported 0.9–3 kW. Spot price 352 öre, no negative slots, core dispatch target_w 0, clamped false, no curtailment. The same formula is in 0.11.0 and 0.12.0.

0.12.1:

  • A zero target releases remote control (46001 = 0, self-use) when SoC is at least 98%. The release stays until SoC is 96% or below, so a reading that chatters between 98 and 99 does not re-arm the cap.
  • It also releases when DC PV has fallen onto a positive AC cap already written (PV within 90–100% of that cap) while battery power is within 100 W of zero and PV is at least 50 W. A healthy hold keeps DC PV about 2.3% above the cap, so "battery ≈ 0 and PV > 0" alone is not a release — that is the hold working, and releasing it would bring back the self-use charge cycle from 2026-08-05. The array has to be seen above the PV that produced the cap before a zero target may write one again.
  • Curtailment still happens only when core sets an explicit cap. That cap is not recomputed from the curtailed PV reading: while the pack cannot take surplus and PV is sitting on the cap, the written setpoint stays on the cap core asked for.
  • Discharge, charge, and the 99% charge refusal are unchanged. A discharge command after a full-pack release still engages remote control.
  • foxess_hold_released is 1 while the stand-down is latched, 0 otherwise.

Overlay (includes the 0.12.0 EPS changes, this branch is based on #292):

https://raw.githubusercontent.com/srcfl/device-drivers/cursor/foxess-h3-smart-hold-ratchet-7b81/drivers/lua/foxess_h3_smart.lua

Driver evidence

  • Driver id: foxess_h3_smart
  • Device make/model: Fox ESS 1K5-HI-10-V1
  • Firmware tested: not recorded for the 2026-12-03 hold
  • Protocol/register source: the driver's existing remote-control model (46003/46004 is AC active power, export-positive), confirmed by the live setpoint trace
  • Hardware test performed: the ratchet was observed live after grid return (see summary). This fix has not been run on the inverter yet.
  • Known limits: releasing to self-use on a full pack relies on self-use exporting rather than curtailing. A healthy hold at lower SoC is intentionally unchanged. An explicit curtail cap can still hold AC at the cap while PV sits on it; a deep cloud (PV below 90% of the cap) follows PV down instead of discharging the battery to hold the cap.

Safety

  • A driver that can command its device has control on, or says in its description why it cannot.
  • Vendor signs are converted at the driver boundary.
  • Cached telemetry becomes stale instead of being re-emitted as fresh.
  • No credentials, serial numbers, private addresses or site data are included.

Control evidence

  • Hardware evidence, or not yet (the path stays experimental): the bug is from live 1K5-HI-10-V1 operation on 2026-12-03. The fix itself is not yet confirmed on that hardware. Discharge, charge and the existing hold at SoC 93% are unchanged and still covered by test_foxess_h3_smart_control.py.
  • Control changes include default-mode, refused-write and harness test evidence. New cases are in drivers/tests/test_foxess_h3_smart_hold.py: the old ratchet sequence (2931, 2864, 2798, 2734 from 3000 W), a full pack that never writes 46003, PV forced equal to the cap, SoC hysteresis 99 → 97 → 96, SoC 97 with no prior full reading, idle battery with PV still above the cap, an explicit 600 W curtail cap that does not walk down, and discharge at SoC 99% both before and after a release.

Checks

  • Commits include Signed-off-by.
  • make test-driver ID=foxess_h3_smart — 103 passed, 5 skipped.
  • make check — 5589 passed, 927 skipped.

What to check on Johan's site

With this file as overlay, sun up, SoC near 99%, core sending battery target 0 and no curtailment:

  1. Within one poll, 46001 goes to 0 (or stays 0) and foxess_hold_released is 1. The log line says hold-at-zero is releasing remote control. PV stays at the available array power instead of walking down, and the house stops importing that missing PV.
  2. SoC 97% after that release: still released. No flap back to a PV-derived cap.
  3. SoC at or below 96% with target still 0: remote control comes back, 46003 ≈ PV × 0.977, battery power stays near 0, and PV does not collapse onto that cap.
  4. A real curtail command from core: 46001 stays 1 and 46003 stays on the asked cap when PV is reported as that cap.
  5. A discharge command at high SoC still sets 46001 = 1 and an AC setpoint above PV, and the battery discharges.
Open in Web Open in Cursor 

…tail PV

Target 0 wrote AC = PV times 0.977. On a full battery that cap pulls PV
down and the next poll writes a lower cap. 0.12.1 stands down to
self-use instead, with SoC hysteresis, and leaves an explicit curtail
cap where core set it.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Johan Leitet <johan@sourceful-labs.com>
@cursor
cursor Bot force-pushed the cursor/foxess-h3-smart-hold-ratchet-7b81 branch from 7fc2d64 to b01ebd2 Compare December 5, 2026 14:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants