0

I have a Grafana dashboard , version v8.1.6 (4a4083716c),where I display the output voltage, current and power of a solar panel. I am using the watt2kwh node to convert my power reading that is in Watt to Watt-Hour. The interval between successive measurements is 10 seconds. Node-Red, version 2.0.6, is used to populate my database.

In Grafana I would like to show the total accumulated power for the current day from 00:00 to 00:00 of the next day. I am successfully doing this with the query below:

SELECT sum("value") FROM "solar/ina219/energy" WHERE time> '2021-10-10 00:00:00' AND time< '2021-10-11 00:00:00'

But each day I must manually change the dates. Can I automate the changing of the dates using InfluxQL? (or pure SQL) Or would it be easier implementing this in Node-Red and then just fetching the accumulated energy from the database?

Below is a screenshot of the simple panel: enter image description here

Any help will be appreciated! Thank you.

Rohan
  • 21
  • 5

1 Answers1

0

After some research I concluded that the InfluxQL query language cannot do this and I would have to use Flux.

Rohan
  • 21
  • 5