WTH!? - Why can't we see electricity cost for individual entities in Energy dashboard?

Yes! This the most crucial theme we are facing.

Batteries being the future, and as you said Use own energy first as a rule of thumb, this would be the main strategy to elaborate on imho.
We will never be able to calculate the price exactly for all pricing policies spread over the world.
We will however be able to create these more generic strategies on when to power over the grid, and when to power from your own batteries.

I’d hope you could share your thoughts on that, maybe even in a pinned and dedicated topic. What were you able to do already.

We should focus on the required Paradigm Shift instead of trying to be exact in calculating the kWh price for that single light.

Ha wouldn’t be HA, if we wouldn’t try and list the devices that already enable us to make that shift. Even on a smaller scale. List battery powered devices that actually work and integrate them in HA.

Example: I have a Hue Go, which is a battery powered, yet integrated Hue light. Ambient, so it won’t light a room on its own. Looking for other LED battery powered lights, I failed to find a single one…That can’t be true.

We dont immediately need that Greenrock Home battery to be able to act now. Stop thinking in peak and low tariffs, start the shift to Own Production First.

For our Dutch readers see this vid on E O E (Eigen Opbrengst Eerst = Own Production First )

This is already going too far from the original WTH. What I’d like to say is that let every user to decide how complex they’d like to go with price calculation and keep support for simple constant tariff but also complex template based price sensors like it is right now. We already have all this for grid sensors but miss for individual devices.

“Own production first” sounds great but in energy is too egoistic IMHO for on-grid setup and in reality is not always the best strategy neither for the consumer nor the overall network.

For example, when night price is low but daytime is high due shortage in the grid, it is better if you sell all your solar excess power instead charging batteries and switching yourself off the grid during the night.

There are a lot of details in it of course. There are startups who try to solve such problems and more will come most probably. One user can’t affect the big picture a much but many already might. Still, one user maybe could save its own bill.

2 Likes

Here is my method which I think could cover a large portion of the HA use cases and could be coded into the energy dashboard.

For grid consumption the cost is based off my import price:

Screenshot 2022-10-07 13.52.46

My energy price changes every minute, so i multiply the energy price by the the current power being drawn from the grid, so based on my current cost, the nominal 1000W load costs $0.17 to run for 1 hour, which can be calculated using the Rienmann Sum integral.

Making things a little more complex if I am running off battery or solar. I attribute the cost to the value I could have achieved if I exported my solar or battery at that point in time.

Screenshot 2022-10-07 13.52.53

I have sensors that report the power being delivered to the house by solar or battery and multiply that by my current feed in price. So in this case the nominal 1000W load costs $0.08 to run for one hour, which again can be calculated by Rienmann Sum integration.

Now into the more complex case, what happens when I am running off solar, battery and grid at the same time.

Screenshot 2022-10-07 13.52.40

I just combine the entites above.

In total the house is consuming 12,073W (which is 1,736W from grid, 5010W from battery and 5343 W from solar), which is costing me $0.3/hr for grid and $0.83/hr for battery+solar for a total of $1.13/ hr. Divide by the house consumption of 12,073W gives me a house consumption cost of $0.09/ kWh. So the nominal 1000W load will cost $0.09 to run for one hour, but can be more accurately calculated using Rienmann Sum.

Sensor definitions below:

    - name: house_consumption_grid_cost_rate
      unit_of_measurement: $/hr
      state: "{{(states('sensor.amber_general_price')|float(0) * 
                 states('sensor.apf_grid2house')|float(0) /1000)|round(2)}}"
    - name: house_consumption_feed_in_cost_rate
      unit_of_measurement: $/hr
      state: "{{(states('sensor.amber_feed_in_price')|float(0) * 
                (states('sensor.apf_batt2house')|float(0) 
               + states('sensor.apf_solar2house')|float(0)) /1000)|round(2)}}"
    - name: house_consumption_cost_rate
      unit_of_measurement: $/hr
      state: "{{(states('sensor.house_consumption_grid_cost_rate')|float(0) + 
                 states('sensor.house_consumption_feed_in_cost_rate')|float(0))|round(2)}}"
    - name: house_consumption_cost
      unit_of_measurement: $/kWh
      state: "{{(states('sensor.house_consumption_cost_rate')|float(0) / 
                 states('sensor.apf_house_entity')|float(0)*1000)|round(2)}}"
3 Likes

I would say keep it simple stupid. A valid use case scenario would be “what does device X cost me on a yearly basis” (IE: The washing machine or tumble dryer). Asking that question doesn’t need to include Solar Power. I only want to know what the usage is and calculate that with a price of kw/h.

I see your point, and I think this is a case of the great vs the good. But aren’t you conflating two (or more) different questions:

  1. What is the usage of this device “costing” (in terms people can more easily relate to: cost vs. kWh)?
  2. What portion of my actual out-of-pocket energy costs are attributable to this device?

