Skip to content

Run on ebus-panel-sim 0.11.0 and its r202645 captures - #38

Closed
cayossarian wants to merge 12 commits into
mainfrom
chore/ebus-panel-sim-0.11.0
Closed

cayossarian wants to merge 12 commits into
mainfrom
chore/ebus-panel-sim-0.11.0

Conversation

@cayossarian

@cayossarian cayossarian commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Why

ebus-panel-sim 0.11.0 is out, with:

  • the tab-to-leg and net per-leg current rule;
  • shared tandem and quad breakers;
  • PV that no circuit feeds, and a hybrid battery's own PV;
  • connection/connection-point from SPAN release 202645;
  • seven reference captures new to PanelBench, six of them on release 202645.

This moves PanelBench onto it. Three changes go further than the pin:

  • the new captures become templates that reproduce their panels;
  • a panel without a feedthrough publishes no downstream lugs, as hardware 3.0 does from 202645;
  • a hybrid battery takes its own solar.

What changes

The pin

  • ebus-panel-sim==0.11.0. ebus-sdk stays at 0.22.0, still its ceiling.
  • The cascade capture's site shape and fed-by lugs, and the shed-forecast estimates of r202645-g and r202639-f, take the emitter's own fidelity exceptions and reasons.

Templates. The newest capture of a panel takes its template name, and older captures of the same panel are retired, as main32_r202633 was.

  • Renamed onto r202645: ref_MAIN_32, ref_UNKNOWN_16, ref_MAIN_40 and ref_MLO_48 are now the r202645 captures. Their r202639 versions share the panels' masked serials and are retired.
  • Serials kept: each keeps the serial it had (sim-main32_r202639 and so on), as a panel keeps its serial through a firmware upgrade. So a panel run from one of them before upgrading PanelBench and after it is one panel upgraded, as Home Assistant sees it; ref_MAIN_32 keeps its 16 circuit ids too.
  • ref_MAIN_40 is that panel recommissioned, with 38 circuits and no battery. Its circuits on 9 to 48 now back the MAIN 40's positions with a capture.
  • New: ref_MAIN_32_CASCADE, ref_MAIN_16_BESS and ref_MLO_48_HYBRID.
  • First template: the dashboard opens the r202645 MAIN 32.

panel_config.feedthrough (default true)

  • The rule: with false, a hardware 3.0 panel on release 202645, or on a firmware naming none, publishes no downstream lugs. Release 202639 and a MAIN 32 publish both, as every capture of them does.
  • Clone: a clone of a panel publishing its upstream lugs alone writes false.
  • Refused: lugs.downstream, or a battery placed DOWNSTREAM, for lugs the panel does not publish.

A hybrid battery's own solar

  • Config: bess.inverter_type: hybrid (default ac-coupled) and bess.pv_array.nameplate_capacity_w.
  • Production: the engine produces the array with the PV circuits' solar model, and the runtime hands it to the emitter as TickInputs.bess_pv. It only does so for a battery the emitter was started hybrid. The emitter still dispatches the battery.
  • Live edits: a live battery change applies only if it keeps the battery the emitter started with, coupled the same way. Enabling, disabling or replacing the battery, or changing its coupling, restarts the panel instead.
  • Model view: books the array the same way in both passes. A clone's unrated hybrid battery takes the live rating in the Before pass, so rating it shows no saving.
  • Clone and import: a clone takes the coupling from the emitter's own definition_from_tree reading, which the clone already made. An import keeps its definition's.
  • Not done: off grid, the array is not curtailed to what the load and battery can take, as PanelBench's PV circuits are not. Only the emitter knows which circuits it sheds and how much the battery can still charge, so its dispatch is where curtailment belongs.

A config PanelBench accepts is one a panel starts on

  • The check: validation builds the emitter exactly as a panel's start does, through one construct_emitter that start, import and validation share. Every rule the emitter applies to a definition then applies when PanelBench loads, edits or saves a config. Circuits and outside meters are named by their config id.
  • Shapes first: every setting the definition or the engine reads is checked before the definition is built. So a setting such as lugs: x, bess.charge_hours: 5 or a template's power_range: {min: 50, max: 150} is refused by name; before, the panel failed to start or tick with an error naming nothing. A circuit's overrides are checked on the template as they leave it. Each check takes a setting as its reader does, so a quoted number that ran before still loads.
  • Sizes, places and capacities: a total_tabs that is no SPAN panel's size, or a latitude or longitude off the globe, is refused when the config loads, not at start; the dashboard's form allowed both. A battery of 0 kWh or a discharge efficiency of 0, which failed on its first tick, is refused too.
  • Logging: the emitter validation builds and drops would log about 19,000 SDK records per edit at DEBUG. A filter drops the records below WARNING while it builds, and leaves a running panel's own records alone.
  • The 0.11.0 regressions it stops: the dashboard could otherwise save a tandem whose circuits differ in priority or relay lock, or a PV rating of 0. 0.10.0 started on those, and 0.11.0 does not.
  • Feeds: a bess.feed naming no circuit is refused, and deleting the circuit it names drops it, as a pv.feed is dropped.

