Home Assistant · Energy
Energy dashboard with the Shelly Pro 3EM
Why the Shelly counts per phase while the utility meter nets – and how to build netted counters yourself.
Read article →Technical article · Home Assistant · Photovoltaics
The balcony solar system or the small battery should only deliver as much as the house needs right now. With a meter at the grid connection and a controllable inverter, this can be built in Home Assistant. Whether it works depends on two things: how fast the chain of measurement, calculation and setpoint is, and whether the system legally needs zero export at all. Mostly it does not – and that is exactly what makes Home Assistant useful here.
From this article on Amazon (Germany):
Shelly Pro 3EM (120 A)*
Marked *: affiliate links. As an Amazon Associate I earn from qualifying purchases.
For a balcony solar system the law answers the question directly. Section 8(5a) EEG: plug-in solar devices “with an installed capacity of up to 2 kilowatts in total and an inverter capacity of up to 800 volt-amperes in total, which are operated behind the withdrawal point of a final consumer and are allocated to unpaid offtake, may be connected in compliance with the rules applicable to the design of a grid connection.”
“Unpaid offtake” means: whatever flows into the grid is taken by the grid operator without paying for it. So feeding in is allowed. For a balcony solar system, zero export is not a rule but a question of self-consumption, and it pays off mainly with a battery that absorbs the surplus instead of giving it away.
It is different if a system is explicitly connected by the grid operator as a zero-export system, for example because the grid connection does not allow feed-in. The VDE FNN guidance on connecting storage describes such systems as installations “for which feeding into the grid is not intended. Feeding into the grid is prevented by the system.” The limitation is then part of the connection approval, and the requirements further below apply.
Registration in the Marktstammdatenregister depends not on feed-in but on the grid connection. Under section 5(2) of the Marktstammdatenregister Ordinance, only systems that are “connected to a power grid neither directly nor indirectly” are exempt. A zero-export system is connected to the grid even if it does not feed in; so it must be registered, a battery as a separate unit. For plug-in solar devices, section 8(5a) EEG states explicitly that registration obligations remain “unaffected”.
Towards the grid operator, however, the following applies to plug-in solar devices: “additional notifications to be submitted to the grid operator […] may not be demanded.” Larger systems, including those with zero export, are registered with the grid operator by the electrical contractor. For storage, the new VDE FNN guidance on low voltage states that it is “to be registered with the grid operator in accordance with VDE-AR-N 4100”; only pure island-mode storage is exempt.
What a missed registration costs – 10 euros per kilowatt and month, retroactively 2 euros once it has been made – is set out with a worked example in Registering a PV system in the Marktstammdatenregister.
Every zero-export setup, whether in Home Assistant, in a battery or in a dedicated controller, is the same chain of three links:
In the simplest case the new setpoint is: current inverter output plus measured grid power minus target value. If the house imports 200 W while the inverter delivers 300 W, and the target is 30 W of import, it should deliver 470 W from now on. If the house exports 100 W while the inverter delivers 400 W, it is 270 W. The value is capped at zero at the bottom and at what the inverter is allowed at the top.
Each link has a delay, and their sum decides how long power keeps flowing in the wrong direction after a load change.
Measure the way the meter counts: as the sum across all three phases. The specification for the German basic meter states that the measurement is “always made as the sum across all phase conductors”, and the VDE FNN guidance explicitly requires a measurement for storage that operates “netted on active power”. Controlling on a single phase means controlling past the meter.
On the Shelly Pro 3EM the right quantity is the total power, which Shelly describes as the “Sum of the active power on all phases”. Its energy counters, on the other hand, count per phase; why that makes a difference for billing is covered in Energy dashboard with the Shelly Pro 3EM. The Pro 3EM reports a new power value as soon as it has changed by 5 % or 10 W. That is not a fixed cycle: under constant load nothing comes, on a load step a value arrives immediately.
For comparison, what a certified system has to deliver: the VDE FNN guidance specifies for the energy flow direction sensor a measurement and transmission “at least once every 500 milliseconds” and an accuracy of at least class A for energy meters.
On Amazon (Germany): Shelly Pro 3EM (120 A)*
For Hoymiles micro-inverters, OpenDTU is the usual local route: a small radio gateway that reads the inverter without the manufacturer's cloud and sets a power limit. The documentation distinguishes two kinds of limit:
| Command | Behaviour according to the documentation |
|---|---|
limit_persistent_absolute | “will survive the night without power”, so it stays even after the nightly shutdown |
limit_nonpersistent_absolute | “will reset to the last persistent value at night without power”; must be published “non-retained”, otherwise it is ignored |
For a control that keeps adjusting the value, the non-persistent limit is the right one: it does not change the base setting, and if the control fails, the inverter falls back to the stored value overnight. The persistent value is set once deliberately, for example to the 800 VA a balcony solar system is allowed.
If a battery comes with its own control that reads a meter at the grid connection, that is usually the better place for zero export: measurement and actuator then sit in one system. Which meters it accepts is in the manufacturer's manual.
There are two places for the middle link. The first is a specialised controller in the gateway itself: the OpenDTU-OnBattery variant includes a “Dynamic Power Limiter” that drives the inverters so that the meter shows a set value; with a target of zero, that is zero export. It keeps running while Home Assistant is restarting.
The second place is Home Assistant. An automation that calculates the new setpoint on every change of grid power and sends it to OpenDTU via MQTT looks like this in principle:
alias: "Zero export: adjust inverter"
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: sensor.pro3em_power
conditions:
- condition: template
value_template: >
{{ has_value('sensor.pro3em_power')
and has_value('sensor.inverter_power')
and (states('sensor.pro3em_power') | float - 30) | abs > 20 }}
actions:
- variables:
new_limit: >
{{ [[states('sensor.inverter_power') | float
+ states('sensor.pro3em_power') | float - 30, 0] | max, 800]
| min | round(0) | int }}
- action: mqtt.publish
data:
topic: "BASE/SERIAL/cmd/limit_nonpersistent_absolute"
payload: "{{ new_limit }}"
retain: false
- delay:
seconds: 5
The placeholders: sensor.pro3em_power is the total power at the grid connection,
sensor.inverter_power the inverter's current output, BASE the base topic set in
OpenDTU, which is prepended to all topics. 30 W is the target, 20 W the dead band in which nothing
happens, 800 W the upper limit. The pause at the end, together with mode: single, ensures
that a new value is sent at most every five seconds.
Both routes at once do not work. The OpenDTU-OnBattery documentation requires the controller to control the inverters it governs “exclusive”-ly: “No other software and no human interaction shall trigger limit updates”.
When a 2 kW kettle switches off, the inverter keeps delivering until the chain has measured, calculated and set the new value. In that time power flows into the grid. The OpenDTU-OnBattery documentation is unusually open about this:
An automation in Home Assistant is not exempt from this; with the pause in the example above it is rather slower. A small positive target shifts the trade-off: a little import from the grid instead of brief export. For a balcony solar system that is allowed to feed in, this is a question of economics, not of permissibility.
If the system is connected by the grid operator as a zero-export system, or a battery must not feed grid power back, the limitation is part of the connection approval. The new VDE FNN guidance on low voltage describes zero export as limiting the connection active power “to 0%”, controlled via a sensor at the grid connection point, and refers to VDE-AR-N 4105, section 5.5.2. What this sensor has to deliver is set out in the VDE FNN guidance on storage:
A self-built chain of Shelly, Home Assistant and OpenDTU can be fast in a given case. But it has no declaration of conformity, and so it does not count here. In that case zero export belongs in a battery or inverter whose manufacturer provides the proof; Home Assistant remains for what happens above it.
The guidance names one more point that shows why grid operators look closely: when determining how much generation can be connected as a zero-export system, “transient feed-in due to control behaviour, e.g. on load changes” must be taken into account. As an estimate it gives an installable feed-in power of at most 1 % of the grid short-circuit power at the connection point; preferably, the grid operator determines the value itself.
No. Under section 8(5a) of the German Renewable Energy Sources Act (EEG), a plug-in solar device with up to 2 kilowatts of module power and 800 volt-amperes of inverter power may be operated behind the meter and feed into the grid, just without payment. Zero export keeps your own power in the house instead of giving it away; it is not mandatory.
Yes, in the Marktstammdatenregister. Only systems that are connected to a power grid neither directly nor indirectly are exempt. A zero-export system is connected to the grid even if it does not feed in. For plug-in solar devices the grid operator may not demand any additional notifications; larger systems are registered with the grid operator by the electrical contractor.
If registration in the Marktstammdatenregister is missing, section 52 EEG provides for a payment to the grid operator: 10 euros per kilowatt of installed power per month, reduced retroactively to 2 euros once registration has been made. The details are in the article on the Marktstammdatenregister.
Not quite. Measuring, calculating and sending the new value to the inverter takes seconds. If a large load switches off in that time, power briefly flows into the grid. Even specialised controllers such as the Dynamic Power Limiter of OpenDTU-OnBattery state explicitly that they over- and undershoot.
The netted power at the grid connection, that is the sum of the active power of all three phases, the way the utility meter forms it. On the Shelly Pro 3EM that is the total power. Controlling on a single phase means controlling past the meter.
When the grid operator only connects the system as a zero-export system. Then, according to the VDE FNN guidance, the limitation must be handled by an energy flow direction sensor with a manufacturer's declaration of conformity, whose function is tested and recorded at commissioning. A self-built control does not have this proof.
All statements come from the following laws, guidance documents and documentation, each with the date it was checked. VDE-AR-N 4105 itself is not freely available; where it is mentioned, this follows the freely available VDE FNN guidance documents. Quotations from German documents are my translation.
This article is not legal advice and does not replace your grid operator's technical connection conditions. Connecting generation systems and storage that are not plug-in devices is reserved for a registered electrical contractor.
Links marked with an asterisk are affiliate links. As an Amazon Associate I earn from qualifying purchases; the price is unchanged for you. What I recommend does not depend on it.
You want to control balcony solar or a battery so the power stays in the house, and are not sure where the control should sit? I can take a look at your system – the first conversation is free.