A field we have no name for is still a field it sent
Two cards on the Charging page were answering with a fraction of what the charger and the account actually report, and in both the losses happened quietly, in a parse that kept the fields it recognised and dropped the rest on the floor. Charger information asked three account-wide views and kept fourteen fields. A charger registered on its own is absent from the site view, which is the only one of the three carrying state, charge power and OCPP status — so exactly the charger that stands alone got the column of dashes, and nothing said why. The per-charger station record, get_evcharger_station_info, is what the mobile app opens when you tap a charger, and it is the one view that answers for a charger outside a station; it is now the fourth view, asked per charger, a failure there costing that charger's row and no more. Alongside it, every field each of the four views sent is kept as attrs, under the cloud's own key, nested objects joined with a dot and arrays carrying their index. First view to answer a key wins, which is the rule the named fields already merged by. Two hundred keys and two hundred and forty runes per value keep a station record with a session list from becoming the whole card. Charger readings lost data twice over. The frame decoder skipped any field byte its per-message map could not name, and a message type with no map decoded to nothing at all; those fields are now kept under the message and the byte they arrived in — 0410.c9 — decoded but unscaled, because a factor is half of a meaning and we do not have the other half. Then the projection read forty-odd names into typed fields and dropped the remainder: sessionStartedAt, the per-phase session energies, the three touch modes, the load-balance monitor and its meter flag, the solar monitor. Those land in extra, and the list maintains itself — the four accessors note every key they read, extra is what is left, and a field modelled later stops appearing there without anyone remembering to remove it. Keeping unnamed fields had one consequence worth guarding. An unmapped message now decodes to something rather than nothing, and ingest stamped settingsAt for anything that was not telemetry — the timestamp a control command waits on to say the charger acknowledged it. A frame we cannot read is not an acknowledgement, so the stamp is now conditional on the message type being one we map, while its fields are kept either way. Both cards show the remainder as what it is: the service's own key, no unit, no translation, no renaming, under a heading that says whose words these are. The blocks appear only when there is something in them, so a Modbus charger's readings card and a charger the cloud says nothing more about are unchanged. Naming one of these fields is a later commit, made from evidence; inventing a label for it today would only make a guess look settled. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1dc20461de
commit
2425a8d3d6
@@ -171,6 +171,8 @@
|
||||
"mqttLink": "MQTT",
|
||||
"alarmWord": "Ord {n}",
|
||||
"alarmsHint": "Laderen melder en alarm. Anker offentliggør ikke, hvad de enkelte bit betyder, så ordene vises, som de kommer.",
|
||||
"extra": "Som laderen sender det",
|
||||
"extraHint": "Værdier, laderen sender, som DriverVault ikke har et navn til — vist råt og uden omregning. En nøgle som 0410.c9 angiver beskeden og den feltbyte, den kom i; Anker offentliggør ikke deres betydning.",
|
||||
"phaseMode0": "Automatisk",
|
||||
"phaseMode1": "Enfaset",
|
||||
"phaseMode3": "Trefaset",
|
||||
@@ -212,7 +214,9 @@
|
||||
"added": "Tilføjet",
|
||||
"online": "Online",
|
||||
"offline": "Offline",
|
||||
"refresh": "Opdater"
|
||||
"refresh": "Opdater",
|
||||
"rawTitle": "Som tjenesten melder det",
|
||||
"rawHint": "Alle øvrige felter, tjenesten sendte om denne lader, under Ankers egne navne. De er udokumenterede, så de vises, som de kommer, i stedet for at blive omdøbt."
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -157,6 +157,8 @@
|
||||
"mqttLink": "MQTT",
|
||||
"alarmWord": "Word {n}",
|
||||
"alarmsHint": "The charger reports an alarm. Anker does not publish what the individual bits mean, so the words are shown as they arrive.",
|
||||
"extra": "As the charger sends it",
|
||||
"extraHint": "Values the charger sends that DriverVault has no name for, shown raw and unscaled. A key like 0410.c9 names the message and the field byte it arrived in; Anker publishes no meaning for them.",
|
||||
"phaseMode0": "Automatic",
|
||||
"phaseMode1": "Single-phase",
|
||||
"phaseMode3": "Three-phase",
|
||||
@@ -198,7 +200,9 @@
|
||||
"added": "Added",
|
||||
"online": "Online",
|
||||
"offline": "Offline",
|
||||
"refresh": "Refresh"
|
||||
"refresh": "Refresh",
|
||||
"rawTitle": "As the service reports it",
|
||||
"rawHint": "Every other field the service sent about this charger, under its own field names. They are undocumented, so they are shown as they arrive rather than renamed."
|
||||
},
|
||||
"stations": {
|
||||
"heading": "Nearby",
|
||||
|
||||
@@ -173,6 +173,8 @@
|
||||
"mqttLink": "MQTT",
|
||||
"alarmWord": "Słowo {n}",
|
||||
"alarmsHint": "Ładowarka zgłasza alarm. Anker nie publikuje znaczenia poszczególnych bitów, więc słowa pokazane są tak, jak przychodzą.",
|
||||
"extra": "Tak, jak przysyła to ładowarka",
|
||||
"extraHint": "Wartości, które ładowarka przysyła, a dla których DriverVault nie ma nazwy — pokazane surowo, bez przeliczeń. Klucz w rodzaju 0410.c9 wskazuje wiadomość i bajt pola, w którym przyszła; Anker nie publikuje ich znaczenia.",
|
||||
"phaseMode0": "Automatycznie",
|
||||
"phaseMode1": "Jednofazowo",
|
||||
"phaseMode3": "Trójfazowo",
|
||||
@@ -214,7 +216,9 @@
|
||||
"added": "Dodano",
|
||||
"online": "Online",
|
||||
"offline": "Offline",
|
||||
"refresh": "Odśwież"
|
||||
"refresh": "Odśwież",
|
||||
"rawTitle": "Tak, jak podaje to usługa",
|
||||
"rawHint": "Wszystkie pozostałe pola, które usługa przysłała o tej ładowarce, pod jej własnymi nazwami. Nie są udokumentowane, więc pokazujemy je tak, jak przychodzą, bez zmiany nazw."
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -519,6 +519,20 @@ const deviceIdentity = computed(() => {
|
||||
]);
|
||||
});
|
||||
|
||||
// Everything the charger sends that none of the blocks above has a name for.
|
||||
// Over the cloud a message carries more fields than this integration models, and
|
||||
// some of them no published map names at all — those arrive keyed by the message
|
||||
// and the field byte they came in ("0410.c9"). They are shown raw: no unit, no
|
||||
// scaling, no translation, because a factor and a label are part of a meaning
|
||||
// Anker does not publish. Named leftovers sort first, the byte-keyed ones after,
|
||||
// so the readable half is not buried under hex.
|
||||
const deviceExtra = computed(() => {
|
||||
const extra = dev.value.extra || {};
|
||||
return Object.keys(extra)
|
||||
.sort((a, b) => a.includes(".") - b.includes(".") || a.localeCompare(b))
|
||||
.map((key) => ({ key, value: String(extra[key]) }));
|
||||
});
|
||||
|
||||
// The per-phase readings are a matrix, not a list: three phases against five
|
||||
// measurements. A table says that; twenty labelled pairs hide it.
|
||||
const devicePhases = computed(() => {
|
||||
@@ -819,6 +833,18 @@ function chargerInfoRows(c) {
|
||||
}));
|
||||
}
|
||||
|
||||
// Everything else the service said about this charger, under its own field
|
||||
// names. The rows above are the ones DriverVault has a name for; these are the
|
||||
// remainder — the service documents none of them, so its own key is the only
|
||||
// honest label, and translating or renaming one would be inventing a meaning
|
||||
// for it. Sorted so the same charger reads the same way on every refresh.
|
||||
function chargerAttrRows(c) {
|
||||
const attrs = liveFor(c)?.attrs || {};
|
||||
return Object.keys(attrs)
|
||||
.sort()
|
||||
.map((key) => ({ key, value: attrs[key] }));
|
||||
}
|
||||
|
||||
async function refreshCtl() {
|
||||
const sn = ctlSerial.value.trim();
|
||||
if (!sn) {
|
||||
@@ -1620,6 +1646,20 @@ onMounted(async () => {
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<!-- What the charger sends beyond what we model. It appears only
|
||||
when there is something in it, so a transport that reports
|
||||
nothing unnamed draws no empty block. -->
|
||||
<section v-if="deviceExtra.length" class="rounded-control bg-sunken p-3">
|
||||
<h4 class="eyebrow">{{ t("charging.modbus.extra") }}</h4>
|
||||
<dl class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1">
|
||||
<template v-for="r in deviceExtra" :key="r.key">
|
||||
<dt class="data break-all text-xs text-muted">{{ r.key }}</dt>
|
||||
<dd class="data text-right text-xs text-strong">{{ r.value }}</dd>
|
||||
</template>
|
||||
</dl>
|
||||
<p class="mt-2 text-[11px] text-muted">{{ t("charging.modbus.extraHint") }}</p>
|
||||
</section>
|
||||
|
||||
<!-- Alarms, when any word is non-zero. Which register is set is
|
||||
reportable even though the bit list is not published. -->
|
||||
<section v-if="modbusAlarms.length" class="rounded-control border border-warning/40 bg-warning-soft p-3">
|
||||
@@ -1701,6 +1741,20 @@ onMounted(async () => {
|
||||
<dd class="data break-all text-[11px] text-body">{{ row.value }}</dd>
|
||||
</template>
|
||||
</dl>
|
||||
|
||||
<!-- The rest of what the service knows, in the service's own words.
|
||||
It only appears when there is something in it, which is also how
|
||||
a charger the cloud says nothing more about stays quiet. -->
|
||||
<template v-if="chargerAttrRows(selectedHomeCharger).length">
|
||||
<p class="eyebrow mt-3">{{ t("charging.info.rawTitle") }}</p>
|
||||
<dl class="mt-1 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1">
|
||||
<template v-for="row in chargerAttrRows(selectedHomeCharger)" :key="row.key">
|
||||
<dt class="data break-all text-[11px] text-muted">{{ row.key }}</dt>
|
||||
<dd class="data break-all text-[11px] text-body">{{ row.value }}</dd>
|
||||
</template>
|
||||
</dl>
|
||||
<p class="mt-1 text-[11px] text-muted">{{ t("charging.info.rawHint") }}</p>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<p v-if="homeChargers.length === 0" class="mt-2 text-xs text-muted">
|
||||
|
||||
Reference in New Issue
Block a user