One template per circuit, for every reader

  • The fix: a circuit's overrides and own breaker rating sit over its template. The engine modelled the circuit by that, but the definition published the template alone. So a breaker rating edited in the dashboard showed in the dashboard while the panel went on publishing the template's.
  • Now: circuit.effective_template is the one rule. The engine, the definition, validation and the dashboard's view all read a circuit through it, and a template no circuit uses is checked for its shape alone. A hand-written override outside the energy profile is now published, and a rating must be above 0.
  • EVSE feeds: the runtime takes them from the same list the manifest is built from.

Tandems and quads

  • The dashboard: a relay toggle, or a priority or relay-behaviour edit, on one circuit of a breaker applies to the whole breaker. Only a circuit whose own value changes leaves recorder replay.
  • Registers: a clone, and a refresh from the source panel, write the breaker's one register to each circuit: the largest any of them publishes, as the emitter's capture takes it. The circuits read one meter a moment apart, and 0.11.0 refuses seeds that differ.

Virtual devices. A PV inverter or SPAN Drive added in the dashboard sits on no breaker space. The emitter refuses such a circuit, so a panel with one did not start, on 0.10.0 too. It is now modelled in the Model view and left out of what the panel publishes: its circuit, any device it would feed, and its power in each tick. It binds no PV device either, so it neither hides the panel's own inverter nor lends an upstream one its type. A pv.feed or bess.feed naming one is refused.

