Energy Management in Home Assistant

@system It’s been a while since the Energy dashboard was introduced, and there is not yet as far as I can see a way to include a daily standing charge in the calculation. It’s an amount of money we in the UK have to pay to the supplier for having an active account and does not matter how much you use, but it is charged daily, and is included as part of the bill. So to get an accurate idea of consumption it should be included in the dashboard. This is not currently possible though? Unless I am missing the very obviously, then could someone point me in the right direction? There doesn’t seem to be a method to add a fixed daily fee to the calculation, it’s all based on kWh being used so if the charge was 0.55 per day and I used 1kW the energy dash would tell me I used 0.55 but if I used 2kW it would multiply the charge by two showing 1.10 even though that is incorrect since the charge is daily-based not kWh based, it would always be 0.55 and charged daily no matter if I used 20kW or 0kW. This is something that applies to everyone in the United Kingdom so a huge user base is missing out on the ability to set it.

If i get this right this is a kind of base fee. Here in Germany we habe the same on a monthly base. My base fee is 3.99€ per month and then the amount of kwh used multiplied by the corresponding cost.

Fixed charges plus consumption (per kWh) are pretty common, however retail tariff structures vary so widely across the world it’s almost impossible to add more and more options to cater for all.

e.g. here in Australia many homes are being moved to “demand tariffs”. So not only are there fixed daily fees plus time of use per kWh consumption charges but there will also be a charge for the peak 30-min power draw during the peak tariff window each month.

e.g. say during peak hours (e.g. 3pm-9pm weekdays) for the entire month your maximal 30-min power draw was 10 kW (5 kWh/30-min). That is then multiplied by the demand charge (e.g. 15c/kW/day) and the number of days in the billing month (e.g. 30 days). So in this instance the demand charge for that month would be 10 kW x $0.15/kW/day x 30 days = $45. That would be a separate line item on the bill, plus the regular consumption and daily supply/service charges.

As far as I know the Energy dashboard only provides hourly interval data, and as such isn’t able to calculate a demand tariff. It would require 30-min interval data.

We also have typical time of use charges, however in many locations the time of use periods applied to “peak”, “off-peak” and “shoulder” vary with seasons.

Also there are often separately metered dedicated circuits which the utility controls when power is made available (for things like water heating, slab heating, pool pumps etc), and these are typically outside of the solar PV circuits and often not captured by regular PV/consumption metering. Different tariffs again too.

Then there are variable discounts layered on top depending on payment timing.

Feed-in credits which vary by time of day (e.g. in Western Australia the credit for exported excess solar PV in different before and after 3PM) or vary by total kWh exported, e.g. the credit might be stepped with the first 5 kWh/day credited and one rate while beyond that is credited at a different rate.

And on and on goes the hundreds of combinations of tariff types.

There’s always a new fee type to add.

Edit - I forgot, there are also random bonuses provided by some electricity retailers. e.g. you might get notice that if you reduce demand by a certain amount between 5-7PM then you earn a bonus bill credit. The complexity of billing options never ends.

3 Likes

Hi All,

I think we are missing something here that is quite significant, So the majority of people using HA Energy will be using it because they have a solar system.

Well there is two things I would like to see tracked and that is the cost saving on consumed solar, and then the the total savings.

cost_saving_on_consumed solar + sensor.power_meter_exported_1_compensation = Total savings

This way i can see at what point my system has paid for it’s self.

If there is anyone that can do this or has already done this i would be interested to understand how to do it myself. Thanks

if you go to Developer Tools and then statistics you may be able to do this by finding the relevant sensors and clicking on the adjust sum button on the far right.

This is how I’m calculating savings from my solar and battery systems both individually and collectively.

This is something I’ve attempted to do partially. My v1 approach was to calculate out what my energy consumption would have cost had I not installed PV and then take that savings (ignoring time value of money for now) from what I paid for the system.

What I have done is built a dashboard in Grafana that uses a series of SQL queries (with lots of help from the community) to my MariaDB to extract some of the datapoints and then calculate on them.

  1. How much energy has my house consumed since my PV install - it’s using a Tesla Powerwall sensor to gather this data point.

  2. How much would that energy consumption cost had I not installed PV. Data point from 1 multiplied by the average cost per kWh from my energy company. Note this isn’t calculating in inflation or raising rates yet. Hypothetical energy cost.

  3. How much I have paid my energy company since I installed my PV system. This is a manual input sensor in HA since I haven’t found a way to get this automatically added. Each month I enter my balance due from my energy bill. Actual energy cost.

4.Calculate how much have my “savings” paid back my investment. E.g. ((Total Investment) - (Hypothetical Energy Cost - Actual Energy Cost)) = remaining balance to payback. Once this number is positive, the system has paid for itself.

As I stated above, this ignores inflation and time value of money, but I figure I’ll tackle those aspects after I figure out how to get this into HA as a native sensor instead of through Grafana. And then, my ultimate goal was to have an HA sensor that shows the projected payback date, but I haven’t gotten that far yet. I still have a ways to go here. But at least after a year of ownership I can tell how much the system hypothetically saved me!

Suggestions and feedback on this are appreciated.

Did you ever find some type of solution that’s ‘good enough’ that covers the multiple variables? - here in NSW with Energy AUstralia I have 8 time sets depending on the season - which could mean i’d need to setup 16 time start / stop helpers and a further 6 for season stop / start…grr…then somehow incorporate the ‘controlled load’ which is just the hot water on a timer…heh

