Configure battery

Hi,

I’m a bit unsure how to configure the battery correctly in the energy tracker.
It keeps displaying my battery charging as negative values, as if I’m delivering back. This is for sure not the case. As a workaround i added it simply as a ‘device’ and use a placeholder entity which is always 0 for charging current. But this must be configured better I assume.

What am I doing wrong?

ChargeEnergy is the kwh flowing to the battery (so this doesn’t take any losses in my inverter into account) and DischargeEnergy is the energy flowing out of my battery. They charge and discharge both over AC.

That is correct. Charging a battery is ‘returned energy’ stored for later use, and should be displayed as negative & below the axis.

The basic energy equation balances the generators (provide energy into the system) with the consumers (use and take energy from the system).

Solar + Import + Discharge = Consumption + Export + Charge

Home Assistant energy dashboard solves this for the Consumption, hence

Consumption = Solar + Import - Export + Discharge - Charge

Charging, and exporting, are negative.

The Energy Usage graph shows

  • the consumption as the height of the bar above the axis
  • the individual contributions to the (house) consumed energy separately as import / discharge / solar
  • the energy generated (solar / battery discharge) that is not consumed as the height of the bar below the axis [the “returned energy”]

note that the bar below the axis will show return to grid as well as return to battery (charging) individually, but they are both ‘returned’.

note also that, when solar is being generated, the amount of solar is the height of both any consumed solar (yellow above the axis) and the solar returned (grid/battery) as the bar below the axis

Your graph is entirely correct, and shows how much energy the home consumed, how much solar you generated, and when you exported excess solar to the grid, when you charged the battery from excess solar, and when you discharged the battery (mostly to the grid).

If it helps, consider the battery part of the grid, but as a bank account where you deposit and withdraw energy that belongs to you. It is still outside the ‘home’ and therefore not ‘consumed’ but returned (to the grid / bank).

1 Like

Thanks for the explanation!

However, it still make not really sense for me. It would make way more sense for me to show the battery charge as consumption, as it practically is. It’s in the end a device which consumes power and takes it. Because now it’s also impossible to see how much kwh came from the net

The delivering back is showed, in my opinion, correctly. Just like the solar, when there is more return then the house consumes it becomes negative. This is super clear and quickly visible in a blink of an eye.


In this graph, it looks like my house is consuming power and delivering back at the same time. But in reality, it’s consuming way more from the net then the blue bar is actually showing.
It seems true that the consumption of my battery is substracted from the net consumption and solar, so the bar on top won’t show anything.

But for me it was always simple: top (positive) is what the user consumes, in whatever way. Negative is what is over produced and delivered back. Currently, won’t even show up as ‘used solar power’ anymore.

Maybe I’m completely wrong, but it’s super confusing for me. I guess I have to keep using this workaround using an entity which always is 0kWh for the charge, and display the battery charge as a device like this:

And the main graph look like this:

It is a matter of personal choice, but no, the battery should be outside of the ‘home’ and should act as a temporary storage of “grid export /.time-shift import” energy.

When you charge a battery, you are not really consuming the energy since it can be returned later. When you discharge a battery, the energy can go to the ‘home’ to be consumed, or it can go as export to the grid. Adding ‘charge’ to the ‘home consumption’ corrupts the real consumption figures and creates an issue in accounting for the discharge later.

Given the number of posts around the Energy Dashboard, and the Energy Usage graph in particular, I agree that it often must appear confusing, but I believe it to be a well thought out and better option than the alternative with battery charge as part of the home consumption.

This is my Energy Usage graph for today (so far…)

I can see exactly how much energy the home consumed, and I can see that in the early hours this came from grid import, during the day most of it came from solar, with some top-up from battery discharge.

I can see that my battery was charged with excess solar in the morning, and that later when my hot tub started running at 11:00, the solar met most of the home consumption, with excess still going to battery and any unmet consumption coming back from battery discharge.

I can see that I am now running entirely on battery discharge.

I can see that all excess solar went to battery, with nothing going as grid export.

I can see my solar generation [yes, I agree that to see this requires standing back and squinting at the graph, but the solar PV generation is the yellow and the red combined]

Since you posted and asked, I like it as it is and I think it is entirely correct, and I think you should put your setting back as you had them. However, we can always agree to disagree, and you are, of course, entirely welcome to do things as you think best!

Best wishes!

Obviously opinions differs and I thank you a lot for your explanation!
Now I know nothing is wrong, but it is by design. And I understand the fundamentals of the calculation;

I do get it a bit now:

I expect the energy page to represent the ‘grid’ load, where negative is back to the grid and positive is consumed energy from either the battery, solar or grid. The grid is central.

However, the way it is designed is more like a home graph, where the battery is just as central as the grid. I think it would look way better when you are consuming all the battery energy yourself. However, in my case, I’m trading the energy. That’s why it looks very weird with two times a delivery back to the grid on one day.

I guess in the end it’s all preferences, and most users are most likely using the battery for self consumption. It would be nice if the behavior could be configurable.