Skip to content

Victron: add Multi RS battery template (per-inverter minimum SoC) - #35802

Closed
ChrisKoh83 wants to merge 2 commits into
evcc-io:masterfrom
ChrisKoh83:victron-multi-rs
Closed

ChrisKoh83 wants to merge 2 commits into
evcc-io:masterfrom
ChrisKoh83:victron-multi-rs

Conversation

@ChrisKoh83

@ChrisKoh83 ChrisKoh83 commented Nov 4, 2026 •

Copy link
Copy Markdown

Branch: victron-multi-rs
File: templates/definition/meter/victron-multi-rs.yaml (new)
Related issue: #34550


Problem

On a Victron Multi RS installation the ESS is managed by the inverters, not by the GX.
/Settings/CGwacs/BatteryLife/MinimumSocLimit (register 2901), which the victron-energy
template writes for BatteryHold, therefore has no effect: the operative minimum SoC lives in
each com.victronenergy.multi service (/Settings/Ess/MinimumSocLimit, register 4614) and is
mirrored read-only as com.victronenergy.acsystem /Ess/ActiveSocLimit (register 4925).

Result: the discharge lock ("Entladung der Hausbatterie im Schnell-Modus und bei geplantem Laden
verhindern") does not hold the battery; it keeps discharging during fast charging (measured up to
4.8 kW while the car charged at 11 kW).

Change

New template victron-multi-rs (class meter, usage battery) that

  • reads power and SoC from the GX system service (register 842/843, unit 100) as before,
  • writes the minimum SoC to every configured Multi RS via
    /Settings/Ess/MinimumSocLimit (register 4614, writesingle, one unit id per inverter),
    implemented as a Modbus sequence inside limitsoc,

so the existing battery-control logic in meter/usage_battery.go (normal → minSoc,
hold → max(SoC, minSoc), charge → maxSoc) works on Multi RS systems without a custom device.

New parameter units – comma separated Modbus unit ids of the Multi RS units (GX device list).

meters:
  - name: battery
    type: template
    template: victron-multi-rs
    usage: battery
    modbus: tcpip
    host: 192.168.0.80
    port: 502
    units: 0,1,2
    capacity: 10
    minsoc: 10
    maxsoc: 100

Tested on real hardware

Installation: Ekrano/Cerbo GX + 3 × Multi RS 48/6000/100 (3-phase), Pytes 10 kWh,
evcc 0.318.2. Template loaded with evcc meter --template … --template-type meter:

Power:          3504W                 27ms
Soc:            71%                   1ms
Capacity:       10.0kWh
Min soc:        10%
Max soc:        100%
Controllable:   true
Battery modes:  [normal hold charge]

Battery mode normal with minsoc: 17 produced exactly three writes (trace):

[pytes] TRACE modbus: send 00 01 00 00 00 06 00 06 12 06 00 11   # unit 0, FC06, 0x1206 = 4614, 17
[pytes] TRACE modbus: send 00 02 00 00 00 06 01 06 12 06 00 11   # unit 1
[pytes] TRACE modbus: send 00 03 00 00 00 06 02 06 12 06 00 11   # unit 2

Read-back: 4614 = 17/17/17, acsystem /Ess/ActiveSocLimit (4925) = 17 (follows within ~20 s).
Setting normal with minsoc: 10 wrote 0x000a to all three and restored 4614 = 10/10/10,
4925 = 10 — i.e. the hold/release semantics of evcc map 1:1 onto the registers the inverter obeys.

Notes / limitations

  • The template only covers usage: battery; grid/PV keep using victron-energy.
  • Multi RS unit ids must be configured; they are not auto-discovered (the GX device list shows them).
  • acsystem has no writable minimum SoC, hence the per-unit writes.
  • Tested with 3 units; a single-unit installation works with units: 0.

Why a separate template

victron-energy intentionally targets the GX/Hub-4 world (2901) and works for VE.Bus systems.
A device-family detection inside that template would silently change behaviour for existing
installations, so a separate template keeps both worlds intact (see also issue discussion where
this was classified as a device-specific enhancement).


On Multi RS installations the ESS is managed by the inverters, so writing /Settings/CGwacs/BatteryLife/MinimumSocLimit (register 2901) on the GX has no effect. Write /Settings/Ess/MinimumSocLimit (register 4614) on every com.victronenergy.multi unit instead, keeping evcc's existing battery control modes (normal/hold/charge) working on these systems.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="templates/definition/meter/victron-multi-rs.yaml" line_range="58-66" />
<code_context>
+    set:
+      source: sequence
+      set:
+      {{- range splitList "," (.units | unquote) }}
+      - source: modbus
+        {{- include "modbus-connection" $ | indent 6 }}
+        id: {{ . | trim }}
+        register:
+          address: 4614 # /Settings/Ess/MinimumSocLimit
+          type: writesingle
+          decode: uint16
+      {{- end }}
+  {{- include "battery-params" . }}
+  {{- end }}
</code_context>
<issue_to_address>
**Battery limits diverge after write failure**

When a Modbus write fails after an earlier unit accepted the new limit, the sequence setter stops at the first Modbus error without rolling back earlier writes or updating later units, so the inverters enforce different minimum-SoC limits and some can keep discharging during a hold.

Attempt writes for every configured unit and report partial failures so each reachable inverter receives the requested limit.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@github-actions github-actions Bot added the stale Outdated and ready to close label Nov 11, 2026
@github-actions github-actions Bot closed this Nov 17, 2026
@ChrisKoh83

ChrisKoh83 commented Nov 19, 2026 •

Copy link
Copy Markdown
Author

Update: reopening is not possible here (GitHub requires write access to the repository for that), so the change continues in #36407 — same branch, including @andig's Templates: explicit modbus id commit (b6f8dd9).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support stale Outdated and ready to close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants