Aggregation & rolling windows
Raw streams can be noisy or too fast to plot usefully. Aggregation rolls points into one value per interval.
- Set an aggregation function (
avg,min,max,sum,count,last) and an interval on a widget's source. The interval is a duration —30s,5m,1h. - The widget keeps a rolling window one interval long and shows the aggregate of the readings in it, refreshing every interval or every 10 seconds, whichever is shorter — so a 5-minute average updates every 10 s, not every five minutes.
- On load, a value widget shows the aggregate of the last interval of stored readings straight away (the last 5 minutes for a 5-minute average), so it isn't blank and doesn't jump when the first live readings arrive. A chart loads the dashboard's whole time range instead.
- When the device goes quiet, readings age out of the window and the widget stops updating, so it shows no recent data rather than a frozen number.
Scaling is applied after aggregating: the tag's scale factor applies to every function, its offset to all but sum (an offset per reading would be added once per reading), and a count is a number of readings, not a reading, so it is not scaled at all.
Use a longer interval to smooth trends; use max to catch spikes you'd otherwise miss between samples. For long ranges, combine with the rs485-query source for server-side bucketing — or, for a chart over the whole dashboard range, use the time-axis line chart.