Whole-Home Measurement: Shelly 3EM, DIN Rail Meters, Current Transformers, and Safety
Whole-Home Measurement: Shelly 3EM, DIN Rail Meters, Current Transformers, and Safety
In Lesson 4 you measured one device on an outlet. Now we change scale: we measure the whole home. That's a completely different level. This isn't about an outlet anymore, it's about your electrical installation. That's why this lesson talks about safety and electricians just as much as it talks about data.
Whole-home measurement delivers enormous value. You see total consumption, power over time, grid import, and, with solar, export too. It's the foundation for genuine energy analysis and for an Energy Dashboard with import and export. But installing a meter in your breaker panel isn't a trial-and-error exercise for a beginner.
Plan on about 65 to 75 minutes. This lesson is more conceptual than the last one. I won't show you how to wire up live conductors, because that's not something you learn from a guide. I'll show you what this kind of meter measures, what your options are, how to recognize flow direction in the data, and how to prepare a safe plan for an electrician to carry out.
This lesson's core rule
Whole-home measurement isn't just a bigger outlet.
It's work at the level of your electrical installation, so safety and an electrician come first, data comes second.
Safety warning
Work inside a breaker panel is done by a licensed electrician. Mains voltage is lethally dangerous. Don't open the panel, don't touch conductors, and don't install a meter yourself unless you're properly qualified. This lesson is conceptual knowledge and planning, not a live-wiring installation guide.
One device versus the whole home
The outlet from Lesson 4 measured one load. A whole-home meter measures the entire installation at once, usually right at the point where it enters the home, after the utility's own meter. That's a different goal and a different risk. You plug a metering outlet into a regular socket. A whole-home meter gets installed in the breaker panel, often with current transformers clamped onto the phase conductors.
| Feature | Outlet measurement | Whole-home measurement |
|---|---|---|
| What it measures | One load | The whole installation, all phases |
| Where it's installed | In an outlet, no risk | In the breaker panel, a job for an electrician |
| Import and export | Usually not | Yes, essential with solar |
| Risk | Minimal | Serious, mains voltage |
What a whole-home meter measures
A good whole-home meter gives you several kinds of data at once. These are what later feed the Energy Dashboard and your own dashboards. It's worth knowing what to look for before you pick hardware.
Instantaneous power: how much the home is drawing right now, often per phase.
Cumulative energy: total usage in kWh, the foundation of the Energy Dashboard.
Grid import: energy drawn from your utility.
Grid export: energy sent back, essential with solar.
Voltage and current: extra context, useful for diagnostics.
Where to install the meter alongside solar
With solar, where you measure matters a great deal. A meter installed at the home's grid connection shows the flow between the home and the grid: import or export. The inverter shows PV production. Those aren't the same data. Only together do they let you understand how much the home uses, how much it produces, and how much it sends back.
Measuring at the grid connection: shows whether the home is drawing energy from the grid or sending it back.
Measuring at the inverter: shows PV production, how much energy the panels generated.
Home consumption: often calculated from the data: PV production + import - export.
Settle this with your electrician
Before installation, tell your electrician whether you want to measure flow at the grid connection, PV production, or both. Where the current transformers get installed decides how useful the data in Home Assistant will be later.
Single-phase and three-phase in plain terms
A single-phase installation has one phase conductor. A three-phase installation has three. Larger homes often have three phases, apartments more often have one. This matters, because the meter has to match your installation. A single-phase meter won't correctly measure a three-phase home.
Don't know how many phases you have
Your electrician will check this when they inspect the panel. It's one of the first questions when choosing a meter. With three phases, you need a three-phase meter, or three current transformers.
With three phases, it also matters that the meter sums the phases correctly, and, if you have solar, that it handles the balance across phases according to your utility's billing rules. We'll refine that topic in the solar lesson. For now, remember: the number of phases decides which hardware to choose.
Shelly 3EM and Shelly Pro 3EM
A popular choice for whole-home measurement is the Shelly 3EM or Shelly Pro 3EM. It's a device installed in the breaker panel that measures three phases through current transformers clamped onto the conductors. It has a local integration in Home Assistant and usually exposes power, energy, import, and export, both per phase and as a total.
Advantages: local data, HA integration, per-phase measurement, import and export.
Requires: space in the breaker panel, installation by an electrician, correctly connected transformers.
Watch out for: the direction and phase assignment of the transformers have to be correct, otherwise the data will be misleading.
DIN rail meters with Modbus
An alternative is a DIN rail energy meter that communicates over Modbus. This is a popular option for people who want a meter that looks like a classic panel meter, integrated via Modbus RTU or TCP. In Home Assistant, you read the data through the Modbus integration, sometimes with ESPHome as a bridge.
| Option | Who it suits | Integration |
|---|---|---|
| Shelly 3EM / Pro 3EM | A simple start, a ready-made integration | Local Shelly integration |
| A DIN rail Modbus meter | People who prefer a classic panel-mounted meter | Modbus RTU/TCP, sometimes via ESPHome |
Both need an electrician
Whether you choose a Shelly 3EM or a DIN rail meter, installation in the breaker panel is done by an electrician. Your role is choosing the hardware, preparing a plan, and configuring the data in Home Assistant after installation.
Current transformers: what they are and what they're for
A current transformer is a component that measures the current flowing through a conductor without cutting into it. In the clamp-on version, it wraps around the phase conductor like a clip. That lets the meter measure a whole home's large currents safely for the electronics. It's what makes measuring an entire home possible at all, not just a single outlet.
Current range: the transformer has to be sized for your installation's maximum current.
Direction: a transformer usually has a marked side. Installed backward, it'll show negative power, or swap import with export.
Phase assignment: the transformer from a given phase has to land on the meter's matching input.
Transformers have rules too
A current transformer has to be used according to the manufacturer's instructions and the meter type it's paired with. Don't install, remove, or reconnect transformers yourself inside the breaker panel. Leave sizing, direction, and wiring to your electrician.
The breaker panel isn't a place for trial and error
This is the most important part of this lesson. In earlier lessons you could experiment risk-free. Here it's different. A live breaker panel can kill. There's no room for trying, checking, and undoing here. One mistaken touch can end in electric shock, fire, or damage to the installation.
Don't open the panel: if you're not licensed, leave it to an electrician.
Don't work live: disconnecting power is a job for a professional, not a course student.
Don't improvise: not knowing your installation isn't something a video online can make up for.
When to call an electrician
The short answer: always, for anything inside the breaker panel. Your part is planning and configuring the data. The electrician's part is the physical install, connecting the transformers, checking the phases, and safely powering everything back up. A good split of roles gets you great data with no risk.
| You do | Your electrician does |
|---|---|
| Choosing the meter and transformers | Installation in the breaker panel |
| Preparing a place for the data in HA | Connecting transformers to the right phases |
| Configuring entities and the Energy Dashboard | Checking direction and safely powering up |
How to check import and export direction
After installation, your role returns. In Developer Tools, States, check whether the data makes sense. When the home draws power from the grid with no solar involved, import should climb and export should sit still. If you see the opposite, a transformer is probably connected backward, or import and export are swapped.
A test without solar: switch on a large load. Import should climb, power should read positive.
Negative power for no reason: can mean a reversed transformer on that phase.
Your electrician makes the fix: repositioning a transformer is, again, work inside the panel.
A simple formula with solar
If you have PV production, import, and export, you can estimate home consumption: home consumption = PV production + import - export. In practice, the result depends on where you're measuring and how the inverter and meter report their values.
Compare the data over several days
After installation, don't judge everything after five minutes. Over several days, compare the trend against your utility's meter, your inverter's app, or your bill across successive periods. Don't expect agreement down to the last hundredth of a kWh, but large differences, a reversed direction, or odd spikes are a signal to revisit the configuration or the installation.
A small difference: normal, depends on accuracy class, measurement point, and reporting method.
A large difference: check transformer direction, phase assignment, units, and measurement point.
A native energy counter comes first
If your meter exposes separate imported and exported energy in kWh, use those entities directly. Deriving energy from instantaneous power with Integration is a fallback for when the device doesn't provide its own energy counters.
Three phases, net measurement, and the installation point
Splitting a net-sum sign into import and export only works when the sensor genuinely represents the grid connection's net value, the sign convention is known, and the measurement point is correct. With three phases, import and export can occur simultaneously on different phases. A simple max/min of a net sum may not match the sum of per-phase flows, or your utility's own balance. Don't use a single phase's power, a sum of absolute values, or the inverter's power as "whole-home power" without checking.
Current transformers: safety rules
A transformer is clamped around one single phase conductor, not the whole cable. A conventional current transformer must never be left with an open secondary circuit if the manufacturer prohibits it. Voltage terminals and installation in the panel require an electrician.
Ready-made import and export template sensors
Check for ready-made entities first
A Shelly 3EM and many DIN rail meters already provide import and export entities in kWh. If you have them, skip the conversions below and use the ready-made entities. The following example is only for the case where the meter gives you a single signed power value.
Sometimes a meter gives you a single power entity that's positive during import and negative during export. For the Energy Dashboard, it's more convenient to have two separate energy entities. Below is an example of splitting power into import and export, then building energy from them with Integration from Lesson 3. Swap the names for your own.
The example's assumption
The example below assumes a positive value from sensor.house_power means grid import, and a negative value means grid export. Your meter might work the other way around. Always confirm this with a test after installation.
Splitting power into import and export
template:
- sensor:
- name: "House Power Import"
unique_id: house_power_import
unit_of_measurement: "W"
device_class: power
state_class: measurement
availability: >
{{ states('sensor.house_power') not in ['unknown', 'unavailable', 'none'] }}
state: >
{% set power = states('sensor.house_power') | float %}
{{ [power, 0] | max | round(1) }}
- name: "House Power Export"
unique_id: house_power_export
unit_of_measurement: "W"
device_class: power
state_class: measurement
availability: >
{{ states('sensor.house_power') not in ['unknown', 'unavailable', 'none'] }}
state: >
{% set power = states('sensor.house_power') | float %}
{{ ([power, 0] | min | abs) | round(1) }}
Now you turn these two power values into energy with Integration, exactly as in Lesson 3. Import and export in kWh will then feed into the Energy Dashboard's Electric grid category.
Import and export energy
sensor:
- platform: integration
source: sensor.house_power_import
name: "House Energy Import"
unique_id: house_energy_import
unit_prefix: k
unit_time: h
method: left
round: 2
max_sub_interval:
minutes: 5
- platform: integration
source: sensor.house_power_export
name: "House Energy Export"
unique_id: house_energy_export
unit_prefix: k
unit_time: h
method: left
round: 2
max_sub_interval:
minutes: 5
What to add to the Energy Dashboard
Once you have import and export in kWh, add them to the Energy Dashboard under Electric grid, just as in Lesson 2. Import is energy drawn from the grid, export is energy sent back. If you have solar, you'll add production under Solar panels, but we'll cover that in detail in the solar lesson.
Import: your grid-drawn energy entity in kWh, cumulative.
Export: your grid-sent energy entity in kWh, cumulative.
Check after a day: statistics need time, judge them after a day or two.
Common mistakes
A reversed transformer: power reads negative, import and export swap places.
Mixed-up phases: a transformer from one phase lands on another's input, and the totals don't make sense.
The wrong unit: mixing up W with kWh, or a missing unit_prefix in Integration.
No solar context: you interpret export without understanding self-consumption, which we'll cover in the solar lesson.
A single-phase meter on a three-phase home: it only measures part of the home and understates usage.
Working in the breaker panel without an electrician: the biggest and most dangerous mistake in this lesson.
The wrong measurement point: you're measuring a different part of the installation than the one you want to analyze, so the data doesn't answer your question.
No cross-check with a meter: you assume the data is good without checking it against your utility's meter or the inverter.
You treat the data as official billing: you treat an HA measurement like an official meter, instead of using it for analysis and decisions.
Assignment: a safe plan for whole-home measurement
To do
☐ Establish whether your installation is single-phase or three-phase. If you don't know, note it as a question for your electrician.
☐ Decide the measurement point: the grid connection, PV production, a specific circuit, or the whole home.
☐ Choose a direction: a Shelly 3EM or a DIN rail Modbus meter.
☐ Check whether there's room in the breaker panel for the meter and transformers.
☐ Write down questions for your electrician: phases, maximum current, location, transformer direction.
☐ Plan how you'll read the data in HA: the Shelly integration or Modbus.
☐ Don't open the breaker panel yourself. Schedule the installation with an electrician.
☐ After installation, check import and export direction in Developer Tools, States.
☐ After installation, compare the data trend against your utility's meter or the inverter's app.
Key takeaways
Whole-home measurement is installation-level work: safety and an electrician come before the data.
The number of phases decides the hardware: the meter has to match your installation.
Shelly 3EM and a DIN Modbus meter: two sensible paths to whole-home measurement.
Transformers have a direction: reversed, they mix up import with export.
The breaker panel is your electrician's job: you plan and configure the data.
Import and export feed the Energy Dashboard: the foundation for analysis with solar.
What's next
In Lesson 6 we'll move into solar: PV, import, export, home consumption, self-consumption, battery storage, and dynamic pricing. The whole-home measurement from this lesson is the foundation solar analysis depends on. Only once you know how much the home draws and sends back does panel production start telling you something useful.
If you finish this lesson with a safe whole-home measurement plan, and you know what you'll do yourself versus what you'll leave to an electrician, you're exactly where you need to be. The scale grew, but the principle stayed the same: safety and data first, then decisions.