# Power consumed per day

I have some esphomatized power plugs around and added them. Works

2 Likes

Would it be also possible to calculate the exact costs in Grafana? What I want to do is to make an alert when my costs are over my monthley payments. For example, I pay 140 euro each month to my energy supplier. After 25 days in the current month I Used eneregy for 141 euro, then I want an alert, So I need ot be carefull, If I won;t pay more.

EDIT: I think I created the cost stats in grafana with the following query:

SELECT (last(âvalueâ) - first(âvalueâ)) * 0.76963 + 0.67639 FROM âm3â WHERE (âentity_idâ = âgas_consumptionâ) AND \$timeFilter GROUP BY time(1d)

0.76963 = the cost per m3 gas
0.67639 = the cost I pay every day to the supplier for gas

For electricity:

SELECT (last(âvalueâ) - first(âvalueâ)) * 0.22376 + 0.82292 FROM âkWhâ WHERE (âentity_idâ = âpower_consumption_lowâ) AND \$timeFilter GROUP BY time(1d)

SELECT (last(âvalueâ) - first(âvalueâ)) * 0.23899 FROM âkWhâ WHERE (âentity_idâ = âpower_consumption_normalâ) AND \$timeFilter GROUP BY time(1d)

1 Like

Apologies for resurrecting this old thread. I had a close look at the DSMR section of the utility meter component. You directly feed the watts sensor into the utility meter sensor. Is that correct? I was under the assumption that I should feed the watts sensor -> integral sensor -> utility meter (but that is producing some very strange values sometimesâŚ)

Can you indicate the right approach?

How do you have the integral sensor set up? If you donât have that set up properly, youâll get bad results.

EDIT: In case you respond and I donât see it.

If you are always consuming power (above 0) and it has rolling consumption like a sine wave use the default value (method: trapezoidal).

If your power drops to zero for extremely long periods of time and spike very high (like a square wave), use method: left.

Iâve never found a good use case for method: right.

3 Likes

Thatâs pretty cool! I was using something similar but stopped the conversion to cost, because costs change over time. I.e. this year electricity is more expensive compared to last year (in Holland), so I figured the most âpureâ measurement I want to look at is the amount of energy I use and see if this can help make us more aware of that and find ways to reduce it.

Hi Frank, not sure I completely understand your question, but what I do to get daily power consumption is:

I use packages (for now) to setup the parts of my config, so I have setup the utility meter like this:
utility_meter: !include_dir_merge_named ../utility_meters

and then in the ../utility_meters directory I have created files for the various instances I want to keep track of, for example:

daily_power_used_offpeak:
source: sensor.power_consumption_low
cycle: daily

And this works nicely (I think ), although I have been away from home assistant for a while, just getting back into it again now.

Hope this helps!

Oh, and welcome to the forums @smika! Hope you like it here, itâs an awesome community!

For me this doesnât look like you are using packages, more like âjustâ splitting your configuration. Or is this part in the âpackages:â section of your configuration.yaml?

yeah it is but I did not paste all of it here

packages: !include_dir_named components/packages

And then in that directory is the file utility_meter.yaml mentioned in the previous post. That then includes the components/utility_meters folder where all the sensors are defined in separate files.

I saw something similar in someone elseâs config and it was a lot better then the mess my config was in at the time, so I started moving. I believe it was based on @frenck 's setup he had at some point, but I am not sure entirely.

I see, didnât even know you can do includes inside packages (includeception ). Good to know for the future, until now Iâm comfortable with my packages.

Yeah, I am continuously trying to find ways to structure it so that it keeps making sense to me. But, HA has come a long way with managing setups. I love how new esphome nodes just show up as newly discovered integrations. Awesome!

That must be it! I am having especially problems with my electrical boiler which has got some spikey power consumption (see screenshot) and its power consumption is quite overrated. Will try your suggestion.

You definitely want to use left with that graph. Youâll get the correct results instead of results that are wildly off

Hi @aetjansen,

Great video, thank you!
I am collecting power consumption from the blink led of my power meter. Therefor, what I get is Wh and not W. How to use your dashboard and goes from Wh to W?

Thanks!

Thanks @mgim,

You could edit the graph panels in the dashboard to select the different measurement for your situation, but be aware that W and Wh are two different things.

Watt is an indication of power where Wh (Watt hour) is an indication of energy.

Power is measured in Watt and tells the rate at which energy is used. For example, a 10W led light, uses 10 Joule/second. Wh is a measure of energy consumption, so using the same 10W led light as an example: if you leave that on for an hour, it uses 10Wh of energy.

Think of it this way:
Watt tells you how much energy is consumed (or produced) at any given moment in time.
Watthour tells you how much energy is consumed (or produced) over a period of time (1 hour in this case)

Hope that helpsâŚ

Thank you so much @aetjansen
Indeed, it was quite useful to analyse Watts for instant device consumption.
Is there a way to go from W to Wh in grafana? Maybe derivative or something?

Hi. I discovered just now your nice work on grafana about Energy dashboard. Iâm trying to realize something similar. Could I kindly ask you to share an exported version of the dashboard (json format) in order to see better how you design the graphs? Iâll appreciate if you can do it but no problem if you prefer not. Thank in advance.

Did you ever get a response?

Hi aetjansen. I need to thank you for your answer. But Iâm interesting to the only electricity dashboard as @orange-assistant realized. If you have material like that it will be appreciated. Thank you again. Bye

This is where you do it

Change the relative time ie: 1h is past hour, now/d is âToday so farâ

1 Like