I recently set up a software defined radio to read my house power meter and store it in InfluxDB, and would like to visualize this consumption in Grafana. The organization of this data has me stumped how to do this - the consumption data is an integer number of kilowatt hours and I get a new record in Influx only when that value changes. So when rate of consumption is (change in kilowatt hours)/(change in time) in this case the (change in kilowatt hours) is always 1 and the (change in time) might be 20 minutes to an hour - the time interval between measurements is irregular.
So for starters I’d like Grafana to graph the most recent rate of consumption which is 1/(time of most recent entry - time of second most recent entry). Then I’d like to graph the historical rate of consumption.
Any clues on how to do this? If I just sample the current integer consumption value several times an hour I’m not going to get a useful value.
Unfortunately I haven’t made any progress on this yet and would be happy to share what the data looks like in influx. Here are some sample records:
The first column is the timestamp and the second column is the new cumulative value on the power meter. So the point of my question is that the actual value for the cumulative power meter isn’t interesting, it’s simply always the previous value incremented by one. The real data here is the amount of time it took for the power value to increment by one which happens two or three times per hour which means the samples are inconsistently spaced but still represent kwh/time. I’d like the Grafana output to show that for the time between the samples I was using X kwh/hour.
I’m currently using Grafana 7.5.1 but could upgrade to 7.5.X trivially if it would help.
ok, so first thing: have you managed to configure the InfluxDB datasource in Grafana and get your data into the app? Can you write any queries and visualize your data “as is” in Grafana, or are you not at that stage yet?
Yes (BTW I’ve configured Grafana for other things so I’m able to do basic config). I’ve got a data source called InfluxDB-utilities) and can display something (not what I want) with the query:
FROM autogen power WHERE
FORMAT AS Time Series