Loading...
E.G.

A Home Assistant Energy Dashboard, Built Piece by Piece

· updated
Part 5 of 5Series: PV surplus and metricsAll parts
  1. 01Self-Consumption & Autarky: PV Metrics in Home Assistant
  2. 02PV String Comparison in Home Assistant: Setup and Alerts
  3. 03Solar Surplus into Hot Water: the AC·THOR in Home Assistant
  4. 04AC·THOR 9s in Home Assistant via the my-PV Cloud API
  5. 05A Home Assistant Energy Dashboard, Built Piece by Piece
Table of Contents

Correction, November 2026: An earlier version of this overview started with my Home Assistant Energy dashboard, which I have never set up, gave the PV array as roughly 9 kWp, which I have not documented, and listed several Shelly relays for switching loads; there is one Shelly, and it waters the garden. It also repeated claims from the linked posts that I have since corrected. I have rewritten it to match those posts.

My energy setup is a Huawei SUN2000-8KTL-M1 inverter with a LUNA2000 battery and a my-PV AC·THOR 9s that heats hot water with PV surplus; an ETA pellet boiler heats the same tank. Home Assistant's built-in Energy dashboard is not configured on either of my instances. What I look at are two dashboards of my own, PV-Anlage and Energie, which I describe in my post on dashboards from stock cards. This page lists the pieces behind them and links to the posts about each.

Reading the inverter

The inverter speaks Modbus TCP through the SDongle, and according to my notes the dongle accepts only one or two connections at a time. On 4 April 2026 the AC·THOR held the connection permanently and Home Assistant got no inverter data. Since that day a cache polls the dongle, every 10 seconds since 8 April, and answers all clients from memory; Why I added the cache and what its log shows has its own post. The corrected code is published, together with a walk through its Python code. Home Assistant reads the cache with the built-in Modbus integration, using these SUN2000 registers.

The cache also forwards single-register writes to the inverter. I have not used that, and the cache log shows no forwarded write since 25 June. How the cache handles a dongle that stops answering is in my post on reconnects and stale data.

Numbers computed from the counters

The inverter delivers counters in kWh, not percentages. Template sensors compute self-consumption, autarky, battery efficiency and a cycle estimate from them, as described in my post on self-consumption and autarky sensors. Because they use lifetime counters, the percentages describe the whole period since the counters started, 66.7 % self-consumption and 80.2 % autarky on 20 November.

A further template sensor compares the currents of the two PV strings, and an automation on my old instance sends a push when the difference stays above 30 % for 30 minutes. It last fired on 18 November; string 2 delivers much less than string 1 in November, and I have not checked why. The general approach to detecting string faults is in my post on PV string fault detection.

Hot water and dehumidifiers

The AC·THOR regulates its heating element itself. It reads the grid power from the inverter and follows the surplus; Home Assistant shows its values. How that fits together, and why my old boiler automations never fired, is in my post on the AC·THOR and PV surplus. Its settings can be changed through the my-PV cloud API, which I tested in January 2026 after my Modbus writes with mbpoll were refused; whether the device really blocks writes I have not established, see my post on the cloud API.

Home Assistant switches two dehumidifiers in the cellar on depending on PV output and battery level, as described in my post on the Tapo H100 and the dehumidifiers.

Frequently asked questions

Do I need Home Assistant's built-in Energy dashboard for this?

No. I have never configured it. My two dashboards show inverter readings from the Modbus cache and the percentages that the template sensors compute from its counters.

Do I need this exact hardware?

The cache is written for a Huawei SUN2000 with an SDongle. The template sensors only need lifetime counters for yield, feed-in, import and battery charge and discharge, which other inverters provide as well.

Which piece came first?

In my case the cache, on 4 April 2026, because without it Home Assistant got no inverter data. The template sensors followed the same day, and the two dashboards were rebuilt on 8 April.

Related articles

Questions or additions?

Comments run on GitHub Discussions, so you need a GitHub account to write one.