I have a switch item tracking when an item is online/offline (not linked to the thing online).
I set up influxdb persistence so I could graph the stability.
In all other cases, this maps to 0 or 1 and if I log it regularly and on change I can get a decent square line chart to easily identify how stable the device is.
For one particular switch though, the values being stored are mostly 0/1 but with random decimal values in between resulting in a graph like this:
The chart in the original post is from the InfluxDB UI (Influx DB 2 on a separate machine). I tend to do all my charting in Grafana on top of Influx. Have many other charts working fine.
The built in charting still uses rrd4j, though that doesn’t seem to chart Switches.
Don’t know if you already solved it but, for anyone else dealing with this this, I might have the reason why this happens. The InfluxDB data explorer adds the following aggregation statement by default:
If there is one 0 and one 1 in an aggregated time windows, this will result in an aggregated value of 0.5 and so on. You can remove that line by switching from the query builder to the script editor and the values should be as expected.