Repository navigation
feat(discovery): Fox Cloud configured through discovery; extra_entities for metered third-party generation - #6517
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ra_entities validation and the checker's summed compare Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngs() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nfiguration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ot, count a listed PV-only sensor once Final review fixes: Fox counts PV-only devices while some Fox battery inverter lacks its own PV, or when Fox drives no battery, re-sending its options when the devices change; a CT2-metered Fox PV inverter is no longer counted twice. The coordinator no longer adds a PV-only device's entity the user already lists. Fox's checker warns about a slot configured by hand as FoxESS/FoxCloud beside the discovered ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… two warnings When every Fox device is PV-only, Fox logs Info rather than warning that no device is a battery inverter, and the coordinator no longer warns about a source that only counts PV-only devices and never had a slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
springfall2008
left a comment
There was a problem hiding this comment.
Automated comment from the triage bot.
Verdict: 🟡 Amber - Recommend addressing the feedback, then approval
No defect in the plan or write path: reading the diff and the call paths, the summed-list order, the CT2 extras and the PV-only rule reduce to what _legacy_bindings() counts, and the coordinator does reach the new checker (test_accept_fox_leftover_modbus_slot_warns can only pass through it). I read the tests rather than running them. The changes asked for are that two statements stop being untrue, and one startup cycle stops logging two warnings.
Reviewed at 24837721ee69cfc2cb7b35f9d05cde71f23d94fe. 3 findings posted inline, 0 in the body.
One non-anchored nit: the PR description says _drives() is "shared by the record and the legacy plan", but _legacy_bindings() keeps its own copy of the predicate (which is right — it is the reference the checker compares against). Worth correcting the description so nobody goes looking for a single predicate.
…ed; one warning for an unread first cycle; docstrings name _legacy_bindings() - The solar-only Info line and docs no longer promise Fox PV is counted beside a battery configured by hand in apps.yaml: discovery decides no list there, so the user lists it. - The coordinator no longer warns that a source reported no inverter when that source never had a slot and none of its records carries entities yet (a first cycle whose detail read failed); Fox's own warning says why. - Fox's record docstrings name _legacy_bindings(), which now holds what the previous configuration bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no discovered slot, the coordinator now decides pv_today and pv_power - and only those - when a source counts PV-only devices: the hand-written lists with the PV-only devices added after them. A source that skips those settings adds no PV-only device to them. Fox solar beside another make's battery in apps.yaml is counted, as decided. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l components A real GECloudDirect or GivTCPComponent battery and a real FoxAPI with one PV-only device on one Coordinator, in either start order: one GivEnergy inverter, the Fox PV counted after the GivEnergy PV, and no warning from any component or checker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
This is the third slice of discovery-driven inverter configuration, after GE Cloud (#6188) and GivTCP (#6514). Fox Cloud (
fox_automatic) now configures its inverters through the discovery coordinator and no longer writesapps.yamlargs itself.Fox's discovery record already named every entity its
automatic_config()bound, with one exception. A battery inverter with its own PV and a metered third-party generator (CT2) puts two entries inpv_today/pv_power. A record can bind only one entity per setting. So that this generation isn't lost, records gain a new container,extra_entities.Design:
docs/superpowers/specs/2026-12-04-fox-discovery-automatic-config-design.md. Plan:docs/superpowers/plans/2026-12-04-fox-discovery.md.What changes
extra_entitiesrecord container.{summed setting: [entity descriptor, ...]}, forload_today,import_today,export_today,pv_todayandpv_poweronly.entity_id. Any entry that doesn't fit drops the whole key, with a warning.inverter_record(..., extra_entities=...)takes it. The web discovery page folds it withentities.Coordinator: summed lists. Each list is built in this order:
apps.yamlextras;With no discovered slot at all (every inverter configured by hand), the coordinator decides only
pv_today/pv_power, and only when a source counts PV-only devices: the hand-written lists with those devices added after them.Exceptions:
Fox's record. A driven inverter with its own PV and a CT2 generator reports
feedin2/meterpower2inextra_entities.Fox opts in to the coordinator before its first report.
apps.yamlwins: the old configuration overwrote every key.fox_automatic_ignore_pvleavespv_today/pv_powertoapps.yaml.The old configuration survives as a pure
_legacy_bindings(). A passivecheck_automatic_config()compares discovery's result with it and only logs.pv_today,pv_powerand the energy totals are compared by what they count, not their order. An entity listed twice is a Warn.FoxESS/FoxCloudbeside the discovered Fox inverters. That is typically a leftover from the Fox Modbus template, and its entity names never contain the serial, so discovery can't take it over.Which devices Predbat drives is now one helper,
FoxAPI._drives(), shared by the record and_driven_serials()._legacy_bindings()keeps its own copy: it is the reference the checker compares against.Behaviour changes worth a release note
run().apps.yamlconfigures it.FoxESSslot now gets a warning: before, Fox's automatic configuration overwrote it.Testing
./run_all, 4 workers), andrun_pre_commit --checks-onlypasses.extra_entitieson standby and retained slots;assert_summed_settings_agree, intests/discovery_contract.py. The Fox agreement test now compares the whole PV lists; before, it compared only one entry per device and never reached the CT2 entry. Existing contract functions are unchanged.automatic_config()tests now check_legacy_bindings(), which the checker still compares against.FoxAPIthroughrun()against the realCoordinator, with only the Fox cloud calls stubbed:fox_automatic_ignore_pv;Known limits
battery_temperature_history, which comes from the lowest slot. GivTCP's checker has the same pattern.🤖 Generated with Claude Code