Testing

  • uv run pytest -q: 1336 passed, 6 xfailed. ruff check, ruff format --check, mypy --strict and the hooks pass. The mypy hook now type-checks against 0.11.0, and a test keeps its pins equal to the project's.
  • All seven new captures reproduce on both routes, clone and import.
  • Weakenings: each new rule failed a test when broken, including the feedthrough's firmware and variant gates, the clone's and the import's coupling, runtime's bess_pv, the Model view's array, and 64 weakenings of the review fixes.
  • Fuzz: every key the config types declare was set to odd values on both tracked templates and three generated ones (MLO 48 hybrid, MAIN 16 with a battery, MAIN 32 with upstream PV). Validation raised nothing but a ValueError, and each of the 10,643 configs it accepted started a panel and ticked at three times of day.
  • Regressions: the dashboard cases the review reproduced (a tandem's mates differing, a PV rating of 0, a what-if PV) are refused with a reason or no longer published.

Pin the emitter at 0.11.0; ebus-sdk stays at 0.22.0, still its ceiling. The cascade capture and the shed-forecast estimates of r202645-g and r202639-f are what the emitter itself cannot reproduce from their definitions, so they take its exceptions with its reasons.
The emitter's 0.11.0 captures of four panels PanelBench already templates, on release 202645, take those templates' names, and the release 202639 captures of the same panels, which keep their masked serials, are retired, as main32_r202633 was. ref_MAIN_40 is that panel recommissioned, with 38 circuits and no battery. Three captures of other panels become ref_MAIN_32_CASCADE, ref_MAIN_16_BESS and ref_MLO_48_HYBRID. The dashboard's first template is the release 202645 MAIN 32, and the startup test reads its serial from the file rather than naming it. Both changelogs' Unreleased sections had two Fixed headings; the cycling entry joins the first.
…s from release 202645

panel_config.feedthrough (default true) records whether the panel has a feedthrough module. From SPAN release 202645 a hardware 3.0 panel without one publishes its upstream lugs alone, as the emitter's r202645 captures show, so the spec generator leaves the downstream lugs out under span-alpha-test-b2 on that release or a firmware naming none. Earlier releases publish both whatever the panel has, as every r202639 capture does, and no capture shows a MAIN 32 leaving them out, so there the flag changes nothing. A clone of a panel publishing its upstream lugs alone writes feedthrough: false; a lugs.downstream section for lugs the panel does not publish is refused, and a feedthrough that is not a bool.
bess.inverter_type (ac-coupled by default, or hybrid) says whether the battery's own inverter also takes PV, published as its inverter-type, and bess.pv_array.nameplate_capacity_w rates the array a hybrid takes. The engine produces that array with the model PV circuits use, by the panel's location and weather, and the runtime hands it to the emitter as the battery's bess_pv, which the emitter adds to power-flows/pv, to what the battery's dispatch sees and to the grid; the battery is still dispatched by the emitter. The Model view books the array the same way in both passes. A clone takes a battery's coupling from the emitter's own reading of the tree, which writes hybrid where the panel publishes power-flows/pv and nothing but its one battery could bring it solar, rather than keeping a second rule; an import keeps its definition's coupling. The fidelity replay carries a capture's bess_pv onto the reproduction's battery, so r202639-f reproduces on both routes. The recorder history helper moves to tests/_helpers for the Model view tests.
The README, DEVELOPER and the add-on docs describe panel_config.feedthrough and a hybrid battery's inverter_type and pv_array, and which firmware each template reports; a config naming no firmware publishes release 202645's conventions. A MAIN 40's spaces now rest on a capture, r202645-c, whose 38 circuits sit on 9 to 48, in panel_models, the clone's comment and the changelog. Both changelogs record what 0.11.0 publishes differently, the battery's own solar and feedthrough.
… as one; virtual devices stay unpublished

Validation ends by asking the emitter: its manifest parse and, under a variant that publishes shared breakers, its rule that a breaker's circuits agree in priority, relay lock, never-backup, placement and energy seed (ebus_panel_sim.shared_hardware), on a normalised copy of the config, with each circuit named by its id. Under 0.11.0 the dashboard could otherwise save a tandem whose circuits differ, or a PV rating of 0, which then would not start. The dashboard applies a priority or relay-behaviour edit and a relay toggle on one circuit of a tandem or quad to every circuit on it, as the breaker has one relay.

A circuit on no breaker space, as the dashboard adds a PV inverter or SPAN Drive, is a what-if device: the Model view models it, and it is left out of the manifest, the devices it would feed and each tick, since the emitter refuses a circuit with none and a panel with one did not start, on 0.10.0 too.

A hybrid battery's PV goes only to a battery the emitter was started hybrid, and a live edit that makes a battery hybrid is not applied, so the dashboard restarts the panel instead of every tick being refused. A clone's hybrid battery, kept unrated as the Model view's Before battery, takes the live array rating there, so rating it shows no saving. The Model view tests now pin the array's amount, the energy balance and the battery's dispatch in both passes. A battery placed DOWNSTREAM of lugs the panel does not publish is refused. Off grid the array is not curtailed, as the PV circuits are not, which the emitter's dispatch is the place for; the README and changelogs say so. Stale 0.10.0 references in the fidelity provenance and round-trip reasons, the README's rehearsal text and the clone's warning are corrected.
…ster; virtual devices bind nothing

Validation refuses what a panel cannot start on by building the emitter as start does, through one construct_emitter that start, an import's render and validation share, so every rule the emitter applies to a definition applies when PanelBench loads, edits or saves a config, with each circuit and outside meter named by its id. That replaces the partial check (the manifest parse and shared_hardware's breaker rule) and the import of a module outside the emitter's public API. Before it, shape checks refuse by name every section the definition reads that is not the mapping, list or number its type says (bess, pv, evse, lugs, broker, simulation_params, panel_config's serial, total_tabs, main_size and site, a template's energy_profile, nameplate and breaker_rating, a circuit's template and tabs, the battery's numbers and hours), which reached the panel's start as an AttributeError or TypeError naming nothing. A bess.feed naming no circuit is refused, and deleting the circuit it names drops it, as a pv.feed is dropped.

A PV circuit on no breaker space binds no PV device: pv_circuit_ids counts the circuits on the panel, so a what-if PV no longer publishes a device fed by nothing, nor hides the panel's own inverter, and lends an upstream inverter no type; a pv.feed or bess.feed naming one is refused.

A clone and a refresh from the source panel write a tandem's or quad's one register to each of its circuits, the largest any publishes, as the emitter's capture takes it: the circuits read one meter a moment apart, and 0.11.0 refuses seeds that differ. A mate leaves recorder replay only where its own value changes. A live battery change applies only when it keeps the battery the emitter started with, coupled as it was; enabling, disabling or replacing it, or changing its coupling, restarts the panel. Tests pin each fix; every weakening tried fails one. The README's off-grid sentence no longer says the emitter's dispatch sees the load after shedding.
Validation now also checks what the engine reads, each setting as its reader takes it: a template's energy profile must hold mode, power_range and typical_power, power_range two numbers, the variation, a cycling load's durations, smart behaviour's reduction and the panel's latitude and longitude real numbers, since the engine does arithmetic on them; a duty cycle and the time-of-day factors convert with float(), so they may be quoted. cycling_pattern, smart_behavior, time_of_day_profile and simulation_params must be mappings where present, and a circuit's overrides are checked on the template as they leave it, through the one set of profile keys SimulatedCircuit routes them by. A serial must be a string and a circuit id a name or number.

