power: the Cerbo keepalive sends an empty payload, not the time

An inject left to itself emits the current time. That went into a port
declared `str`, the node raised on every tick, and after five the supervisor
quarantined the whole `power` flow — which is every Victron reading in the
house. It was invisible because Node-RED is still sending its own keepalive,
so the Cerbo kept publishing anyway; the first thing to notice would have
been the data stopping some minutes after Node-RED did.

The preflight now checks what an inject emits against the port that receives
it. Nothing else could: an inject has no source to run, and both halves of
the declaration agreed with each other while disagreeing with reality.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-22 16:40:44 +02:00
co-authored by Claude Opus 5
parent a102a2f57a
commit 13cdfa79b9
2 changed files with 35 additions and 1 deletions
+4 -1
View File
@@ -165,7 +165,10 @@ def power(h: dict[str, Any]) -> Flow:
"id": "keepalive_tick",
"type": "inject",
"title": "Every 30 seconds",
"params": {"interval": 30, "at_start": True},
# An empty payload, as the reference sends: the Cerbo only wants
# to know somebody is listening. Left to itself an inject emits
# the time, which is a float going into a string port.
"params": {"interval": 30, "at_start": True, "payload": ""},
"provides": [{"name": "keepalive", "dtype": "str"}],
}
)