Repository navigation
Description
What happens
A driver that has just started is marked stale before its first reading can arrive, and it receives its autonomous default mode. This happens on every Core start, update and driver install, not only after the configured watchdog timeout.
Registry.Addcreates the health record at once (go/internal/drivers/registry.go:738,EnsureDriverHealth).LastSuccessis nil andStatusis the zero value,StatusOk.- On the next control tick,
WatchdogScantreatsLastSuccess == nilas stale andStatus != StatusOfflineas online (go/internal/telemetry/store.go:749). - The driver flips offline,
sendDriverDefaultruns andDriverLostis published (go/cmd/ftw/main.go:2936).
A driver whose first poll is slow never gets the 60 s grace period. Cloud drivers such as easee_cloud fall in this group, because they log in before they poll.
Evidence (home box, v0.136.3-beta.1 and v0.136.4-beta.1)
Every Core restart or driver install since 2026-09-24 18:00 shows the same sequence. Easee then applies its default, phaseMode → 3 and a rewrite of dynamicChargerCurrent:
| Driver added | Marked stale | Cause |
|---|---|---|
| 18:40:46 | 18:40:50 | Core update |
| 19:11:55 | 19:11:59 | Core update |
| 20:30:07 | 20:30:11 | Core update |
| 20:56:26 | 20:56:30 | Core update |
| 06:59:16 | 06:59:19 | Core update to v0.136.4-beta.1 |
| 07:03:02 | 07:03:04 | easee_cloud 1.3.2 → 1.3.3 install |
There were no events between restarts (21:00–06:59). The overnight EV stops were a different cause, fixed in #1417.
Effect
The charger or battery gets its autonomous default on every restart, whatever the plan says. At 07:03 the Easee resumed with a 16 A offer ("auto-resumed after pause"). For a battery, the default hands control back to the inverter for a moment. For Easee, it also writes firmware settings to the cloud. DriverLost has no subscribers today, so no notification fires.
Expected
A driver that has started but not yet emitted counts as fresh until the watchdog timeout has passed since its start. A driver that never emits still goes stale after that timeout and receives its default, as today.
Suggested fix
Record when the health record was created (StartedAt). WatchdogScan uses it in place of LastSuccess while LastSuccess is nil. Add a test with two cases: a newly added driver without an emit is not stale before the timeout, and is stale and defaulted after it.
Activity