Saving
Home energy monitoring with Home Assistant and Shelly 3EM: from the fuse box to the Energy dashboard
How to measure a solar home with a Shelly 3EM and Home Assistant: installation, the Energy dashboard and a year of data that matches the bill.
In short: The Shelly 3EM is a meter with three current transformers that clamp around the phase conductors in the fuse box. It measures power, voltage and imported and exported energy on every phase, and Home Assistant reads it locally, without the cloud. Over the last 12 months my home used 8,168 kWh. The panels produced 3,880 kWh, and 76.5% of that was used on site. The same meter shows three different "grid imports": 6,415, 5,664 or 5,199 kWh, depending on how you add up the phases, and only the last one, the hourly net balance, matches the bill. The measurements drive two automations: a water heater run on surplus solar and a choice between the air conditioner and the gas boiler by cost. The second saves an estimated 970-1,450 zł (220-330 €) per heating season.
An electricity bill tells you how much energy the house drew in a month. It does not tell you at what hour, on which phase, how much of it came from your own panels, or what happened on the day consumption suddenly jumped. For more than two years I have been measuring that myself in my home in Poland: a three-phase Shelly 3EM meter in the fuse box, Home Assistant, and a dozen or so plugs with power metering on individual appliances. This article covers the installation, the integration, the Energy dashboard, and the trap that makes a dashboard show different numbers from the bill. At the end: what the measurements let me change.
What the Shelly 3EM measures
The Shelly 3EM is a DIN-rail energy meter for three-phase installations. It comes with three split-core current transformers rated up to 120 A each. A transformer opens like a clip and closes around a phase conductor, so nothing has to be cut or rewired. The meter takes voltage from terminals connected to each phase.


From current, voltage and the shift between them the meter works out, for each phase:
- instantaneous power in watts, with a sign: positive is drawn from the grid, negative is fed in,
- an imported energy counter and an exported energy counter, in kWh,
- voltage, current and power factor.
Installing it in the fuse box
I fitted the meter myself in May 2024. I hold a Polish SEP qualification for work on electrical installations.
This is my fuse box before the installation:

The wiring is described in the manual and comes down to two circuits:
- The current transformers clamp around phase conductors L1, L2 and L3 after the utility meter, ahead of the household loads and ahead of the solar inverter. Only then does the meter see the whole grid connection: what the house takes from the grid and what it sends back.
- Supply and voltage sensing (terminals VA, VB, VC and N) go through a separate circuit breaker, either three-pole or three single-pole ones.

Two things decide whether the readings are right:
- Transformer A must sit on the phase that terminal VA takes its voltage from. The same goes for B and C. The meter computes power from the current and voltage of the same phase; mixed-up phases give nonsense power and power factor readings.
- The arrow on the transformer points towards the house. A reversed transformer turns import into export: at night, with no sun, the house would appear to "export" on that phase. That is the first thing to check when the numbers look odd.


The Shelly web page and app
When first powered, the Shelly 3EM opens its own Wi-Fi network, through which you give it your home network's details. After that it serves a local web page at its IP address, with total power and the live state of each phase.

For the first four months I used only the Shelly app and its cloud. That is enough to see power and daily consumption, but nothing more: you cannot set the meter against the inverter's production, the electricity price or individual appliances. In October 2024 I connected it to Home Assistant, and I have kept the full history since.
Integrating it with Home Assistant
The Shelly integration is built into Home Assistant and finds the meter on the network by itself. It talks to the device locally, so measurement keeps working without internet access and the Shelly cloud can be switched off.
For every phase the integration creates entities for power, imported energy, exported energy, voltage, current and power factor. From the phase counters I build three template sensors in Home Assistant:
| Sensor | What it computes |
|---|---|
sensor.grid_instant_power |
sum of the three phase powers; negative means export |
sensor.total_energy_used |
sum of the three imported energy counters |
sensor.total_energy_returned |
sum of the three exported energy counters |
The summed power is the simplest view of what happens at the grid connection. This is a sunny day: at night and in the morning the house imports, from roughly 9:00 to 19:00 it exports, and the phases can move in opposite directions.

