A telemetry value can be a number, true/false, text or a JSON object or array. All four are stored, but they are not equally useful later: only numbers have a chartable history and summaries. Decide the type of each key before your devices go live.
What each type gives you
| Type | Example | Latest value | Raw history (up to the raw window) | Minute, hour and day summaries | Charts over long windows |
|---|---|---|---|---|---|
| Number | 21.5 | Yes | Yes | Yes (sum, count, min, max, last) | Yes |
true / false | true | Yes, shown as On / Off | Stored | No | No |
| Text | "running" | Yes | Stored | No | No |
| JSON | {"x": 1, "y": 2} | Yes | Stored | No | No |
Numbers written as text ("21.5") are stored as text, not as numbers. Send numbers as JSON numbers.
Why non-numbers do not chart
- Summaries are numeric. The minute job adds up, counts and compares numbers. Text, booleans and JSON values have no minute, hour or day summary.
- Long windows read summaries. A chart or API read over more than 24 hours reads the summaries, so a text or boolean key has no points there.
- Short windows read raw rows, but the device’s Telemetry tab and line charts draw numeric points only; a non-numeric point is not drawn.
So a text or boolean key shows well on a value card (latest value) but leaves a gap in a trend, and an increase, average or count over it is empty.
Store states as numbers
When you want the history of a state, send (or derive) a number:
| Instead of | Send |
|---|---|
"door": true / false | "door_open": 1 / 0 |
"state": "running" / "stopped" / "fault" | "state_code": 1 / 0 / 2, and keep "state": "running" for display if you like |
"zone": "Hall B" | "zone_id": 12 |
"event": "sos" | "event_code": 3 |
With 0/1 values:
- the average over an hour is the share of the samples that were 1 (for example the share of samples with the pump running; a device that reports at a steady interval makes this the share of the time);
- the max over a day tells whether it happened at all;
- the sum of a 1-per-event key counts events.
Name the codes in the device profile’s Label and in your dashboard’s value mappings so people see words, not numbers.
Converting in a flow
If you cannot change the device, convert in the root flow before Save telemetry. For example, to add door_open from a boolean door:
- After the Message type switch, on the telemetry branch, add a Change block.
- Add a step: set
msg.payload.door_opento the expressionmsg.payload.door ? 1 : 0. - Keep the original
doorkey, or add a second step deletemsg.payload.doorto store only the number.
For text states, use a Switch on msg.payload.state with one rule per state, each followed by a Change that sets msg.payload.state_code, then join the branches into Save telemetry. See Derived values.
Booleans in the profile
Set the key’s Type to Yes / no in the device profile. Dashboards then show the value as a flag (on value cards, switches and status lamps). This changes how the latest value is shown, not how the history is stored.
Text limits
- Text: up to 1,024 characters. Longer text drops the key (
string_too_long). - JSON: up to 4 KiB when written as JSON (
value_too_largeabove it). - A JSON value is stored whole. If you need one of its fields as a trend, store that field as its own numeric key, for example with a Change block that sets
msg.payload.pos_xtomsg.payload.position.x.
Positions
A map card reads latitude and longitude from numeric keys (for example lat and lng). Send them as numbers. A position inside a JSON object cannot be charted or used for route replay.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| A value card shows a value, the chart says No values in this window | The key is text or boolean. Store a numeric copy. |
| A key shows as Text on the Telemetry tab though it holds numbers | The device sends numbers as text ("21.5"). They have no summaries and cannot be ticked for the trend. Send JSON numbers, or convert with number(msg.payload.key) in a flow. |
| A count or average of events is always empty | The event is text. Store a 1 per event (or an event code) as a number. |
See also A dashboard shows no data.