If I want to evaluate a device’s consumption, for example to determine how often to use it, or whether to upgrade to a more efficient unit, I want to know its consumption. While kWh is what might be most appropriate, many people can’t related to that as easily as they could if doing the unit conversion to cost of those kWh – my device is using the equivalent of $X/day, if I can cut that by 25%, a new unit will pay for itself in 2 years.

Same question, WTH can’t I see the value of the energy my solar system is producing instead of just kWh?

And WTH if I don’t have real time energy consumption monitoring can I see any costs/kWh from the energy dashboard?

Also, it is a bit false to think of the energy from solar as “free”. While you might not be paying the utility for that energy, the value of the energy it is producing is contributing to the ROI on the system to pay it off. If I’m not using the energy, because of net metering, it is getting banked by the utility company to defer the cost of my future energy consumption.

Thanks to this hack from @lundmilo, you can enter each of your appliances energy sensors on the gas consumption section of the energy dashboard. If you delete the phase ‘gas consumption’ and call it ‘appliance consumption’ in your mind it works.

Using my solar, battery, grid average cost sensor (above) accurately tracks to cost of each appliance depending on which energy source was used at which time. :slight_smile: Fridge and Dishwasher both consumed the same amount of energy (1.6 kWh), but the fridge runs overnight ($0.26) and the dishwasher was run during solar production ($0.17).

5 Likes

I’m really liking the insights configuring appliances on (gas) consumption source is providing.

I see consumption of individual appliances on an hourly basis:

2 Likes

yes, really cool I like it as well!!


And to be honest, more and more people are using it like this in my surroundings. Hopefully it would be picked up by the devs, to add a seperate section for this instead of “misusing” the Gas part.

Best tip I got this year!

5 Likes

I absolutely love this. It looks great. Biggest problem for me is that I’m using the gas as intended.

2 Likes

Just create a seperate overview with longterm statistics card and energy card…Energy Cards - Home Assistant

is this a hack, as in hacking the frontend code, or merely a hack, as entering electric devices in the gas section…?

If the latter, how does this not mess-up the true gas statistics/graphs/cost calculation? I dont want my 0 for gas to be replaced by any other electric device :wink:

Love this!


Hopefully this will be part of the Energy Dashboard (at the right place) one day, the only thing which is really missing (from my perspective).

3 Likes

This is a heck because people would like to see this level of detail for their appliances, possibly by updating or as an option on the existing energy dashboard monitor individual devices card. This is a heck because the data is already available in HA, it is isn’t visualised by default.

This is a hack, using the (gas) consumption card, as it is using the existing front-end as a temporary workaround by (mis) configuring some sensors (no coding changes required) to achieve the desired outcome but with some downsides. If you are tracking gas it mucks up the results, if you aren’t tracking gas the hack shows appliance electrical consumption as gas consumption which can be confusing and the daily $/€ totals are duplicated.

2 Likes

Yeah thx, I got it meanwhile :wink:

Seems to be a very useful (and dearly missing) feature.

If dashboard can calculate the totals, it should be just as possible to do so for individuals…

1 Like

+1 Exactly my thoughts. We need the possibility to use all data present in our Home Assistant in the way we need it.

As using resources electricity / gas / water / oil / or whatever, has become an (huge) issue in so many peoples life for some time now in Europe / The Netherlands. Monitoring my smart meter with P1 module made me realize what I was missing out for many years. In Dutch we say “meten=weten!” Never to old to learn and to adjust your bad (and sometimes costly) habits accordingly.

1 Like

True! and having the insight what actual usage might cost, even for people without solar solutions, provides insights and awareness on usage. I love the fact that the Energy dashboard now shows water. I am (mis)using this individual power devices in the GAS section of the dashboard, but it would be great if it actually was a separate section for these individual devices. Insights in what things (usage) might cost is what matters most in bringing awareness. Hopefully @frenck or @Bram_Kragten can play a role in this. It is very insightful and useful.

1 Like

The gas hack does exactly what I want (not just costs, but hourly charts too). But yes, I am also stuck because I use the gas chart for its intended purpose too. We just need a third fuel type added to the energy dashboard. Or better yet change out the the “individual devices” section so it works just like the “energy usage” section.

Who coded the energy dashboard? I’d happily submit a pull request for this (or just make a fork) but I haven’t figured out where the code is yet.

2 Likes

2022.11 will introduce water
And the Energy integration is here I guess

1 Like

do you know if this still works in the 11 release? I cannot seem to add any new ones.

Same trouble here with 2022.11, looks like the dialogue for adding gas consumption is missing some elements.

I also got a random error message in my logs about Wh not being a valid volume measurement.