Repository navigation
Run on ebus-panel-sim 0.11.0 and its r202645 captures - #38
Closed
cayossarian wants to merge 12 commits into
Closed
cayossarian wants to merge 12 commits into
cayossarian wants to merge 12 commits into
Conversation
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.
Merged
Member
Author
|
Superseded by #39, the 2.9.0 release, which carries these commits unchanged followed by the device ids and the release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ebus-panel-sim0.11.0 is out, with:connection/connection-pointfrom SPAN release 202645;This moves PanelBench onto it. Three changes go further than the pin:
What changes
The pin
ebus-panel-sim==0.11.0.ebus-sdkstays at 0.22.0, still its ceiling.fed-bylugs, and the shed-forecast estimates ofr202645-gandr202639-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_r202633was.ref_MAIN_32,ref_UNKNOWN_16,ref_MAIN_40andref_MLO_48are now the r202645 captures. Their r202639 versions share the panels' masked serials and are retired.sim-main32_r202639and 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_32keeps its 16 circuit ids too.ref_MAIN_40is 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.ref_MAIN_32_CASCADE,ref_MAIN_16_BESSandref_MLO_48_HYBRID.panel_config.feedthrough(defaulttrue)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.false.lugs.downstream, or a battery placedDOWNSTREAM, for lugs the panel does not publish.A hybrid battery's own solar
bess.inverter_type: hybrid(defaultac-coupled) andbess.pv_array.nameplate_capacity_w.TickInputs.bess_pv. It only does so for a battery the emitter was started hybrid. The emitter still dispatches the battery.definition_from_treereading, which the clone already made. An import keeps its definition's.A config PanelBench accepts is one a panel starts on
construct_emitterthat 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 configid.lugs: x,bess.charge_hours: 5or a template'spower_range: {min: 50, max: 150}is refused by name; before, the panel failed to start or tick with an error naming nothing. A circuit'soverridesare 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.total_tabsthat 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.bess.feednaming no circuit is refused, and deleting the circuit it names drops it, as apv.feedis dropped.One template per circuit, for every reader
circuit.effective_templateis 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.Tandems and quads
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.feedorbess.feednaming one is refused.Testing
uv run pytest -q: 1336 passed, 6 xfailed.ruff check,ruff format --check,mypy --strictand the hooks pass. The mypy hook now type-checks against 0.11.0, and a test keeps its pins equal to the project's.bess_pv, the Model view's array, and 64 weakenings of the review fixes.ValueError, and each of the 10,643 configs it accepted started a panel and ticked at three times of day.