I have a problem with how influxdb is grouping data. Let me start by saying that I am using a project called SBFSpot to read data from an invertor (with solar panels attached). Al this data is written to csv files. Telegraf reads these csv’s and put them inside influxdb. I read powergeneration, currents, voltage relay status,… The tool creates 3 csv’s:
- Month data: contains one line per day with power generated for that day.
- Spot data: Live data from the invertor like currents ac/dc, voltages ac/dc, power, relay status. Should be measured every minute. But often the values are just 0 (still looking into that).
- Day data, contains power generated in the last 5 min.
Data collection started on 8th november 2019. Before that there should be no data at al as I didnt have the solar panels yet. I also recently updated chronograf, influxdb and grafana and besides that I cleaned up a bit in the db and reimported all the data.
Now over to the issue. My goal is to show the power generated every month. So I need to make a sum of the last field of the file that contains the month data. To get there I used several steps. First show what data is present:
SELECT “kWh” FROM “file” WHERE “month”=~ /kas.lan*/ FILL(null)
This looks fine to me. Start on 8th and ends on the 21th or 22. To calculate generated power last few months I’ll make a sum of the data and group by month. Time interval is 30 days:
SELECT sum(“kWh”) FROM “file” WHERE “month”=~ /kas.lan*/ GROUP BY time(30d) FILL(null)
Here is already something strange. Epoch time is Friday, October 11, 2019 12:00:00 AM but collection hadnt even started yet. When I group by month I get this:
SELECT sum(“kWh”) FROM “file” WHERE “month”=~ /kas.lan*/ GROUP BY time(30d), “month” FILL(null)
3 or 2 values for one month? When making the sum it seems to be correct though… Grafana does show me the correct graph using this query:
Chronograf does also show me 3 values:
Anyone know why this is happening?