Repository navigation
feat(discovery): Solis Cloud configured through discovery; coordinator writes reported tuning, user wins - #6523
Conversation
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>
…ves none WRITTEN_TUNING (inverter_limit_charge, inverter_limit_discharge, battery_export_permitted, soc_max_fallback) is decided only when some discovered record binds it, with the kept-setting rule: the user's apps.yaml value wins at its slot (a single value is inverter 0's), a manual slot keeps its live entry, and it is never cleared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dings() automatic_config() keeps its behaviour, applying the dict through set_arg_auto (SOLIS_LEGACY_USER_WINS with overwrite=False) and then latching the fold. The tests read _legacy_bindings() instead of recording set_arg_auto. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
automatic_config() opts in (solis_cloud_pv_load_ignore skips the four load/PV settings, every inverter's PV counts, SOLIS_FALLBACK_USER_SETTINGS keeps hand-set values such as soc_max) before the first report, and no longer retries. latch_fold_when_ready() latches the parallel fold under the previous conditions. No battery logs one Warn, or one Info while details are unread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…configuration Mirrors Fox's: per-slot settings at the device's slot, summed settings by content (an unread inverter is Info, a double count is Warn), caps only where apps.yaml gives none, battery_power_invert as a bool, and a Warn for a leftover Solis Modbus slot. Never raises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A real SolisAPI on a real Coordinator matches _legacy_bindings() for one and two batteries, a PV-only inverter, a folded parallel pair, solis_cloud_pv_load_ignore and a user charge cap; the template's single soc_max survives as inverter 0's; unread details, a leftover Modbus slot and no battery log as designed. Black reformatting of earlier tasks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t for their master; caps survive a shorter pass Final review findings: - a parallel slave read after the latch joins the fold rather than taking a slot of its own and counting the shared battery twice; - a slave read before its master is not driven alone meanwhile; - one poll without batteryHealthSoh no longer releases a slot and reorders the inverters: drives_battery() is sticky, dropped only on a positive no-battery; - a user cap list shortened by a pass with fewer slots is restored from apps.yaml for an inverter that joins late. 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
The conversion is sound and the acceptance coverage through the real Coordinator is thorough, but three things need a small change inside this PR: the build_discovery() docstring now contradicts a side effect it gained, the 'only a no-battery report releases a battery inverter' half of the sticky predicate has no test, and the shipped Solis template still sets soc_max as a single value that now sizes only inverter 0.
Reviewed head 6b01679 (6b016796826a934098ce0037b907f5d87496cbda). 3 findings inline and 1 in the body.
apps/predbat/tests/test_solis.py:1679
test_solis_catalogue_filed_even_when_automatic_config_configures_nothing no longer proves its name. automatic_config() now writes no arg itself, so the api.set_arg_auto = lambda ...: configured.__setitem__ stub is never called and configured is always {}; the assertion "inverter_type" not in configured is vacuous. The comment at line 1704 ("It returns details_read (True here), so automatic_config_done DOES become True") still describes the old return value, which is now True because the component opted in. Drop the stub or assert on the coordinator's live base.args["inverter_type"] instead, and update the comment, so a regression that did configure an inverter here would be caught.
…n a "No Battery" report tested; soc_max template is a per-inverter list - drives_battery() is now read-only: the detail poll records what it saw (note_battery_state()), so build_discovery() and the checker no longer change which inverters count as battery inverters. build_discovery()'s docstring describes the shared test it now uses. - New acceptance test: an inverter Solis Cloud later reports battery-less loses its slot and stays released through polls carrying neither reading. - test_solis_catalogue_filed_even_when_automatic_config_configures_nothing asserts on the report's records instead of a setter the component no longer calls. - templates/solis_cloud.yaml: soc_max left unset for automatic size calculation, with the list form shown for setting it per inverter; the "ignored" comment now says settings Solis does not configure keep their apps.yaml value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Body finding ( |
Fourth slice of discovery-driven inverter configuration, after GE Cloud (#6188), GivTCP (#6514) and Fox Cloud (#6517). Solis Cloud's
automatic_config()no longer writesapps.yamlargs itself: Solis opts in to the discovery coordinator, which configures from the record Solis already files.Spec:
docs/superpowers/specs/2026-12-04-solis-discovery-automatic-config-design.md. Plan:docs/superpowers/plans/2026-12-04-solis-discovery.md.Coordinator: written tuning (
bindings.py)WRITTEN_TUNING:inverter_limit_charge,inverter_limit_discharge,battery_export_permitted,soc_max_fallback. They stay out ofBINDING_SETTINGS.apps.yamlkeeps the user's entry at every slot that has one; a single value is inverter 0's.REPORTED_TUNINGis now this constant.Solis
automatic_config()opts in withallow_automatic_config(...):include_pv_only=True(every non-driven inverter's PV still counts, [Solis Cloud] A PV-only inverter is dropped from pv_today/pv_power as well as from battery control #4922), the PV/load settings skipped undersolis_cloud_pv_load_ignore, andfallback_user_settings=SOLIS_FALLBACK_USER_SETTINGS, so a hand-setsoc_max(as the Solis Cloud template tells users to set) survives.drives_battery()is sticky: one poll missing the SoH reading no longer releases the slot; only Solis Cloud reporting "no battery" does._legacy_bindings(), and a passive checker compares it with what discovery wrote (caps compared only whereapps.yamlgives the slot no value;battery_power_invertas a bool). A leftover Solis Modbus or hand-setSolisCloudslot beside the discovered inverters is warned about.Behaviour changes for the release note
apps.yamlinverter entries are replaced from Solis's records, as with GE Cloud and Fox.inverter_limit_charge/_dischargeorsoc_maxvalue inapps.yamlapplies to inverter 0 only. On a two-inverter Solis site, the second inverter gets its record's cap and an estimated size instead. Single-inverter sites are unaffected.Overlap with #6518
Both PRs add a "Fallback settings" bullet to
docs/discovery-catalogue.md; whichever merges second has a one-line docs conflict.Testing
solis_cloud_pv_load_ignore, fallback-settings coverage, no-battery logging, no coordinator, opting in before the first report, fold latch timing, seven checker tests.Coordinator(args equal_legacy_bindings()applied with today's rules, checker quiet): one battery, two, battery plus PV-only, parallel folded, PV/load ignore, user charge cap, details unread then read, leftover Modbus slot, no battery, slave read after master, slave waiting for its master, SoH missing from one poll../run_pre_commit --checks-onlyclean.🤖 Generated with Claude Code