Hello, I am new to this topic but have a question.
I use InfluxDB2.6.1 and Grafana 9.4.3. I feed the database with electricity data from my house and my solar system.
My smart meter measures data and so does my solar system.
The whole thing should be visualised in grafana.
I am familiar with simple queries, but when it comes to calculation, I am out. I have tried a lot using chat GPT, but it didn’t work the way I wanted or at all. Many tutorials on the internet are all with InfluxDB 1.8 but that doesn’t help me as InfluxDB 2.0 queries differently.
I want to calculate the amount of electricity that is directly consumed by my house when the solar system is providing electricity and the amount that is fed into the grid from surplus.
The daily yield of the solar system is measured at the inverter and recalculated daily. So in the evening I can see how much the solar system has generated today.
My smart electricity meter counts the amount of electricity consumed from the grid and the amount I feed into the grid.
Both are absolute values that are counted up.
To calculate the direct consumption of the inverter, I have to calculate as follows:
Direct consumption = Today’s production solar - (current feed-in number - feed-in number the day before at 23:59).
A query of today’s production is simple, it is straightforward.
A query of the current count is also simple.
A query for the value that was at 23:59 the previous day is not so simple. Every time I tried using Chat GPT, I got errors because you can’t subtract or add time intervals. Or a value came out that was not correct.
So my question is, what is the best way to carry out such a calculation?
I have also experimented with expressions but have not understood exactly how to use them in the query.
Can anyone help me?
Thanks a lot