The trap: summed phase counters are not the bill
The Shelly 3EM counts each phase separately. When phase B draws 1 kW while phase C feeds 1 kW back at the same moment, both counters grow: imported and exported. The utility meter sees zero at that moment. Since April 2022 Polish prosumers have been settled with vector summing: the phases are added together, then the whole hour is netted, meaning energy imported and exported within the same hour cancel out and only the remainder is billed (as of November 2026; the wholesale market has moved to 15-minute periods, but prosumers are still netted hourly). Summing the phases is common across Europe, but the netting period varies: Germany and Austria net instantly at the meter, Spain nets every hour (hence the name of the Balance Neto integration), and the Netherlands has yearly net metering until 2027. Check how your grid operator does it.
In my house the phases drift far apart. The three-phase inverter feeds all phases equally, while most of the household load sits on phase B:
The numbers behind the chart
| Phase | Imported | Exported |
|---|---|---|
| Phase A | 2,336 | 826 |
| Phase B | 3,302 | 271 |
| Phase C | 778 | 1,028 |
So I counted grid import over my year of data in three ways:
The numbers behind the chart
| One meter, three ways of counting | Per-phase counters | Instantaneous phase sum | Hourly net balance (the bill) |
|---|---|---|---|
| Grid import | 6,415 | 5,664 | 5,199 |
| Grid export | 2,125 | 1,368 | 911 |
| Method | Import | Export |
|---|---|---|
| Each phase's counters on their own | 6,415 kWh | 2,125 kWh |
| Instantaneous sum of the three phases | 5,664 kWh | 1,368 kWh |
| Hourly net balance (as the utility bills it) | 5,199 kWh | 911 kWh |
A dashboard built on per-phase counters overstates import by 23% and export more than twice. The difference between import and export is the same in all three, about 4,290 kWh, because netting only cancels out the parts of import and export that offset each other. Everything calculated from import changes, though: cost, self-consumption, the case for a home battery.
In my setup the hourly net balance comes from the Balance Neto integration, installed through HACS. It takes the summed phase counters, subtracts the increments every hour, and exposes two counters: sensor.net_imported (import after netting) and sensor.net_exported (export after netting). I describe its configuration step by step, in Polish, in the article about the water heater run on surplus solar.
The Energy dashboard: energy flow in the house
Home Assistant's Energy dashboard needs three counters and an electricity price:
| Dashboard field | My entity |
|---|---|
| Grid consumption | sensor.net_imported (Balance Neto) |
| Return to grid | sensor.net_exported (Balance Neto) |
| Solar production | the inverter's daily production counter |
| Electricity price | a sensor with the price of the current G12R zone |
From these counters Home Assistant works out home consumption itself: import + solar - export. This was the best day of the year, 22 June (the screenshots are in Polish: Sieć is the grid, Energia słoneczna solar, Dystrybucja energii the energy flow):

And this is the whole year:

