# Power consumed per day

Hi Aetjansen,

I was wondering if you can share the code of “Gasverbruik afgelopen week” I can’t get the temperature and cubic meter separated in the same panel with bars and lines they will stack up together .

Hi All, I just noticed there is still live in this thread. I have not looked at my setup for several months, other life aspects took priority. I hope to dig in soon and get an answer on the questions here…

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?