Skip to content

foxess_h3_smart 0.12.3: remote control must not discharge past the target - #296

Draft
Leitet wants to merge 1 commit into
cursor/foxess-h3-smart-pv-probe-7b81from
cursor/foxess-h3-smart-bat-bound-7b81
Draft

Leitet wants to merge 1 commit into
cursor/foxess-h3-smart-pv-probe-7b81from
cursor/foxess-h3-smart-bat-bound-7b81

Conversation

@Leitet

@Leitet Leitet commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #295. 0.12.2 was rolled back on the 1K5-HI-10-V1 (14:31–14:47, low sun, PV 83→34 W, SoC 98→96%).

What worked: release when discharge was inside house load (log 14:35:33, hold_released 1).

What did not. pv_ref stepped to 882 W at 14:33:42 and PV did not follow. The AC setpoint is the inverter's active power, so the battery filled the gap while remote control was on:

  • battery −2518 W vs target −1755 W, export 1424 W
  • 14:41:26 battery −2828 W vs target −1323 W, export 1234 W
  • 14:41:05 battery −2109 W vs target −1523 W, export 1502 W, house load only 677 W

Release and remote also flapped as house load cycled through 0.7 / 1.2 / 1.8–2.2 kW around the target. After 14:43:47 hold_released was 0 (SoC had reached the 96% exit) and pv_ref fell back to the measurement.

Why the probe is gone

A higher PV term only helps if the array takes it in the same cycle. On this inverter it does not: the extra watts come out of the battery. Bounding the setpoint to house load + |target| would still allow that whenever |target| is already an export, and it would not cap the 14:41 case (load 677 W, target 1523 W, a load+|target| ceiling is still far above measured PV + |target|). The bound that matches the failure is on the battery itself.

Behaviour

  • While remote control is on, the written AC setpoint is at most measured PV × 0.977 + |target| + 200 W. 200 W covers the ~80 W the hardware already shows at a 1000 W discharge. A stored pv_ref above the measurement is snapped down before the write. foxess_pv_ref_w tracks the measurement.
  • A discharge releases to self-use only after |target| has been at least 200 W below house load for 3 polls. It stays released until |target| has been at least 200 W above house load for 12 polls (about a minute at the 5 s poll). Samples inside that band do not move the mode.
  • Hold-at-zero release at a full pack, charge refusal for the 98/96 latch, the explicit curtail cap, and EPS are unchanged.

Overlay (includes 0.12.0–0.12.2; this branch is based on #295):

https://raw.githubusercontent.com/srcfl/device-drivers/cursor/foxess-h3-smart-bat-bound-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
  • Hardware test performed: 0.12.2 on 2026-12-03 14:31–14:47, then rolled back to 0.12.1. This fix has not been on the inverter yet.
  • Known limits: with remote control on, PV is not given headroom above the measurement, so a curtailed array stays curtailed until self-use is released. That is the trade for the battery bound. The 96% SoC exit of the latch is unchanged.

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 overshoot and the flap are from the live 0.12.2 run. The fix is not yet confirmed on hardware.
  • drivers/tests/test_foxess_h3_smart_discharge_pv.py replays PV ~80 W not following a high reference, targets −1.3 to −1.8 kW and load 677 W, and checks implied battery discharge ≤ |target| + 200 W. Load alternating 2200/700 W around −1500 W does not flap. Release takes 3 polls inside the margin and survives 11 export-side polls; the 12th re-enters with a bounded setpoint. Hold, charge refusal, explicit curtail and the steady 3000 W discharge still pass.

Checks

  • Commits include Signed-off-by.
  • make check — 5595 passed, 927 skipped.

What to check tomorrow

Low or ordinary sun, SoC above 96%, core sending a discharge around 1–2 kW:

  1. While 46001 is on, battery discharge stays within |target| + 200 W. foxess_pv_ref_w matches measured PV. It must not sit hundreds of watts above the array.
  2. When house load stays at least 200 W above |target| for 3 polls, 46001 goes to 0 and foxess_discharge_released is 1. A few polls where load drops back below the target do not turn remote control on again.
  3. Remote control returns only after |target| has stayed at least 200 W above house load for about a minute (12 polls). The first setpoint after that is measured PV × 0.977 + |target|, not a probe.
  4. Target 0 at SoC ≥ 98% still releases. A curtail command from core still caps 46003. A charge at SoC ≥ 98% is still refused.
  5. At SoC 96% or below the full-pack latch opens, as before.
Open in Web Open in Cursor 

A PV reference above the measurement is extra battery discharge on
this inverter. 0.12.3 writes measured PV plus the target, and it
waits out a cycling house load before it releases or re-enters
remote control.

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-bat-bound-7b81 branch from 7444bf6 to 8b409d7 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