Two years of data show more than the dashboard does. Month by month, grid import falls to about 200-260 kWh in summer and rises to 730 kWh in winter, because the house is partly heated by an air conditioner:
The numbers behind the chart
| Month | Grid import | Solar production | Grid export |
|---|---|---|---|
| December | 634 | 25 | 0 |
| January | 730 | no data | 0 |
| February | 579 | no data | 2 |
| March | 526 | 397 | 71 |
| April | 396 | 513 | 188 |
| May | 249 | 580 | 183 |
| June | 202 | 635 | 160 |
| July | 244 | 541 | 128 |
| August | 258 | 502 | 104 |
| September | 301 | 360 | 51 |
| October | 439 | 205 | 19 |
The average day across the year shows how consumption lines up with the sun and the tariff. My tariff, G12R, is a Polish two-zone time-of-use tariff: the cheap zone runs 13:00-16:00 and 22:00-07:00 at 0.539 zł/kWh (0.12 €), the rest of the day costs 1.327 zł/kWh (0.30 €). Grid import peaks at 4-7 in the morning and halves at 7, when the expensive zone starts. That is no accident but automation, described below. In total, 63.5% of my grid import falls in the cheap zone.
The numbers behind the chart
| Hour of day | Home consumption | Solar production | Grid import |
|---|---|---|---|
| 0 | 867 | 0 | 867 |
| 1 | 788 | 0 | 788 |
| 2 | 786 | 0 | 786 |
| 3 | 789 | 0 | 789 |
| 4 | 919 | 0 | 919 |
| 5 | 945 | 17 | 929 |
| 6 | 978 | 72 | 907 |
| 7 | 521 | 169 | 357 |
| 8 | 615 | 330 | 306 |
| 9 | 813 | 625 | 248 |
| 10 | 1,033 | 911 | 229 |
| 11 | 1,200 | 1,163 | 214 |
| 12 | 1,311 | 1,327 | 237 |
| 13 | 1,538 | 1,436 | 425 |
| 14 | 1,451 | 1,384 | 479 |
| 15 | 1,326 | 1,217 | 547 |
| 16 | 1,009 | 942 | 424 |
| 17 | 892 | 643 | 494 |
| 18 | 820 | 319 | 600 |
| 19 | 781 | 71 | 711 |
| 20 | 733 | 6 | 727 |
| 21 | 651 | 0 | 651 |
| 22 | 789 | 0 | 789 |
| 23 | 826 | 0 | 826 |
Measuring individual appliances
The Shelly 3EM tells you how much the whole house draws, but not what draws it. For that there are plugs and modules with energy metering. I use three kinds:
- a smart plug (Shelly Plug S) for appliances with a plug: washing machine, dishwasher, fridge, water heater,
- an in-wall module (Shelly 1PM Mini, PM Mini) behind a switch or in a box next to a hard-wired appliance, such as an air conditioner,
- a dimmer with metering for lighting.
Each one is added to the Energy dashboard as an individual device. Home Assistant then shows its consumption against the whole house and labels the rest, which nothing measures, as untracked consumption. If one device sits behind another (a lamp on a power strip that itself hangs on a metering plug, for example), mark it in the upstream device field, or its energy is counted twice.
A metering plug answers questions the bill never asks. Example: my dishwasher uses 1.25 kWh per cycle (median of 325 cycles over the year). In the cheap G12R zone that is 0.67 zł (0.15 €), in the expensive one 1.66 zł (0.38 €). Without the measurement I would not know whether it is worth waiting until 13:00 or 22:00 to start it. With it, I know that 63% of the cycles start in the cheap zone.
Plugs have their limits: at loads of a few watts the reading is less accurate. That does not matter when ranking what uses the most; it does when counting standby consumption to the watt.
What I optimised with it
Measurement alone saves nothing. Savings come from automation that uses it. In my house that means two things.
A water heater run on surplus solar. The current hour's balance from Balance Neto decides when to switch on a water heater with a 1.5 kW element: only when the hour will end in surplus anyway. From March to October 2026 the water heater used 998 kWh, about half of the energy that would otherwise have gone to the grid. At most 2.3% of its energy fell in hours that ended with a net import. Plumbing, automation and the money side are in the (Polish) article Bojler grzany nadwyżką z fotowoltaiki.
Choosing the heat source by cost. The house is heated by a gas boiler and an air conditioner. The automation compares the cost of a kWh of heat from both: the air conditioner from the current G12R zone and an efficiency (COP) derived from the outdoor temperature, the boiler from the gas price. That is why the average day peaks at 4-7 and dips at 7. In the 2025/2026 season the living-room air conditioner took 86.8% of its electricity in the cheap zone, and the estimated saving against gas alone is 970-1,450 zł (220-330 €). The model, prices and limits of that estimate are in the (Polish) article Ogrzewanie klimatyzacją w taryfie G12R.
Both automations need the same thing: a trustworthy measurement of the grid connection, counted the way the utility counts it.
Things to watch
- Net the way your utility does. Feed the Energy dashboard with counters after netting, not the raw phase counters. Otherwise Home Assistant shows higher import and higher export than your bill.
- Check the transformers at night. With no sun (and no home battery) every phase should show import or power close to zero. Negative power on one phase at night is almost always a reversed transformer or a mixed-up phase.
- An unavailable meter is not zero. When the Shelly drops off the network for a moment, a template that defaults to 0 shows zero power, and a counter sum falls, which Home Assistant reads as a reset. My sum templates return no value when any phase is unavailable.
- Watch for gaps in your sources. My inverter stopped reporting production for six weeks in winter. The Energy dashboard does not warn you: home consumption simply comes out lower.
- A smart plug is not a laboratory meter. It is good enough for comparisons and decisions, not for arguing with the utility.
If you have solar and want to start with one thing, start with a meter on the grid connection. Plugs on appliances answer "what", but only a whole-house meter tells you how much and when, and every decision about tariffs, automation and a home battery depends on that.
Figures and denominators
How the figures above were taken. They are measurements from the data source named under the title, not figures from the ComparePV catalogue, and they do not change when the catalogue syncs.
Every figure comes from Home Assistant in the author's home in Poland, for 18 November 2025 - 17 November 2026 unless stated otherwise. Grid import and export after netting are the hourly increments of sensor.net_imported and sensor.net_exported from the Balance Neto integration, computed from the summed counters of the three Shelly 3EM phases. Solar production is the inverter's daily counter (sensor.solar_production_today). Home consumption = import + solar - export, hour by hour.
Three ways of counting import: (1) each phase's imported and exported energy counters on their own (channel_a/b/c_energy and _energy_returned), (2) the integral of the instantaneous sum of the three phase powers (sensor.grid_instant_power, samples every few seconds, 99.9% of the period covered, gaps over 5 minutes skipped), (3) the hourly net balance from Balance Neto. Counter increments above 50 kWh in an hour are treated as resets and skipped.
Solar production has a gap from 31 December 2025 to 12 February 2026 (the inverter did not report). Home consumption in that window is understated by the unrecorded production; December, the last full month before the gap, gave 25 kWh, so an estimated few tens and at most about 100 kWh are missing; the monthly chart leaves January and February solar empty. The G12R tariff's cheap hours are 13:00-16:00 and 22:00-07:00 every day, as in Energa's tariff. Cost per dishwasher cycle is the median energy of 325 cycles detected from the plug's power reading (above 5 W, ending after 10 minutes below), times the G12R zone price with variable charges and VAT (0.539 and 1.327 zł/kWh). Euro amounts use the NBP mid rate of 18 November 2026, 4.4089 zł per euro.
All 12 figures on this page and what each counts
| Figure | Value | Computed over |
|---|---|---|
| Home consumption | 8,168 kWh | import + solar - export, 12 months |
| Solar production | 3,880 kWh | inverter, 12 months (gap 31 Dec - 12 Feb) |
| Grid import after hourly netting | 5,199 kWh | sensor.net_imported |
| Grid export after hourly netting | 911 kWh | sensor.net_exported |
| Self-consumption | 76.5% | (3,880 - 911) / 3,880 kWh |
| Consumption covered by own solar | 36.3% | (3,880 - 911) / 8,168 kWh |
| Import from per-phase counters | 6,415 kWh | phases A, B, C summed |
| Export from per-phase counters | 2,125 kWh | phases A, B, C summed |
| Import from the instantaneous phase sum | 5,664 kWh | integral of sensor.grid_instant_power |
| Export from the instantaneous phase sum | 1,368 kWh | integral of sensor.grid_instant_power |
| Grid import in the cheap G12R hours | 63.5% | 5,199 kWh |
| Energy per dishwasher cycle (median) | 1.25 kWh | 325 cycles |
Reference list
- Home Assistant, Shelly integration
- Home Assistant, Energy dashboard: home consumption
- Home Assistant, Energy dashboard: individual devices
- Balance Neto, Home Assistant integration (GitHub, MiguelAngelLV)
- Shelly 3EM-63 Gen3, manufacturer documentation
- Shelly Pro 3EM, manufacturer knowledge base
- Gramwzielone: Polish prosumers settled with vector phase summing from 1 April 2022 (in Polish)
- Monitorowanie energii w Home Assistant z Shelly 3EM (this article in Polish, PV Index)