Energy: Cost for the individual devices

Is there something missing that we need to setup?

When i import your code i see the message

Error: No energy data received. Make sure to add a type: energy-date-selection card to this screen.

The code only contains 1 card (sankey) add an additional custom card with type: energy-date-selection

Oh boy this needs a +1 from me as well. Would love to see this!

+1 from me too.

For all the +1 people, please “vote” on the top of this page by means of the vote button. Do you guys have other ideas to get this to the attention of the devs?or isthe forum the only way?

This feature has the third most votes already, so I’m quite sure devs have this on their radar but please continue to vote it up!

I was also quite “blue-eyed” on how an implementation could be done, however, it’s not that simple.

Quick check, what would the cost be for a device when (if) you produce your energy yourself (Solar panels)? How do you then calculate the cost for your light vs your boiler?
Then there’s a clear complexity brought in from the fact that many countries/regions have different pricing originating from the grid companies and it’s quite complex to bring in all this at the same time.

My personal opinion is still that an MVP would suffice as a starting point.
Pricing from template entity and consumption like the “mains” would enable budgeting “on-times” e.g. “spend $10 on heating the boiler today” no matter if I produced the energy consumed or not.

This topic was also brought up during the “What the Heck” month.
Please see the thread here where the complexity on this task is described: WTH!? - Why can't we see electricity cost for individual entities in Energy dashboard? - #19 by Boba_ferret

I think the complexity is overrated. (as long as the communication is clear about what it does, and expectations are clear).What we have seen here in this group, and some other areas, is that people would like to have a cost estimation per device to get an “high level view” what a individual device actually costs. As an example, the game pc’s of my kids are "on"all the time, even when they jump under a shower or watch videos on bed. It made them realize, that if they put their PC in standbye modus it actually is not using any power and thus saves money. having this insight in individual costs creates a humongous amount of awareness. setting the individual devices part in the energy dashboard up exactly as the gas portion in the dashboard, creates already this insight.

wrt to pricing I use DSMR reader created sensors for actual price (We have 2 tarifs, low and high at different times). DSMR spits out current tarif…

I have solved the cost of consumption for solar/ battery/ grid mixed sources of power. See my comments above.

In summary I created a consumption cost entity ($/ kWh) which reflects the instant cost of the blended sources of power.

Assigning this entity to each relevant device through the ‘gas’ consumption dashboard ends up with the true cost for each device over the day/ week/ month/ year. All the smarts are in the consumption dashboard already.

You can see below, I don’t assign a common cost per device, the cost depends on when the device is run. My pool cost is negative as I run the pumps when the export price is negative, so I’m saving money by self consuming solar which I would otherwise have to export with a negative price.

2 Likes

Hello everyone!

I have tried to apply the workaround of adding the individual devices to Gas but unfortunately only my Wallbox integration appears, the entities created with RIEMANN SUM Helper are not there. Is there something missing?

state_class: total
source: sensor.fridge_current_consumption
unit_of_measurement: kWh
icon: mdi:chart-histogram
friendly_name: Fridge Consumption Total

I have a stupid question but adding individual devices as “Return to the grid” will work?
It will remove the amount consumed by those devices that are already included on the main source.

I think you miss:

      unique_id: just_think_of_one
      device_class: gas

Then it will work.
Your second question is not that stupid. I tried that as well. However your actual costs will be a bit messed up. I ended up using the Sankey chart to make things more visible aside.

It is a shame DEVS have not picked this up yet since this group is really populair.

1 Like

Hi Mark, I am 2 weeks into homeassistant and really enjoying it. I am trying to replace what you have done here. How are you getting this view?

The view I have is as per the attached.

Thanks in advance.

That view looks like you have the devices setup correctly which is usually the hardest part, well done.

Is this your own custom view, or the default energy dashboard?

Do you have measurements for total house consumption from the grid and have you included those values on the energy dashboard?

Can you show your energy dashboard configuration page?

Hi Mark, thanks for responding so promptly.