The shape checks from the last commit now take each number as its reader does, so a quoted main_size, total_tabs, breaker rating or battery number, a load's empty nameplate and tabs: [1.0], which all ran before, still load; an empty nameplate is refused on a PV template alone, where the inverter's device needs it. total_tabs must be a SPAN panel's size, which start checked only after the panel was up and the dashboard's form did not, so that check moves to validation; a 0 kWh battery, which failed on its first tick, is refused. While validation builds and drops its emitter, a filter keyed on a context variable drops the SDK's homie records below WARNING, about 19,000 per edit at DEBUG on 48 circuits, and leaves a running panel's own alone.

A refresh missing one circuit of a tandem gives both the register the scrape has. Tests cover the produced register too. Four dashboard fixtures whose profiles could never tick get runnable ones. Fuzzing both tracked templates (every path set to a string, number, null, list, mapping or bool) raises only ValueError from validation, and every config it accepts starts a panel and ticks; every weakening tried fails a test.
What the definition and the engine read of a template is now checked on each circuit's effective template, its overrides applied as SimulatedCircuit applies them and its own breaker_rating over both, so a template no circuit uses is checked for its shape alone, as nothing reads it. A producer's nameplate must be a real number, since the engine takes abs() of it; a quoted one failed on a tick. Latitude and longitude must lie on the globe, which the dashboard's form did not ensure and the time-zone lookup refuses at start. Energy seeds, monthly factors, active days, hvac_type, soc_shed_threshold, time_acceleration and tab_synchronizations are taken as their readers take them, a discharge efficiency of 0, which the battery divides by, is refused, and a circuit id may be a float, as one ran before.

Fuzzing every key the config types declare with odd values, on both tracked templates and three generated ones, gives no exception but ValueError from validation, and each of the 10,727 configs it accepts starts and ticks at three times of day; every weakening tried fails a test.
circuit.effective_template is the one rule for a circuit's template as the panel has it: its template with the circuit's recorder link, its overrides (OVERRIDDEN_PROFILE_KEYS into the energy profile, any other into the template) and its own breaker_rating, which replaces the template's under either key. SimulatedCircuit, the definition (every per-circuit read in spec_generator, through _template_of) and validation all read a circuit through it; validation and the PV binding use its untyped form, effective_settings, since they read a config before it is typed. The runtime's EVSE feeds take the spec generator's circuits_for_device_type, the list the manifest is built from, in place of a copy of it.

So a breaker rating edited in the dashboard, which writes the circuit's own, is published, where the panel went on publishing the template's while the dashboard showed the edit. A template rating every circuit on it replaces is read by nothing and no longer refused, and an override named energy_profile that is no mapping is refused by name. SimulatedCircuit's two type: ignore comments on the override routing go. Every fuzz stays clean, and each weakening of the rule fails a test.
… each circuit as published

A generated template's serial was its capture's, so the r202645 capture of a panel took a serial its r202639 capture's template had not: a panel run from ref_MAIN_32 before upgrading PanelBench and after it was two panels to Home Assistant, not one upgraded. A later capture now takes its earlier one's serial (reference_templates._SUCCEEDS, from which the retired captures follow), as a panel keeps its serial through a firmware upgrade. ref_MAIN_32 stays sim-main32_r202639 on its r202645 capture, with the same 16 circuit ids, names and spaces, so switching from main's PanelBench to this one under a running Home Assistant exercises the integration's migration.

The dashboard's view of a circuit, and the lock guards that read it, take the circuit as the panel has it (effective_settings), so a hand-written override or circuit rating shows as published. A breaker rating must be above 0. Tests pin the recorder link, the device type the manifest and PV binding read, the dashboard view and the serial; each weakening fails one.
The hook runs mypy in its own environment from its additional_dependencies, which still pinned ebus-panel-sim 0.10.0b2, so the lint job failed on TickInputs' bess_pv, a keyword only 0.11.0 has. The pin now matches pyproject's, and a test fails whenever an exact pin in the hook differs from the project's, as this one had since before 0.11.0.
@cayossarian cayossarian mentioned this pull request Nov 20, 2026
@cayossarian

Copy link
Copy Markdown
Member Author

Superseded by #39, the 2.9.0 release, which carries these commits unchanged followed by the device ids and the release.

@cayossarian
cayossarian deleted the chore/ebus-panel-sim-0.11.0 branch November 20, 2026 23:34
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