Closed starsoccer closed 12 months ago
Any particular value is only published to MQTT when it changes (and at startup, to set the initial state). All messages are sent retained, so even if a subscriber wasn't around when it was originally sent, they'll still get the most recent value.
Okay thanks. Is there anyway to tell if the data has simply not changed vs being stale?
For context on my use case, I am looking at using telegraf to pipe mqtt values into influx to have charts in grafana. While it works OK as is, telegraf only pipes data when a message is published(I believe). So what ends up happening currently is telegraf starts, takes current data and broadcasts it, then it is never broadcasted again and a chart ends up looking a bit ridiculous like this:
There may be a better solution to this within telegraf but Im not super familiar with it generally
Well right after posting I was able to resolve this. For anyone else who hits this under the query options you can choose a fill option and select previous for it to just backfill the value
How often should data published via mqtt be updated, or is data only updated when an actual change takes place? Asking as I see some data that gets updated every few seconds, and then other points that seem to get 2 or 3 updates, and then never update again.
A good example of this is cooling set point. It gets updated when started, and then never updates again.