Energy Management in Home Assistant

Just noticed the values for the 4th of December, that seem to corroborate my initial impression that the energy distribution card values are assuming the battery was charged from solar:

For this day alone (this month so far) there is a 2 kWh self-use showing up, and if we do the math, we see why for this day alone there is self-consumption:

Solar = 34,7
Exported (grid feed-in) = 13,4
Battery charge = 19,3
Self-Consumption = 34,7 - 13,4 - 19,3 = 2 (this is wrong)

In order for the card to show self-consumption we have to generate more solar energy than the sum of export and battery charge, even though the battery was charged at night at an hour there was no solar production at all, and that is easy to check on the solar production attribute.

The truth however is shown by the self-consumed solar energy below, which correctly states there was 61% solar self-consumed, i.e. 34,7 x 0,61 = 21 kWh:

As it stands both cards contradict each other. The Energy Distribution is being incorrectly calculated.

I have reported this issue in GitHub:

You will see from my examples that when battery exports exceed household consumption.

Please feel free to add your examples to the issue and hopefully we can get someone assigned to look at resolution.

This issue also appears to be relevant;

1 Like

Hi @markpurcell , thanks for the feedback.

I had already opened an issue given the lack of response here, so now have yet another one.

It’s obvious now that the battery part is not working properly, and wrong assumptions are being made in the aggregation calculation for week/month/year.

I’m sadden to see these issues go back to 2021 and still have no one working on them :worried:

I’ll try to assist getting someone to look at this by posting on those still opened.

1 Like

Hi, are you also able to check if you put energy to the grid or consume? so left to right and right to left?

Is it possible to have two different energy dashboard that monitor different meters and PV plants and keeping statistics separate? It is necessary to install another instance of HA, or is there another way?

At present it’s not possible.

There are several features requests like this one:

You can vote there if you want.

3 Likes

Of course you can, at the very least take a look at the dashboard config screen and it’s there obvious to see.

Go to settings > dashboards > energy

I understand this is no what you want/need, the granularity is not the same, but you can create “virtual” sensors that you use to add all systems individual values via template.yaml, and then use this virtual sensors to feed the energy dashboard.

Some of my sensors in my dashboard are fed this way, since I have some multiple instances of the same device, like for example multiple batteries.

Again, I know this is not what you’re asking for, but at least might be a workaround for some basic funcionality while your request is not implemented.

I think @demetrius is asking for two different energy dashboards. Not more sensors in the unique energy dashboard.

You of course can create a new energy dashboard, but you have to create all the utility_meters, graphs, and so on.

Yes, I was referring to different energy dashboard, each one with different meters.
Creating something similar manually does not give the same features and statistics.

Question:
I would like to play around with dynamic electricity prices. Awattar offers a free API that could provide the data, but I have no clue how to call that data in HA and create an entity that I can work with…

Ok, I can sort of answer my own question here…

With a lot of Copy and Paste work I managed to get the Awattar thingy working. I had to do it in NodeRED though which I had never used before…still have no clue how it works, but found some working setups I could copy.

Two questions though…the value I get from Awattar is not tied to a location as far as I can tell, so I am not sure the price I get is the correct one for my part of Germany. I can’t find any way to specify a location via the Awattar API unfortunately. If anyone knows, please helpt me out.

The second one is how to calculate the actual price. Awattar API give me the barebones price. That means I have to add VAT and other fees. I used the values I got from Tibber for this, so I add 19% VAT and 13ct/kWh on top of the price to get the (hopefully) accurate final price.

My Template to get the total price is as follows:

- name: "Epex_Brutto"
        unit_of_measurement: "Cent"
        device_class: "monetary"
        state_class: "measurement"
        state: >- 
          {{states("sensor.epex_spot_price")|float(0)+13 + states("sensor.epex_spot_price")|float(0) *0.19 |float(0)}}

I hope this isn’t complete nonsense…I have little experience with writing code in HA, am bad at Math in general and am working with some assumptions… :wink:

Really keen for some insights into how I might be able to get this integration working with my current situation.

