Integrating total house load into energy dashboard

Hi all,

I’m an absolute beginner to Home Assistant and would like to get the amount of money saved due to the solar energy I produced. I wasn’t able to find what I was looking for, but maybe I’m just too inexperienced to look at the right places…

To integrate my inverter and battery I’m using the Modbus configuration from here:

This creates the entities to fill the energy dashboard. The sources look like this:

What I’m missing is something like ‘total house load’ in the overview, which also calculates the notional total costs/income for the day (so far). If adding that to the sources is somehow restricted or difficult to do as a first thing, adding a card showing that would be sufficient as well.

Can anyone give me a hint on how to get started to integrate that thing?

I’m confused. That’s what the sources panel (your picture) is doing…

It has a sum total of all the energy used for the time period specified by the current selecton on the energy dashboard. And you have apparently specified your rates because some costs are being cacvulated…

So what’s wrong? Whats missing?

Hey,

thanks for your reply! What it’s showing the the consumption from the grid and what has been fed from the grid. What I want additionally is the “total house load” multiplied with costs per kWh to see what I’d have paid my grid operator if I wouldn’t have used solar energy.

An example with fictional numbers: I had a load of 10 kW and produced 15 kW solar energy. 90% of the load was covered by the solar energy, 10% came from the grid. So, notional costs would be 10 kW times €0.4 = €4. Actual costs are 10 times 0.1 times €0.4 = €0.4. Notional earnings would be notional costs plus energy fed to grid times fed-in compensation, e.g. €4 plus 5 kW times €0.081.

I’m not understanding ‘total house load’. Do you mean current Power draw?

Are you talking power or energy?

Power (W/kw) is what is being used right now (now. Much is my draw) and cost is out of scope because cost only comes into play when you measure an amount of power used over tims which is

Energy. (Wh/kWh) what this dashboard displays.

Power is out of scope for the energy dashboard. (if you disagree the send the HA Devs a feature request)

If you want current power displayed then create a new dash and put a card on it with a sensor representing the sum total draw of all your W /kW sensors on a Guage.

I added an example above to be clear what I’d like to see. Hope that clears it up. :slight_smile:

An example with fictional numbers: I had a load of 10 kW and produced 15 kW solar energy. 90% of the load was covered by the solar energy, 10% came from the grid. So, notional costs would be 10 kW times €0.4 = €4. Actual costs are 10 times 0.1 times €0.4 = €0.4. Notional earnings would be notional costs plus energy fed to grid times fed-in compensation, e.g. €4 plus 5 kW times €0.081.

1 Like

You’re looking for power and cost doesn’t apply read the last response. There is no such thing as cost against kW only kWh

Okay, so my units in the brief example are wrong and power shouldn’t be part of the energy dashboard. Got that. Then, let’s rephrase it.

Like in the sources table, I want to have the sum of the energy “consumed” by my house on that day (which should be equal to total energy from pv plus total energy discharge battery minus total energy charge battery minus total energy feed to grid minus total energy consumption from grid). The costs should be a multiplication of that value in kWh times whatever fixed price per kWh of my grid operator is.

Can that be done directly somehow or does that need a feature request? If it cannot be done without a feature request, can I create a card on this or another dashboard doing these two simple mathematical operations? If so, where do I find out how to do it?

You can create a template sensor with those calculations

And that would be another template sensor, or a utility meter

2 Likes

We need to know what sensors you have available

How you currently have them setup in the energy dashboard.

Basically you can make the energy dash say basically what you want by manipulating what sensors you feed it (what Francis is saying)

Show us what you have available and we can make suggestions on how to get there.

Quick Google search points me here:

and here:

So, I would create two sensors using YAML. The first with just the sum of the energy and for the costs I use that sensor and multiply it by a fixed value. The latter can then be added into such utility meter with a fixed cycle to reset?

Syntax should be similar to this?

- sensor:
	# Total consumption
	- name: total energy consumed
	  unit_of_measurement: "kWh"
	  state: "{{ states('energy from pv') | float + states('energy from grid') | float + states('energy from battery') | float - states('energy to grid') | float - states('energy to battery') }}

Add device_class and state_class

- sensor:
	# Total consumption
	- name: total energy consumed
	  unit_of_measurement: "kWh"
	  state: "{{ states('energy from pv') | float(0) + states('energy from grid') | float(0) + states('energy from battery') | float(0) - states('energy to grid') | float(0) - states('energy to battery')  | float(0) }}
      device_class: energy
      state_class: total_increasing  
2 Likes

Great thanks and thanks for the addition. Was a bit sloppy again…

But I wouldn’t be able to add these sensors to the energy dashboard, because it is somewhat a special dashboard to my understanding? I probably could add it as an individual device to circumvent that or simply add the sensor / utility meter to my overview?

The first sensor can be added to the energy dashboard, the cost sensor not.

2 Likes

as long as the sensor is of the correct units and of device_class: energy - you can add it.

1 Like