Correction, November 2026: An earlier version of this post said I can chart these percentages over years and watch the battery efficiency degrade; the sensors keep no long-term statistics, and my recorder deletes history after seven days. Four other statements were wrong as well. I never compared my self-consumption figure with the cloud portal. The values come from the built-in Modbus integration, not from the Huawei integration. I have no documentation for a 10 kWh battery. And the lifetime yield in the daily report is the inverter's kWh counter divided by 1000, a value in MWh. I have rewritten the post from my configuration and the current values.
The counters underneath
Home Assistant reads my Huawei SUN2000 with the built-in Modbus integration, through a cache in front of the dongle. The inverter provides lifetime counters in kWh: PV yield, grid feed-in, grid import, battery charge and battery discharge, plus daily values. None of them is a percentage. On 4 April 2026 I added template sensors on my old instance that compute the percentages from those counters; in September they moved to my new instance unchanged.
Self-consumption and autarky
The self-consumption rate is the share of the PV yield that was not fed into the grid: yield minus feed-in, divided by yield. Autarky is the share of consumption not covered by the grid. Home Assistant does not measure the house consumption directly in my setup, so the template estimates it as yield minus feed-in plus grid import. In configuration.yaml the block goes into the sensor list under template:, indented two spaces further than - sensor:, with the three entity IDs replaced by your own lifetime counters in kWh:
- name: "Autarkiegrad"
unique_id: autarkiegrad
unit_of_measurement: "%"
icon: "mdi:leaf"
state: >
{% set ertrag = states('sensor.pv_gesamt_ertrag') | float(0) %}
{% set einspeisung = states('sensor.netzeinspeisung_gesamt') | float(0) %}
{% set netzbezug = states('sensor.netzbezug_gesamt') | float(0) %}
{% set verbrauch = ertrag - einspeisung + netzbezug %}
{% if verbrauch > 0 %}
{{ ((1 - netzbezug / verbrauch) * 100) | round(1) }}
{% else %}
0
{% endif %}This is an estimate of the house consumption that includes the battery losses. If the grid import counter is unavailable, float(0) substitutes zero and the template reports 100 % autarky as long as yield minus feed-in is positive; I have not added an availability check. The inputs are lifetime counters. Both percentages therefore describe the whole time since the inverter started counting, not today. On 20 November they stood at 66.7 % self-consumption and 80.2 % autarky. In August they were 65.8 % and 79.9 %, so they move by tenths over months.
For today's values there are two more sensors, Eigenverbrauch Heute and Verbrauch Heute, which apply the same arithmetic to the daily yield, feed-in and import counters and report kWh, not percentages.
Battery efficiency and cycles
My battery efficiency sensor divides the lifetime discharge counter by the lifetime charge counter, without correcting for a different state of charge at the start and the end. On 20 November that was 8,489.91 kWh against 8,738.28 kWh, 97.2 %. The cycle sensor divides the charged energy by 10, which stands for a usable capacity of 10 kWh that I have not checked against the battery's data sheet. It showed 874 cycles.
No long-term history
None of these percentage sensors has a state_class, so Home Assistant creates no long-term statistics for them. The recorder on both instances keeps seven days of history. A chart of autarky over a year therefore does not exist in my setup. Adding state_class: measurement would change that, and I have not done it yet. The boiler temperature sensor in the same file has it, with a comment explaining why.
The string watchdog
The PV String Differenz sensor compares the currents of the two strings. Below 0.5 A on the stronger string it reports 0, because at night both currents are close to zero and the percentage would be noise:
- name: "PV String Differenz"
unique_id: pv_string_differenz
unit_of_measurement: "%"
state: >
{% set s1 = states('sensor.pv_string_1_strom') | float(0) %}
{% set s2 = states('sensor.pv_string_2_strom') | float(0) %}
{% set max_val = [s1, s2] | max %}
{% if max_val > 0.5 %}
{{ ((s1 - s2) | abs / max_val * 100) | round(1) }}
{% else %}
0
{% endif %}An automation on the old instance sends a push when the difference stays above 30 % for 30 minutes while string 1 carries more than 1 A, with both voltages and currents in the message. It last fired on 18 November at 14:45. That afternoon string 1 delivered between 2 and 5 A and string 2 about 1 A, and on most days in November the difference is above 30 % for some time around midday. I have not yet looked into why string 2 delivers so much less current.
The daily report
A second automation sends a push at 20:00 every day with the day's yield, the battery's daily charge and discharge, the self-consumption rate, the autarky and the lifetime yield in MWh, which is the kWh counter divided by 1000. It last ran on 19 November. Looking at it again for this post, it mixes two periods: the yield and battery values are today's, the two percentages are lifetime values. Percentages computed from the daily sensors would match the rest of the message.
On the new instance both automations exist but are switched off, so the pushes still come from the old one.
Frequently asked questions
Does Home Assistant provide autarky or self-consumption sensors?
Not as entities in my setup. I compute them with template sensors from the inverter's counters.
Why does my autarky barely change?
If it is computed from lifetime counters, as mine is, it describes the whole period since the inverter started counting. Daily counters give a daily value.
Why can't I see my autarky over the last year?
Without a state_class the sensor gets no long-term statistics, and the normal history is deleted after the recorder's keep period, seven days in my setup.