I am using the default energy dashboard.

I use Amber Electricity which has a variable rate for power based on current wholesale market spot pricing. The API to HomeAssistant only provides the following inputs:

  • General Forecast (Predicted kWh price per hour)
  • General Price (Current kWh price per hour)
  • General Price Descriptor (String detailing current price “normal, low, etc”)
  • Price Spike (off/on - flags when price is spiking across the network and spot price is increasing or expected to increase)
  • Renewables (percentage of renewable power currently in the grid)

Unfortunately the integration doesn’t provide the daily usage / cost into HomeAssistant, even though it is in the API from Amber. So I can’t add the grid consumption to the energy config page. (see attached screenshot)

I have also played around with using a custom sensor to create a dashboard calculating the cost per hour/day for an appliance (in this case my Synology), however I am not sure if I am heading in the right direction. (Ignore the formatting in the 2nd screenshot - I am just playing with the function not the form). I really like your view where at a glance you can see what is using power for the day.

Thanks again for taking the time to take a look.

1 Like

I’m with Amber as well so we should be able to get this working.

You should probably add the cost of energy to each of the devices under the ‘Gas Consumption’ board like this:

Using the Amber General Price is a good starting point for each appliance, if you have solar or battery there are other prices you can calculate, but this is a good start.

You may also need to include a sensor which measures your grid consumption energy (kWh) and maybe your Solar if you have that as well.

Let me know how you get on.

Hi Mark, I tested putting one of the devices that appears in the list of options for “Grid Consumption”. (See attached). This immediately then gave me the same view as yours (see attached).

So it looks like the energy dashboard requires a “total consumption” to display the sources view with the costs.

So I now need to get the daily consumption into HomeAssistant. I don’t have physical access to my smart meter as I am in an apartment. So I just need to work out how I get the total consumption into HomeAssistant.

Thanks for your help with this.

Is there any way to know if any work is beeing done regarding this feature request, or even if it is planned for any future release?

2 Likes

I guess you can ask around in the dev discord for energy, but I haven’t seen any movement there. It is a shame, but I guess all focus is on “voice” currently. Would be great to see some updates on this part indeed as well.

2 Likes

I second the shame on development having moved to voice, leaving a half-done big feature on the floor. This energy dashboard needs some extra love, specially given this is one of the most voted features of the forum!

And it seems the gas workaround doesn’t work anymore for many moons - last hacktoberfest people fixed the ability to add energy devices to the gas list lol

1 Like

Using ‘gas’ consumption workaround dashboard does work, you just cannot mix energy and volume on the same dashboard.

Yes, it would be nice to get this development included in main.

1 Like

I have been trying to use this Gas for temporary solution to calculate Wall Charger costs.

I am using Nordpool to get data for energy prices.
This works fine because I use this same to calculate my monthly energy costs.

# Nordpool
sensor:
  - platform: nordpool
    region: "FI"
    price_in_cents: true
    precision: 2
    VAT: False
    additional_costs: "{{(current_price * 0.24) + 0.0040}}"

Then I convert this to EUR/kWh

# Nordpool EUR/kWh
template:
  - sensor:
      - name: "Nordpool EUR/kWh"
        unique_id: "sensor.nordpool_eur_kwh"
        unit_of_measurement: "€/kWh"
        state: "{{ (states('sensor.nordpool_kwh_fi_eur_2_10_0') | float(0) / 100) | round(4) }}"

Then I made utility meter for daily energy.

# Wall Connector Utility Meter
utility_meter:
  wall_charger_daily:
    unique_id: "sensor.wall_charger_daily_energy"
    source: sensor.tesla_wall_connector_energy
    cycle: daily

Everything these are working fine.

Then I go to Energy Dashboard and add this Utility meter to gas. I can see there correct values.

And on Energy I can see used energy but this is not some reason calculating costs.

I tested to use static price 0.0025 but this calculated costs very wrong. So I am not sure what I am doing wrong.

Any tips?