Correct the VIC1 Heywood interconnector id and make interconnector entities deterministic - #49
Merged
Conversation
…nistic VIC1_INTERCONNECTORS listed SA1-VIC1, which AEMO does not publish, so VIC1 never got a Heywood sensor while SA1 did. Corrected to V-SA. Interconnector entities were gated on the contents of the fetch that happened to be in hand at setup, so the entity set varied between restarts and an interconnector missing from one file disappeared entirely rather than reporting unavailable. Entities now come from the static region map, and a DEBUG line records which of them have no data in the current result. Fixes #46 Fixes #48
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.
Fixes #46
Fixes #48
Addresses #47
Three defects in the same eight lines of interconnector setup, so they are fixed together rather than as three conflicting branches.
Heywood was mapped under an id AEMO does not publish (#46)
VIC1_INTERCONNECTORSlistedSA1-VIC1. The PD7DAY file publishes Heywood asV-SA, whichSA1_INTERCONNECTORSon the next line already used. Because the VIC1 id never matched a key in the parsed result,narrow_result()dropped it and VIC1 ended up with no Heywood sensor while SA1 had one. Corrected toV-SA.The entity set changed from restart to restart (#48)
Interconnector entities were created only for ids present in the coordinator's data at the moment setup ran:
Three outcomes were reachable for the same install. A populated coordinator created only what that one fetch contained. An empty coordinator fell through the
orand created the full static set. A partial fetch silently created neither an entity nor a log line for the interconnector it was missing.That last case is the damaging one. A missing entity is not an unavailable entity: it drops out of dashboards, breaks templates and automations that reference it, and leaves no recorder history, with nothing logged to explain it. It also made entity counts useless as a release signal, since a count after one restart could not be compared with a count after another.
Entities now come from the static region map alone.
PD7DayInterconnectorSensor.availablealready returnsFalsewhen the coordinator holds no row for the id, so an interconnector with no data reports unavailable, which is the behaviour the rest of the integration follows for missing data.NSW1 was missing Terranora on a live install (#47)
N-Q-MNSP1is mapped to both QLD1 and NSW1 and was present in the data, with the QLD1 side reporting -164.043 MW, yet NSW1 carried no such entity. The cause was not established from the REST side, because a disabled registry entry is invisible to both/api/statesandintegration_entities()and the entity registry is WebSocket only.Removing the live gate covers the case where the entity was never added. If it was instead disabled in the registry, that will not be fixed by code and the issue stays open. A DEBUG line now records what was created and which of those have no data in the current result, so the next restart distinguishes the two without guesswork:
#47 is left open until a restart confirms which case it was.
Tests
Five added, 560 passing against a 555 baseline.
V-SAis mapped to VIC1 andSA1-VIC1is goneUpgrade effect
VIC1 users gain one sensor, Heywood. Regions whose interconnectors were absent from the fetch at setup time gain those entities in an unavailable state rather than having them missing. Nothing is renamed or removed, so there is no migration.