Repository navigation
spanos3/r202639/03 batch 2: hold PanelBench to every reference capture on ebus-panel-sim 0.10.0b2 - #28
Open
cayossarian wants to merge 29 commits into
Open
spanos3/r202639/03 batch 2: hold PanelBench to every reference capture on ebus-panel-sim 0.10.0b2#28cayossarian wants to merge 29 commits into
cayossarian wants to merge 29 commits into
Conversation
The emitter now publishes each number in the panel's literal form, words info/spaces as SPAN firmware does, and publishes the off-grid import limit only where it is commissioned, so the expectations that pinned the old forms move with it and the known differences it closed come out of the clone round trip. It also lets a device's $description name differ from its info/name. From release 202639 a SPAN panel names each circuit's device after its id and keeps the circuit's own name in info/name, so PanelBench now does the same, and the comparator keys a circuit by its info/name. The power-flow balance allows each term's published rounding. Part of the spanos3/r202639/03 batch 2 work.
Every reference capture the pinned emitter ships becomes a cell, taken by both routes to a config: a clone of the captured tree, and an import of the capture's own definition. PanelBench publishes the config and the tree is held to the bar the emitter's reference-capture test holds itself to: devices aligned by role, declarations and their attributes, valued against unvalued, the literal form of each value, commissioning values exactly and the sign of each power. What the emitter itself cannot reproduce from a definition is listed with its reason. No cell passes yet, so each is a strict expected failure naming what it shows. Part of the spanos3/r202639/03 batch 2 work.
…es unvalued A panel publishes some properties exactly as they were commissioned: its site and import limits, each set of lugs' service rating and role, and each circuit's tags, locations and protections. A config now states each of them, the emitter publishes them where the panel's variant declares the property, and a clone reads them back from its panel through one shared table. What a panel declares and leaves unvalued is listed per device and left unvalued, as the emitter's own reading of the panel lists it, so a clone no longer publishes a breaker rating or a pcs priority its panel does not. A meter outside the panel, on no breaker space, is cloned as one instead of skipped. The variant follows the hardware version string, as the emitter reads a panel. The first reference capture and the captured MAIN 32 on release 202639 are now reproduced by both routes. Part of the spanos3/r202639/03 batch 2 work.
…s so The emitter publishes each shed priority carried over from the REST era as UNKNOWN and takes none called UNKNOWN, so a clone copying it verbatim built a panel that would not start. A circuit publishing UNKNOWN is now cloned with one of those priorities, as the emitter's own capture reads it, and validation refuses a priority the emitter does not take, naming the template. The second reference capture is now reproduced by both routes, but for the site sign the emitter cannot reproduce either. Part of the spanos3/r202639/03 batch 2 work.
…aker's lock as the variant has it A battery a circuit feeds is now cloned in the panel, fed by that circuit, where the clone put every battery upstream and invented the upstream lugs' feed. A battery nothing names is cloned with no connection at all, as the panel publishes it. Under the variant the hardware version string selects for these panels, a battery's or inverter's breaker is an ordinary circuit whose locked relay locks its priority too, and the emitter refuses a commissioned-system circuit there. The clone records that lock as the relay alone, and validation refuses a commissioned-system circuit under that variant, naming the template. The third reference capture is now reproduced by both routes. Part of the spanos3/r202639/03 batch 2 work.
…o main breaker, and a drive's charge limits A battery the panel declares is a battery even when it publishes no capacity: the clone now keeps it, sized for the modelling and with its capacity, its charge and its MID's islanding state left unvalued as the panel leaves them, where the clone used to drop it and its MID. A panel declaring no main breaker is cloned with none, and publishes no breaker node, instead of an invented 200 A one; the dashboard takes an empty size as no breaker. A SPAN Drive's commissioned maximum charge current and the user's limit are kept on the circuit that feeds it, with what the drive leaves unvalued. The fourth reference capture is now reproduced by both routes. Part of the spanos3/r202639/03 batch 2 work.
…y share A clone keyed each circuit by its first space, so two circuits on one space, as circuits sharing a meter and relay are, got one id and the panel would not start. Each now keeps the space as its key in device id order, the first as before and each after it with a suffix, so a later clone of the same panel gives each the same id. Each names the circuits it shares its meter and relay with, which the panel publishes on both, and validation refuses a circuit naming no other circuit of the panel. The fifth reference capture is now reproduced by both routes. Part of the spanos3/r202639/03 batch 2 work.
A reproduction drives its emitter from its own physics, so its signs at any moment are its own: a load that backfed when the panel was captured, a battery charging then and discharging now. Each cell now publishes its first tick from the readings the capture was recorded with, moved onto the reproduction's devices by where they are, with the reproduction's own envelope, so signs compare like for like. The signs the emitter cannot reproduce now occur as the emitter shows them, and on the import route, which publishes the emitter's own definition, a listed difference that no longer occurs fails, so the list never outlives its reason. Part of the spanos3/r202639/03 batch 2 work.
A panel before release 202639 publishes its one aggregate inverter fed by no circuit, and the clone found its inverter only through the circuit feeding it, so it dropped it. Such an inverter is now cloned as the config's pv section, in the panel, with its identity and rating. Every reference capture the pinned emitter ships is now reproduced by both routes, so no cell stands as an expected failure. Part of the spanos3/r202639/03 batch 2 work.
…as no inverter device The variant the hardware version string selects for these panels publishes no inverter as a device of its own, and the emitter refuses one, so a panel with solar would not start. PanelBench now publishes the inverter there as the circuit feeding it, with the eBus connection/feeds-role SOLAR, and the emitter books that circuit's power as the panel's solar flow. A clone reads a circuit with that role back as the solar one. No reference capture shows solar under that variant, so its tests follow the eBus catalog and are marked spec_only, a marker registered with strict markers on. Part of the spanos3/r202639/03 batch 2 work.
…tter ships The emitter ships masked captures of real SPAN panels, each with the definition recorded with it. Each now becomes a default_ template a user can run or clone, named by the capture's handle: at every start the definition is read through PanelBench's own definition import, with PanelBench's simulation defaults and a serial of its own, and written into the config directory where it is missing or stale, as the shipped templates are refreshed. No copy of a capture lives in this repository, so an emitter release brings its captures' templates with it. Each template's test loads it as the dashboard does and runs it at the captured instant, where it reproduces its capture. The cells and the templates share that harness. Part of the spanos3/r202639/03 batch 2 work.
…t a copy The pinned emitter now ships its reference captures as package data, the captured MAIN 32 on release 202639 among them, byte-identical to the copy kept here. The tests read it through load_reference_capture and the copy is gone. The emitter's example is not in its wheel, so its definition and ticks stay vendored, and PROVENANCE.md says so. Part of the spanos3/r202639/03 batch 2 work.
Part of the spanos3/r202639/03 batch 2 work.
…roximity where none is offered The status endpoint now reports the hardware version string the reference captures' panels publish as it is, where it reported UNKNOWN, so a rig on that hardware reports over REST what it publishes over MQTT. That hardware offers no proof of proximity, so its status reports proximityProven false, where every simulated panel reported it proven. Part of the spanos3/r202639/03 batch 2 work.
A config can now ask its panel to limit how often each client registers: past the limit within a minute, POST /api/v2/auth/register answers 429, with Retry-After in seconds or, where the config says so, without it, so a client can be rehearsed against both answers. A config naming no limit registers every client every time, as before. Part of the spanos3/r202639/03 batch 2 work.
The emitter models one meter outside the panel, on the service conductor, and refuses a second when the panel starts; validation now refuses it first, as it does a meter whose id a circuit already has. Part of the spanos3/r202639/03 batch 2 work.
Registration answered every client with the default MQTTS port, whatever port the simulator's broker was given, so a panel on a moved broker sent its client to the wrong one. It now answers with the broker port the simulator was started with. Part of the spanos3/r202639/03 batch 2 work.
…e emitter Each CONFIG_NAME now runs as its own simulator with its own PID file, so several configs run at once on one broker, each on the HTTP and dashboard ports it is given, and --stop and --status cover every one. UV_NO_SYNC=1, uv's own switch, keeps the virtual environment as it is rather than syncing it to the lockfile, so an emitter installed editable from a local checkout survives, and the script prints which emitter it runs. The reference templates are now replaced whole, so simulators starting together from one config directory never read half a file. Part of the spanos3/r202639/03 batch 2 work.
The known differences, the off-grid baseline note, the breaker placeholder comment and PROVENANCE.md named the release they were checked against; each holds on the pinned 0.10.0b2, where the strict expectations still fail as listed and the vendored example is byte-identical to its tag. Part of the spanos3/r202639/03 batch 2 work.
…r stops a start The reference templates are written at every start, and a read-only directory, a missing permission or a full disk raised out of startup. Each template's file operations are now guarded: one the directory will not take is logged with its path and the reason and skipped, and the app starts without it. Part of the spanos3/r202639/03 batch 2 work.
Every write staged the template under one fixed name beside it, so simulators starting together from one config directory raced on that file. Each write now stages in a unique file in the same directory, replaces the template with it, and removes it again if the write fails. Part of the spanos3/r202639/03 batch 2 work.
An unvalued, mid_unvalued or device_unvalued given as anything but a list, such as a bare string, was dropped without a word, so the panel published values its config said it leaves unvalued. Validation now refuses one that is not a list of node/property paths, naming where it is. Part of the spanos3/r202639/03 batch 2 work.
…mware year The ignore rule for the generated templates matched the year in today's capture names, so a capture named without it would have been tracked. Each template is now named default_reference_ and the capture's handle: default_ keeps it a read-only template in the dashboard, and the marker lets one rule in .gitignore cover every one by convention. Part of the spanos3/r202639/03 batch 2 work.
A real panel carries its own broker. Panels run side by side shared one, so every subscriber was handed all of their retained trees at once, and a large tree beside its neighbours overran mosquitto's per-client queue of 1000 messages, which a broker of its own never reaches. Each BROKER_PORT now runs its own mosquitto with its own config, password file and PID file; --stop and --status cover every one. spanos3/r202639/03 batch 2
A panel whose inverters sit where no circuit of its own feeds them publishes each as a PV device fed by nothing, and a config could describe only one: the pv section's own keys, so a clone or an import of such a panel with two kept the first and dropped the second. The pv section now takes `inverters`, one entry per inverter no circuit feeds, each with its own vendor, model, rating, and optionally its serial, firmware, inverter type and placement. Given, the section's own keys describe only an inverter a PV circuit feeds, so on a panel with none they are refused rather than dropped. Each entry is published as its own device, numbered after the inverters circuits feed, upstream unless it says otherwise, taking the section's firmware unless it has its own. Validation refuses a malformed entry, a shared identifier, several solar devices on a release before 202639 and a variant that publishes no inverter device. A clone writes `inverters` for several such inverters, or one beside a fed one; a panel's one such inverter with no PV circuit stays in the section's own keys as before. Their production is not published yet: the emitter takes solar power from circuits alone. spanos3/r202639/03 batch 2
They are no circuit, so the entity list, which lists circuits, cannot show them, and a panel publishing two of them looked like a panel with none. A card of their own now lists each with its vendor, model, rating and placement, as the config describes them. spanos3/r202639/03 batch 2
A reference capture's template was named by the capture's handle, which says what the panel is for only some captures. Each is now named by the model its panel publishes, or UNKNOWN and its spaces where it publishes none, then its firmware release, so the dashboard's list and a --config read as hardware. The names are written out rather than read from the capture, so publishing a capture again never renames a template, and a test holds each name to what its capture publishes. A capture with no name here keeps its handle, and every serial is unchanged. Part of the spanos3/r202639/03 batch 2 work.
scripts/rigs.sh runs each panel scripts/rigs.conf lists through run-local.sh, with a broker and ports of its own taken from the panel's slot, and stops them all again. It starts them one at a time, each answering before the next, since the first start writes the certificates and the generated templates the others read. The table names the reference captures' templates and one config kept by hand in the config directory. Part of the spanos3/r202639/03 batch 2 work.
A reference capture's template was default_reference_ then its model and firmware release. It is now ref_ then its model alone, as ref_MAIN_32.yaml, so rigs.conf and a --config name it shortly; the release is the template's firmware_version, not its name. The r202633 MAIN_32 capture would take the r202639 one's name, so it is written as no template, and rigs.conf drops its slot. The other rigs keep their slots, so Home Assistant still finds each on its port. The dashboard kept a template read-only by its default_ prefix alone. It now keeps a ref_ one read-only too (is_template): neither is saved over nor deleted, both are listed as templates, and a clone of one is offered its name without the prefix. The ignore rule follows the new prefix. Part of the spanos3/r202639/03 batch 2 work.
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.
PanelBench's share of the spanos3/r202639/03 batch 2 work, which the library and the integration took through
prerelease/3.8andprerelease/2.2. It moves to theebus-panel-sim0.10.0b2 emitter and holds PanelBench to every reference capture of a real SPAN panel that the emitter ships. Every capture is now reproduced both by cloning it and by importing its definition. This opensprerelease/2.7.Change
Emitter:
ebus-panel-sim0.9.0 → 0.10.0b2info/spacesin words as SPAN firmware publishes it, and the off-grid import limit only where it is commissioned.info/name, as on a SPAN panel. The comparator keys a circuit by itsinfo/name.Fidelity: every reference capture is a cell
Clone: what it takes to reproduce the captures
UNKNOWNshed priority is cloned with one the emitter accepts, where it built a panel that would not start.PV
SOLARfeeds role, and read back that way by a clone. No capture shows this, so its tests follow the eBus catalog and are markedspec_only.inverters, one entry for each inverter no circuit feeds, and each is published as its own device. The dashboard lists them on a card of their own.REST
proximityProven: falsewhere the hardware offers no proof of proximity.Retry-Afteror without it.Validation now refuses
unvalued,mid_unvaluedordevice_unvaluedthat is not a list of paths;invertersentry.Templates from the reference captures
ref_and their model, as inref_MAIN_32.yaml. The dashboard keeps aref_template read-only as it does adefault_one.Running several panels locally
scripts/run-local.shruns eachCONFIG_NAMEas its own simulator, with its own ports and its own mosquitto, as a real panel carries its own broker. One shared broker overran mosquitto's per-client queue on large retained trees.UV_NO_SYNC=1keeps an emitter installed editable from a local checkout.scripts/rigs.shstarts and stops the panelsscripts/rigs.conflists, one at a time, since the first start writes the certificates and templates the others read.Checks
tests/integrationran rather than skipped. The six are the captured MAIN 32 clone round trip's known differences. Each names its cause in the 0.10.0b2 emitter, one of them filed upstream as #66. No reference-capture cell is among them.mainat630b8d5, which is whereprerelease/2.7was cut, and merges into it without conflict.Before 2.7.0 can ship
ebus-panel-simis pinned at 0.10.0b2, and 0.10.0b3 is already published.## 2.7.0section is one placeholder line, and the release needs the user-facing write-up 2.6.0 has.config.yamlandpyproject.tomlstill say 2.6.0. A build offmainrefuses a version without a pre-release marker, so a pre-release build from this branch needs the bump to2.7.0b1first.invertersdevices publish no production yet, because the emitter takes solar power from circuits alone.