I am collecting data from my electricity meter. Every day at 3AM I get a usage figure for the previous day which I send into InfluxDB via NodeRed.
The data is generated by a little Python file and consists of a JSON string:
{"UsageDate": "2022-08-14", "Usage": 9.622}
Each reading arrives during the day following UsageDate, so when I send it to InfluxDB it gets a timestamp which is actually a day late. I want to display this data as a bar chart/histogram in Grafana - but I don't know how to use the dates in UsageDate (which is stored in InfluxDB as a string at the moment) as the x-axis of my graph.
Can I persuade Grafana to use that date, or do I need to do something clever to make InfluxDB timestamp my data for the day it belongs to, rather than the day it arrives in InfluxDB.
the solution is transformations. You need to do 2 things: