Repository navigation
fix(snapshot): a panel with no MID is on-grid whatever grid power reads - #216
Merged
Merged
Conversation
With no MID, resolve_islanding_state answered on-grid only while power-flows/grid read more than 1 W and nothing otherwise, so dsm_state and current_run_config dropped to UNKNOWN for one update each time the reading touched zero. A sub-panel with a small net draw does that many times a day, and a consumer saw each return as the grid coming back. A panel with no MID cannot separate from what feeds it, and what feeds it is what SPAN treats as the grid, so tier 3 now answers on-grid without reading grid power. This is the elimination resolve_dominant_power_source already makes. The threshold never defended the generator-fed island it was written for, which read far above 1 W under any load and was reported on-grid all the same. The fidelity rule that let power-flows/grid move the grid answers goes with the read it described. The reference captures declare no MID, so their rules document the two on-grid answers as derivations, beside the GRID elimination already documented for dominant_power_source. Refs #215
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.
Refs #215.
On a panel with no MID,
dsm_stateandcurrent_run_configdropped toUNKNOWNfor one update each timepower-flows/gridread within 1 W of zero, then returned. A sub-panel with a small net draw does that many times a day, and an automation watching the sensor saw each return as the grid coming back.Cause
resolve_islanding_statefalls to tier 3 when the tree declares no MID. Tier 3 answeredON_GRIDonly whileabs(power-flows/grid) > 1.0andNoneotherwise.Change
Tier 3 now answers
ON_GRIDwithout reading grid power. A panel with no MID cannot separate from what feeds it, and what feeds it is what SPAN treats as the grid. This is the eliminationresolve_dominant_power_sourcealready makes for the same trees.The threshold was written to avoid calling a generator-fed island on-grid. It never did that: such a panel reads far above 1 W under any load and was reported on-grid all the same. Its only effect was to withdraw the answer near zero flow.
mid is Nonemeans no MID is declared, not that one is still being discovered, because the adapter builds no snapshot until every declared device has described itself. A MID that exists and has not answered still reports unknown.panel.py: tier 3 returnsON_GRID; the schema-1_GRID_POWER_EPSILON_Wis removed; theresolve_islanding_stateandresolve_dominant_power_sourcedocstrings are brought in line.snapshot.py: one comment updated.tests/adapter_fidelity/rules.py: the rule that letpower-flows/gridmove the grid answers is removed with the read it described.tests/adapter_fidelity/rules_captured.py: the reference captures declare no MID, sodsm_stateDSM_ON_GRIDandcurrent_run_configPANEL_ON_GRIDare documented as derivations, beside theGRIDelimination already documented fordominant_power_source. Each admits only the on-grid value.packages/schema-1/CHANGELOG.md: one Fixed entry under Unreleased.Checks
test_no_mid_is_on_grid_whatever_grid_power_readsreplaces the tier 3 test, andtest_a_panel_with_no_mid_keeps_its_grid_answers_through_a_zero_grid_readingreplays the samples from the issue through a tree with no MID. Both fail against the previouspanel.pywithNoneandUNKNOWNon the0.0sample.r202639-a,-band-epass with the two derivations, andtest_every_derivation_is_neededholds both to a capture that uses them.pre-commit run: all hooks pass. Tests: 1857 passed, 7 skipped, 9 xfailed, coverage 96.68%.