I’m currently trying to display my energy consumption in days on the Grafana dashboard.
I have a sensor that measures my total consumption in kWh. This data comes from Node-red via MQTT.
When I create a Time Series on the dashboard and set the query to 1 day using “distance” and “difference,” I get completely incorrect numbers.
For example, today:
I have a balcony solar power system, and it generates a lot of energy. I know this because I have a plug in between that measures and documents it. According to my calculations, I haven’t consumed more than 2 kWh today. However, when I calculate the daily value through Grafana, it shows almost 5 kWh. Why does this happen?
The sensor measuring the electricity is directly connected to the phase and is very reliable.
How can I set this up correctly? It should show from 00:00 to 23:59, and if it lacks data from the current day, that’s okay.
I do not have much experience with InfluxQL nor with the DISTINCT() function that you are using, but my guess is that that is where the problem is happening. Can you explain why you are using the DISTINCT function?
i only was looking for a solution, so i found some threads, where distinct was used.
My problem is, at the moment the Graph use 24h as 1d. If we play with our pcs at night the Day before, the kwh are measured in this time is added on the daily graph. But i need a Graph, who only show me today kwh between 00:00 and 23:59.
A Graph for Today energy use, it show me on 7 o clock after wake up 5 kwh and reduce the kwh over the day unter 3 for example, but in truth we only used 1kwh between 0:00 and 7:00 is not useful.
If you have another Solution for this with 1 Measurement i can test it.
If you wanted to filter out the hours from 00:00 to 06:59, then the only way I know how to do this is using Flux with the hourSelection function. That means you would have to switch from InfluxQL to Flux.
If you are seeing the YTD value of an always-increasing series, then it’s probably because you are viewing the “Last” value instead of the delta (what some call “spread”).
To create the above, use a Bar Chart visualization and use an override to get the month and day (and thus not display the hour, since that is not relevant).
@grant2 i get a data error, if i add a AND after WHERE.
No i only need to make visible the Values. On Bar Chart i can see the Values, but dont stack the 2 queries. On Time Series i can Stack (screenshor above), but not make visible the Values. Can i solve it?