The two cards stop keeping numbers from each other

Charger control and Charger readings each held a reading the other did not.
Control's tiles showed the charger's operating state and the session's energy,
which appeared nowhere in the readout that claims to be the whole snapshot;
readings had the total power and the session length, which are the two numbers
you actually look at after pressing start to see whether anything happened.

Both gaps close. The control card grows two tiles — total power (20068) and
session length (20082) — laid out two by two beside the connector state and the
energy, and they use the readings card's own labels and formatting so the
wording cannot drift apart. They appear only when the charger reports them: the
OCPP status carries neither, so on that path the card keeps its original two
tiles rather than showing a pair of dashes.

The readings card grows the other two: the charging status (20097) leads the
live block, since what the charger is doing is what the block is about, and the
session energy (20084) follows the session length it belongs beside.

Nothing is exclusive to one card any more, which is the point — a number that
can only be read in the card that acts on it is a number you have to go looking
for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81
2026-09-02 10:50:00 +02:00
co-authored by Claude Opus 5
parent e02855173a
commit b27ca3ee19
4 changed files with 28 additions and 0 deletions
+2
View File
@@ -136,6 +136,8 @@
"lineToLine": "Mellem faser",
"power": "Samlet effekt",
"sessionDuration": "Sessionens længde",
"chargingStatus": "Ladestatus",
"sessionEnergy": "Sessionsenergi",
"cpSignal": "Control pilot",
"cpVoltage": "Pilotspænding",
"phaseMode": "Kører på",
+2
View File
@@ -122,6 +122,8 @@
"lineToLine": "Line to line",
"power": "Total power",
"sessionDuration": "Session length",
"chargingStatus": "Charging status",
"sessionEnergy": "Session energy",
"cpSignal": "Control pilot",
"cpVoltage": "Pilot voltage",
"phaseMode": "Running on",
+2
View File
@@ -138,6 +138,8 @@
"lineToLine": "Międzyfazowe",
"power": "Moc całkowita",
"sessionDuration": "Czas sesji",
"chargingStatus": "Status ładowania",
"sessionEnergy": "Energia sesji",
"cpSignal": "Control pilot",
"cpVoltage": "Napięcie pilota",
"phaseMode": "Pracuje na",
+22
View File
@@ -342,6 +342,14 @@ function sessionLength(sec) {
return h > 0 ? `${h} h ${m} min` : `${m} min`;
}
// What the car is drawing and how long it has been, beside the buttons that
// start and stop it — the two numbers you look at to see whether pressing one
// did anything. Both are Modbus registers; the OCPP status carries neither, so
// there the tiles are absent rather than empty, which is also what happens on a
// charger whose firmware does not report them.
const ctlPower = computed(() => unit(mb.value.powerTotal, 0, "W"));
const ctlSessionTime = computed(() => sessionLength(mb.value.sessionSeconds));
// Pairs with no value drop out: a charger on older firmware, or one that refused
// the control block, should show a shorter list rather than a column of dashes.
const rows = (pairs) =>
@@ -350,8 +358,14 @@ const rows = (pairs) =>
const modbusLive = computed(() => {
const s = mb.value;
return rows([
// What the charger says it is doing, and the session's own energy. Both are
// registers of their own, and both were readable only from the tiles in the
// control card — a readout that leaves out the two numbers the page puts in
// front of you is not the full readout it claims to be.
["chargingStatus", s.statusDesc],
["power", unit(s.powerTotal, 0, "W")],
["sessionDuration", sessionLength(s.sessionSeconds)],
["sessionEnergy", isSet(s.sessionWh) ? `${(s.sessionWh / 1000).toFixed(2)} kWh` : null],
["cpSignal", s.cpSignalDesc],
["cpVoltage", unit(s.cpVoltage, 2, "V")],
["phaseMode", enumLabel("phaseMode", s.phaseMode)],
@@ -1065,6 +1079,14 @@ onMounted(async () => {
<div class="data text-sm font-semibold text-strong">{{ ctlMeterKwh }} kWh</div>
<div class="text-[11px] text-muted">{{ t("charging.control.meter") }}</div>
</div>
<div v-if="ctlPower" class="rounded-control bg-sunken px-3 py-2">
<div class="data text-sm font-semibold text-strong">{{ ctlPower }}</div>
<div class="text-[11px] text-muted">{{ t("charging.modbus.power") }}</div>
</div>
<div v-if="ctlSessionTime" class="rounded-control bg-sunken px-3 py-2">
<div class="data text-sm font-semibold text-strong">{{ ctlSessionTime }}</div>
<div class="text-[11px] text-muted">{{ t("charging.modbus.sessionDuration") }}</div>
</div>
</div>
<div class="mt-3 flex gap-2">