A Victron system is already regulating before you touch it. The mistake almost every implementation starts with is therefore conceptual rather than technical: adding a second controller instead of sending the existing one towards a different target.
Starting point
ESS already regulates grid draw, charging and discharging
Correct intervention
set the setpoint from outside – and release it again
Documented route
Modbus TCP with a manufacturer-maintained register list
Belongs to
the hub „controlling a home battery with Home Assistant“
Status
September 2026 · primary source below, with the date checked
A Victron system with an active energy storage system already regulates itself: it holds grid
draw at the connection point to a setpoint, charges the battery from surplus and discharges it
when the house needs more than generation provides. It is not a blank slate waiting for
control but a running controller you reach into.
That is the difference from most other batteries – and the reason the first
attempt to „control it by price“ usually goes wrong: building a second controller alongside ESS
gives you two controllers on one actuator.
The point of intervention
Instead of replacing the controller, set its setpoint from outside. The system keeps
regulating – towards a different target. In practice: during the cheap hour a grid setpoint
charges the battery from the grid; during the expensive one discharge is permitted or forced;
in between, normal self-consumption control runs.
What matters is handing back: after the intervention the original state has to be restored. An
automation that sets a setpoint and forgets to release it after a restart leaves a system
charging permanently from the grid – potentially unnoticed for weeks.
The three connection routes
Official Home Assistant integration. The most convenient route for
measurements and simple switching.
Modbus TCP. The documented route for writing setpoints.
Modbus TCP is part of the GX devices; which registers exist and which unit ID maps to
which device is documented in a manufacturer-maintained register list. Unit ID mapping is
where most people get stuck: it depends on the instance numbers of the connected devices and
is not identical across systems.
MQTT. Available locally and pleasant for event-driven evaluation; the topic
structure follows the same data model as the register list.
No second-hand register addresses. The register list is
versioned and maintained by the manufacturer. Taking an address from a forum post is riskier
here than elsewhere, because this is writing rather than reading – and because the same
register value addresses a different device depending on the unit ID.
The installation this article refers to consists of a Victron inverter
(MultiPlus-II) with a GX device and Pylontech battery modules. That is the typical
configuration for this route – and the reason the battery plays no part here: it communicates
with the inverter, while what gets controlled is the Victron system.
The Home Assistant dashboard of the system this article refers to: energy flow and state of charge, voltage and power history of the MultiPlus-II and the SmartSolar charge controller, PV forecast, and on the right the charging plan with grid costs. 19 October 2026.
Layering price control on top
A clean implementation has four steps, and the third is the one forgotten first:
Decide whether the spread clears the threshold from the
arbitrage calculation. Without this step the
system cycles even when the cycle costs money.
Set the setpoint – and remember the original value.
Reset after the window, with a timeout as a safeguard in case the automation restarts in
between.
The charging plan of the same system over three days. Top: state of charge against the target; bottom: the electricity price with charge and discharge thresholds. On the evening of 19 October the control sits at “neutral”: buying from the grid does not pay after losses. That is step 2 of the list above.
What goes wrong
Setpoint conflicts. Two automations writing the same setpoint produce a
system that reverses direction every minute. Exactly one place may write.
Grid-parallel operation and export limits. A discharge setpoint beyond the
permitted export leads to curtailment or shutdown – not to more yield.
Backup power. A system with backup functionality needs a reserve. Price
control that empties the battery during the cheap night removes exactly that reserve. The
lower limit belongs in the system as a hard constraint, not in the automation.
Curtailment. The grid operator can limit charging power. If that hits the
planned hour, the cycle does not happen – see
Section 14a in practice.
Interface details come from the manufacturer's documentation. Register lists are versioned – what counts is the version matching the firmware your system runs.
Manufacturer documentationGX Modbus-TCP Manual – Victron EnergyModbus TCP is part of all GX devices and allows both reading from and writing to connected products. The available registers are listed in a manufacturer-maintained spreadsheet (CCGX-Modbus-TCP-register-list.xlsx); unit ID mapping is on its own tab and in the device under Settings → Services → Modbus/TCP → Available services. Checked on 11 September 2026.
Write access to a running energy system intervenes in its control. Check setpoint limits, backup reserve and export conditions before leaving an automation running permanently.
Running a Victron system and want price control layered on cleanly – without two controllers on one actuator?
Write to me – the first conversation is free.