Skip to content

Add GoodWe ET field candidate#13

Merged
frahlg merged 1 commit into
mainfrom
agent/goodwe-et-batched-candidate
Jul 22, 2026
Merged

Add GoodWe ET field candidate#13
frahlg merged 1 commit into
mainfrom
agent/goodwe-et-batched-candidate

Conversation

@frahlg

@frahlg frahlg commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Add the read-only GoodWe 1.0.2 field candidate for FTW.

  • Keep an empty legacy config on community-v1, with the same 22 Modbus FC03 holding-register reads and global unit ID default 1 as 1.0.1.
  • Add an explicit gw8kn-et-hk3000 profile from the attributed Hugin input. The profile uses eight batched reads instead of the input driver's 13 reads without a detected battery or 15 with one.
  • Require a named profile for the new map. No value-based profile detection is allowed.
  • Read every field for a profile before the first emit. A failed or short read, or a negative/sentinel inverter AC value, fails the poll before any telemetry.
  • Keep the package observe-only: read_only=true, permission only modbus.read, no commands, no writes, and no register 47040 change.

Locked sources

The input source has an MIT notice and attribution in THIRD_PARTY_NOTICES.md. The canonical repository remains Apache-2.0.

Register-map boundary

The two source maps conflict at addresses that cannot be detected by checking whether a value looks plausible:

Field community-v1 gw8kn-et-hk3000
Meter total 35140–35141, I32 BE 35140, I16
Frequency 35113, U16 × 0.01 Hz 35123, U16 × 0.01 Hz
L2 voltage 35123, U16 × 0.1 V 35151, U16 × 0.1 V
Export energy 35199–35200, U32 BE × 100 Wh 35198–35199, U32 BE × 100 Wh
Unit ID default 1 site config must set 247 or the verified site value

An empty old config selects only community-v1. An unknown explicit profile fails init. The new GW8KN map requires both config.profile: gw8kn-et-hk3000 and an explicit host Modbus unit ID. Lua cannot inspect the host capability's unit ID.

Transactions per successful poll

Profile/source Before Candidate
Legacy community-v1 22 22
GW8KN-ET/HK3000 input, no detected battery 13 8
GW8KN-ET/HK3000 input, detected battery 15 8

The legacy profile has no new batching or gap reads. It keeps the exact 1.0.1 address/count order. The GW8KN profile reads:

Start Count Used Read but ignored
35107 4 35107, 35108, 35110 35109
35123 1 35123 none
35125 11 35125, 35130, 35135 other words in the block
35138 3 35138, 35140 35139
35145 13 35145, 35151, 35157 other words in the block
35164 5 35164, 35166, 35168 35165, 35167
35178 6 35178, 35180, 35182, 35183 35179, 35181
35195 5 35195–35196, 35198–35199 35197

All gaps stay uninterpreted. The new wide reads still need the field pilot.

Failure and data rules

  • No read or decode failure becomes 0 W.
  • Raw 35138 value 0 remains a valid night value. A negative I16 value, including 0xffff, fails the whole poll before emit.
  • A zero phase voltage omits the derived phase current instead of emitting 0 A.
  • Battery power and SoC come from the same completed block.
  • The FTW Core contract drops all buffered telemetry if any Modbus read fails and does not move LastSuccess.
  • Command returns false; default mode and cleanup make no write.

Checks

  • make test-driver ID=goodwe: 63 passed, 6 skipped.
  • make package-driver ID=goodwe TARGET=ftw-core: pass.
  • make check: 62 manifests, 62 sandbox checks; 2606 passed, 491 skipped.
  • FTW GopherLua host overlay: eight-read success; middle-batch timeout stops after read five with no LastSuccess move; 0xffff sentinel returns a poll error with no LastSuccess move.
  • Exact Lua artifact SHA-256: 117f7cb0273b2be6d7b4f2d01b798272e41817626a8b9e4365ae9517a5dbcc92.

Field and release gate

This draft makes no GoodWe hardware claim. tested_models and manifest tested_devices stay empty. The package match describes the pilot target only.

Release order:

  1. Merge Add GoodWe ET field candidate #13.
  2. Let the automatic workflow publish the signed and versioned GoodWe 1.0.2 drivers-beta.
  3. Publish Core v1.10.1-beta.1 from its frozen source commit.
  4. Run the real GoodWe HIL and GoodWe Modbus TCP stale socket after controller reboot ftw#522 test on those exact signed betas.
  5. On PASS only, promote the same driver source commit through the two-phase drivers-stable flow.
  6. Verify the same Core beta against canonical drivers-stable, including the normalized GoodWe entry and byte-identical 1.0.2 asset.
  7. Only then promote the same Core source commit to Core stable.

The pilot in packages/v1/goodwe/PILOT.md requires raw fixtures, sign checks, an energy comparison, a network outage, three hard FTW-controller reboots while the inverter and dongle stay powered, and a 24-hour run. The merge and automatic drivers-beta publish are test inputs; neither is HIL or stable proof.

srcfl/ftw#522 remains open. Keepalive and backoff do not prove recovery from the dongle's ghost session. Stable stays blocked until the site passes 3/3 controller reboots without a dongle power cycle, has no false zero/green snapshot, and supplies the masked fixtures and logs. Merging this PR is expected to start the automatic signed/versioned GoodWe 1.0.2 drivers-beta flow. That beta is a test candidate, not HIL or stable proof. Do not move drivers-stable manually or touch Core #632 from this PR.

@frahlg

frahlg commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

Coordination note for #12: draft PR #14 changes only the FTW release workflow, tools/ftw_repository.py and its tests. It has no direct file overlap with this GoodWe branch at head 2a93cfb and does not alter this branch. If #13 lands first, #14 will refresh from main and rerun make check before it leaves draft. No driver channel, tag or release was changed.

@frahlg
frahlg force-pushed the agent/goodwe-et-batched-candidate branch from 2a93cfb to d7af356 Compare July 22, 2026 11:57
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg force-pushed the agent/goodwe-et-batched-candidate branch from d7af356 to 9a94802 Compare July 22, 2026 12:11
@frahlg
frahlg marked this pull request as ready for review July 22, 2026 12:25
@frahlg
frahlg merged commit cbf1450 into main Jul 22, 2026
5 checks passed
@frahlg
frahlg deleted the agent/goodwe-et-batched-candidate branch July 22, 2026 12:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a94802dbb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread drivers/lua/goodwe.lua
local l1_v = meter_voltage[1] * 0.1
local l2_v = meter_voltage[7] * 0.1
local l3_v = meter_voltage[13] * 0.1
local pv_w = nonnegative_i16(ac_total[1], 35138)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat GoodWe idle PV sentinels as zero

The GW8KN profile is explicitly derived from the upstream field profile, which documents register 35138 as wrapping to -1/-2 when idle (https://raw.githubusercontent.com/srcfl/hugin-drivers/3125960a80b5237e3a5ac609963ddb1302367938/drivers/goodwe_et.lua). With this check, a normal night/idle sample throws before any emits, so the driver suppresses otherwise-valid meter and battery telemetry and will appear offline until PV output is positive. Treat the known idle sentinel values as zero instead of failing the whole poll.

Useful? React with 👍 / 👎.

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.

1 participant