I don’t use Home Assistant for tracking energy costs. Too much of a PITA. I just do it in Excel. I may should one day HA add something to the energy dashboard set up to make it easy, but I have little interest in mucking about coding stuff.

1 Like

Are you sure about this calculation? Isn’t imported energy simply a value that is read through a sensor? Am pretty sure that is the case in my situation…

Yes, grid import and export are / can be read from meters. The calculation I quoted was just to show how it all fits together and balances. Beware mixing kw (power) and kwhrs (energy) though.

I’m looking for some help here to get a number of systems all appearing in the same reporting window.
I have 3 separate solar systems of 6Kw. Each is linked to an SMA inverter of 5Kw. These are then connected to a SMA home manager recently installed. (I installed this as the 3rd system was not going to be read by my existing SMA energy meter apparently)
I am also an Amber (AUS) customer.
I also have a Sonnen 13.5Kw battery linked into my MSB.
Before installing the battery and the new 6Kw array I could read the two SMA inverters through the SMA smart meter on the energy dashboard by using the SMA integration.
I have read recently that the SMA integration doesn’t talk to the Home manager 2?
Anyway to be able to get some understanding of my energy flow, usage , grid feed etc I now navigate between the Sonnen app, sunnyportal and the Amber app.
Would really like to be able to send all relevant data through to HA for management with a view to using EMHASS to really get some smarts in the mix.
Does anyone have any ideas to assist?
Pat

Chuck an IotaWatt on the outputs of each inverter and your main grid input? add each inverter as an energy source in dashboard

Dean
thanks for the idea - I am trying to avoid buying yet another set of gadgets to do a job that the original units should do. I am talking with SMA about this and my solar installer. If I find a better solution I will post.
Pat

there’s a Home Assistant modbus integration that talks to a number of inverters, why can’t that talk to all 3 SMA inverters that you have…Read the MPPT power directly into HA and into your solar production in your energy dash…Bonus, each inverter is likely to have at least 2 strings, so graphing all 6MPPT’s will look much cooler in the dash and also give interesting data at different times of the year when your panels work differently.
Also, there seems to be a number of Sonnen battery integrations.
Finally, if you can’t read the new inverter, what’s different? - could it be a simple addressing issue? - i.e. two devices may have the same ID,

Do you have metering installed for all 3 inverters?

I have two Sungrow inverters, both happily chirping out MODBUS data for all 4 of my MPPT’s

On this parameter


Electricity meter represent the reading of the counter of the house. It’s the absolute value on the counter at that moment.

For instance,
at 08:00 / 8495.5 kwh
at 10:00 / 8494.2 kw/h
electricty_meter = house consumption + solar production.
In this example my solar production produce more than the house consumption, thus counter is decreasing as there is return to grid of 1.3kwh

On energy dasboard, it’s translated in positive value is grid consumption and negative value is when it’s returning to the Grid.
Fine but I can’t use this in return to grid section because it give graphic is the reverse way.

There is no possibility to say in HA : if positive value (increasing kwh) then it’s grid consumption and if it’s negative value (counter going in reverse way - decreasing kwh) it’s return to grid ?

I think this subject is already discussed but I didn’t find any good post or documentation explain the best practice.

Hi, sorry to bother you all with probably beginners questions. In my energy dashboard I have added quit a few sensors of existing hardware. I would like to start a setup for batteries which I can extend to approx. 20 kwh. I would also like to influence the offload to match the nightly.use. There is a lot to read and don"t know what is working. Thought I would ask the combined brainpower here for some guidelines where and how to start.

Think there are two possibilities/best practices:

  • Ask for a dsmr slimme meter; they will provide this as soon as you mention you have solar panels.
  • You can add additional counters so you will have a total, consumption and production counter.

Thank you @WJ4IoT
I finally did myself via template and filter integration. It’s not 100% accurate but it’s better then before.

  • Create a template sensor to remove night bad reading (removing negative value) triggered when meter state change.
  • Filter this template sensor
  • Create a template sensor triggered by filtered value state change containing the delta and also a binary sensor with auto state off. This will serve for calculation for the next action.
  • Create 2 template sensor triggered by the binary sensor from the previous template in order to populate data for the return to grid and consumption from grid used by the energy dashboard .

I prefer to keep my old counter because if I ask for a numeric counter, this will not go anymore in the reverse way when you return to grid.

Filtering part is not easy, I tried low pass but nok (not following max and min) . From now I used this config:

filter: time_simple_moving_average
         window_size: "00:20"
         precision: 1

Glad you found your HA-solution on your old analog meter.

That statement is not true, the are some digital meters with a single meter which do/did not reverse (got one years ago at the same time 4 solar panels were installed) but in principle you should get a SMART (read big brother is watching you) meter consisting of (4) separate meters. Two of them will report your production to the grid, which are you returns (likely before “saldering” roundish 60-70%). This kind of meter will work seamlessly in HA. And yes, The subject of “saldering” and your obligation (*) to report you solar panels is a completely different topic.

Aanmelden zonnepanelen wettelijk verplicht

Volgens de Europese en Nederlandse wet- en regelgeving is zonnepanelen aanmelden verplicht. Deze regelgeving is vermeld in artikel 40, vijfde lid, van Verordening (EU) 2017/1485 (de System Operation Verordening).

BTW for argument sake I dislike the upcoming changes in the “salderingsregeling” too (if you live in the Netherlands) but again this is a completely different topic.