I am calling through to my electricity supplier’s API which gives a delayed (as in, the most up-to-date information is 2 days prior) feed of the kWh used in half-hour increments. I can also get it daily or weekly I think.

I’ve had to use Node-RED to get this and will be running it daily to get the previous previous day’s data. I have options with what I do with the data once I have it. I figured the best thing was to pump it into InfluxDB, but toyed with maybe MQTT as well.

The issue, I guess, is the delay. How do I put this information into a sensor so that the HASS integration shows it correctly? I read a couple of posts about just putting in the overall grand total out of InfluxDB, but won’t that get confused given my feed is a couple of days delayed?

Should I just publish the daily data to MQTT and leave it to HASS to sort things out? But, if so, how do I deal with the delay?

Any help is greatly appreciated.

Is anyone experiencing random spikes?
I had 2 devices today which shot up, using way more than they are even capable of.
Apparently, my home network switch consumed 73kWh of electricity today!?
How should I deal with this as it’s throwing off my energy calculations.

This is probably caused by the meter returning a value of 0, followed by the previously “normal” value of the counter (73 kWh in your case).

You can try to fix the invalid measurement by finding the time it happened, and then use the developer tools → statistics tab. Find the entity with the problem and click on the “Adjust sum” icon. Then find the correct date and time when the spike happened, the 5 minute sum value should normally only be a relatively small increment, so you’re looking for a value that is abnormally high.

1 Like

@Jonah1970 Your energy dashboard is awesome! You dangle that carrot of possibility, but would be great if your sensor/dashboard config was available for reference. Do you have it published anywhere? GitHub perhaps? Thanks for sharing!

1 Like

Hello, is possible integrate to energy panel Solar panels for heat a watter? I have a esphome for Resol Deltasol, reading kWh from controller, but I not want mix it with electric energy from my PV panels. This is heating category.
Thanks

I have a Sense energy monitor for my primary residence, which works wonderfully for me. But there are situations where Sense isn’t a feasible choice for realtime energy monitoring. For example, we have an apartment building in a beach town, where we have 4 townhouse-like units, one of which we keep for mostly our family usage. The building has 5 separate electric meters (one for each unit, plus a house meter that feeds laundry room, the shared utilities room, and EV charger). The building also has 8 electrical panels, so Sense or some other panel-centric monitoring would be painful to buy, install and manage. I did take a look at more commercial offerings but they are far more expensive and not really suited for the scale of this building.

I’m in the middle of assembling a reasonable real-time monitoring solution using devices that provides useful monitoring using ZigBee connections to my smart meters, then doing the rollup using Home Assistant. I hit my first milestone today - I now have two RainForest Automation Eagles paired with two of my 5 meters and running and combining in Home Assistant.

I still miss Sense features:

  • No realtime-solar option like Sense - I could use Home Assistant to aggregate in solar on an hourly basis but definitely not the same as the combined realtime Power Meter in Sense.
  • Realtime in the Rainforest Automation Vue app is 5-10 second updates, not every 1/2 second like Sense
  • No device detection

Here’s the newest addition, an new Eagle 3 that measures the House Meter - here it “watched” the end of my EV charging. Note that it hasn’t enough run time to update the Always On.

And here the Eagle 200 that used to live in my main residence, but got relegated here once Sense proved so much better. This caught the tail end of our dryer running.

Here’s a view of the current rig. It will be prettied up once I have 3 more Eagle 3’s and a UniFi switch. I had to locate the hardware on top of cabinets in the garage closest to the electric meters. I was fortunate that I had an Ethernet drop and electric outlet nearby, because WiFi coverage is a little iffy. Had investigated powering using PoE but that would have raised my power budget beyond my current main switch.

I have a few Home Assistant wishlist items out of this !

  • Home Assistant Eagle integration should pull out Always On scalar data
  • Home Assistant Energy should either compute or aggregate Always Ons

Thanks @Kars
According to the sensor, nothing happened?

Yet it’s telling me that device consumed over 1 Billion kWh of energy today!?