Skip to main content

Not every live reading is written to the database

While at least one client is watching a device, tcpserver raises its poll cadence to 30 seconds. Those extra readings are marked cadence: "watched", and only cadence: "default" readings are persisted — watched-cadence readings are forwarded live to watchers and then dropped.

That is deliberate: watching exists to give a screen a fast refresh, and storing a 30-second cadence for every watched device would multiply storage for data nobody queries later.

Watching a device does not stop its history. Every active, registered device lays down one stored reading per 5 minutes whether or not anyone is looking at it: while watched, one reading in every ten is labelled "default" instead of "watched" and is persisted normally. That relabels a reading the poll loop already took, so it costs no extra Modbus traffic, and the stored series keeps the same uniform 5-minute spacing that the Daily chart's rollup assumes.

So a client watching a device sees a telemetry message roughly every 30 seconds, of which roughly every tenth also lands in the database. Clients should not read anything into which label a message carries — it describes what the backend does with the reading, not the reading itself.

:::note Changed behaviour Before this, the label was derived purely from whether the device was being watched, so a watched device produced nothing but "watched" records and its stored history stopped completely for as long as an app was open on it. If you are looking at older data, gaps that line up with someone viewing the device are this, not a device or ingest fault. :::