Replies: 2 comments
-
Hey @eb99! Yes, this can be done in Grafana!
Yep! Imported energy is positive, and exported energy is negative. Since you pay a different rate for imported power vs. exported power, you'd want to get the total daily imported power and the total daily exported power first, and then calculate the cost of those individually before adding the two costs together. You'll want to use the I've setup a panel for this that you can import into your Grafana instance. You will probably have to change the data source after you import the panel. daily-cost-imported-and-exported-kwh.txt On your dashboard, add a new Visualization, and then just click apply so the blank panel is added to your dashboard. Now, from your dashboard, find the new blank panel and hit the three dot menu in the top right corner of the panel, and go to Inspect -> Panel JSON. Delete everything that's in there, and then replace it with the contents of the text file above. Hit Apply, and then go back to the same panel's three-dot menu and hit Edit. Between the previous box and the query editor section, you'll see Data Source - just make sure that your InfluxDB instance is selected. Once you do that, you should see a dollar amount appear. In the query editor section, the third row is where you'd set the actual rate per kwh. I used 0.29 and 0.05 as the examples from your query. The one limitation in this approach is that this data is not stored in the database, so if your rate changes in the future and you look at old data, it will use the current rate that you've set. If you change the visualization type to a Time Series or Bar Chart, this will let you look at the daily cost for longer periods of time. |
Beta Was this translation helpful? Give feedback.
-
Thankyou, that is exactly what I was after.
…On Tue, Oct 29, 2024 at 8:21 AM David Albrecht ***@***.***> wrote:
Hey @eb99 <https://github.com/eb99>!
Yes, this can be done in Grafana!
is it as simple as summing the values only if they are positive? or
negative for export.
Yep! Imported energy is positive, and exported energy is negative. Since
you pay a different rate for imported power vs. exported power, you'd want
to get the total daily imported power and the total daily exported power
first, and then calculate the cost of those individually before adding the
two costs together.
You'll want to use the rp_5min Retention Policy
<https://david00.github.io/rpi-power-monitor/docs/v0.3.0/database-info.html#data-retention-and-continuous-queries>
and net_energy_5m measurement for this.
I've setup a panel for this that you can import into your Grafana
instance. You will probably have to change the data source after you import
the panel.
daily-cost-imported-and-exported-kwh.txt
<https://github.com/user-attachments/files/17548890/daily-cost-imported-and-exported-kwh.txt>
On your dashboard, add a new Visualization, and then just click apply so
the blank panel is added to your dashboard. Now, from your dashboard, find
the new blank panel and hit the three dot menu in the top right corner of
the panel, and go to Inspect -> Panel JSON.
Delete everything that's in there, and then replace it with the contents
of the text file above. Hit Apply, and then go back to the same panel's
three-dot menu and hit Edit. Between the previous box and the query editor
section, you'll see Data Source - just make sure that your InfluxDB
instance is selected. Once you do that, you should see a dollar amount
appear.
In the query editor section, the third row is where you'd set the actual
rate per kwh. I used 0.29 and 0.05 as the examples from your query.
image.png (view on web)
<https://github.com/user-attachments/assets/d70db1d9-9547-4127-8cce-d1eef098d860>
The one limitation in this approach is that this data is not stored in the
database, so if your rate changes in the future and you look at old data,
it will use the current rate that you've set.
If you change the visualization type to a Time Series or Bar Chart, this
will let you look at the daily cost for longer periods of time.
—
Reply to this email directly, view it on GitHub
<#145 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH4SGH6ZPBCF4EJ7YLGGYY3Z52TEPAVCNFSM6AAAAABQWIZ7U6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMBYGAYDAMI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am wondering if anyone has solved this yet or not.
In Australia energy is billed at a certain rate (ie 29 c/kWh) plus a daily charge for consumption from the grid, and any energy exported to the grid is credited back to you at a certain rate (ie 5c/kWh).
I am looking for a way to show this so that it can be compared to energy bills, and also to plan future changes for more solar or home battery.
Ideally I would like to calculate cost daily, but will be happy enough if I can just sum the kWh imported and exported as separate values.
is it as simple as summing the values only if they are positive? or negative for export.
how do you achieve this in Grafana?
many thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions