## Controlling Relay 0 and Relay 1 (Open Collector) from Node-RED on EasySolar II

by Downs Wanderer · 1 month ago 32 views 4 replies
Downs Wanderer
Downs Wanderer
Active Member
13 posts
thumb_up 10 likes
Joined Apr 2024
1 month ago
#17794

Been down this rabbit hole recently with my garden office setup and figured others might be wrestling with the same thing.

Got an EasySolar II running the office and I want to use Node-RED to directly toggle Relay 0 and the open collector (K1) based on my own logic — things like switching a small immersion when the batteries hit a certain SOC, rather than faffing about with VEConf every time I want to tweak thresholds.

The Venus OS side of things is fairly well documented for reading data, but actually writing to the relays via MQTT feels murkier. From what I've pieced together:

  • Relay 0 maps to com.victronenergy.system on the D-Bus
  • You write to it via the MQTT W/ prefix rather than R/
  • K1 (open collector) is a separate path entirely

Anyone actually got this working reliably in Node-RED? Specifically curious whether there's a timing/race condition issue if Venus OS itself is also trying to control the relay state — say if you've got a generator autostart condition still active.

My Fogstar Drift 200Ah cells are sitting behind a Victron SmartShunt so the SOC data is solid, it's just the output side I'm struggling to get clean.

Would be good to hear from anyone who's done something similar — especially if you've built any kind of Node-RED dashboard around it. Wondering if this is better handled through the dbus-mqtt approach or going straight at the D-Bus with a Python script that Node-RED just triggers.

Ray Powell
Ray Powell
Active Member
16 posts
thumb_up 1 likes
Joined Jan 2025
1 month ago
#17824

@DownsWanderer nice timing on this post — been through exactly this on my van build last winter.

The key thing that tripped me up: those open collector outputs on the EasySolar II are controlled via the GX device's modbus TCP registers, not through the Venus OS Node-RED MQTT topics that most guides point you towards.

You want modbus register 800 (Relay 0) and 801 (Relay 1) on the com.victronenergy.system service. Write 1 to close, 0 to open.

In Node-RED use the node-red-contrib-modbus palette — set your EasySolar's IP, port 502, unit ID 100.

One gotcha: make sure Modbus TCP is actually enabled in the Venus OS remote console under Settings > Services, it's off by default.

Tested this running Victron Venus OS 3.x — works reliably for switching a small immersion heater element.

Curly38
Curly38
Active Member
20 posts
thumb_up 7 likes
Joined Apr 2024
1 month ago
#17829

Good thread this. Spent a miserable weekend last autumn getting this working on my cabin setup so here's what actually helped me:

The open collector outputs sink to ground — easy to forget when you're wiring up. Caught me out first time, had the relay backwards and couldn't figure out why nothing was switching.

In Node-RED, you're talking to the MQTT broker via the Victron Venus OS. The relevant topics are roughly:

W/[vrm-id]/system/0/Relay/0/State

Write a 1 or 0 to switch. Dead simple once you've found the right path.

Worth installing Signal K or at minimum poking around Venus OS with SSH first to confirm your relay paths — they can vary slightly depending on firmware version.

Also double-check your EasySolar II firmware is reasonably current. Older versions had quirks with relay MQTT writability that'll drive you absolutely mental.

Wez Fisher
Wez Fisher
Active Member
22 posts
thumb_up 15 likes
Joined Jul 2023
1 month ago
#17859

Worth adding one thing I haven't seen mentioned yet — the open collector relay on the EasySolar II is not isolated. Learned that the hard way on my narrowboat when I fried a relay module assuming it shared no common ground with the rest of the circuit. It absolutely does.

So before you start firing MQTT commands from Node-RED thinking you're safely switching something external, check what that relay is actually referenced to. On my setup I now run everything through an optocoupler board between the Cerbo and any external 12V circuit.

@DownsWanderer also worth double-checking your Venus OS version — the dbus paths for relay control shifted slightly around 2.90 and some older Node-RED flows on forums just silently fail without throwing any obvious error, which costs you an afternoon of head-scratching.

Anne Oliver
Anne Oliver
Active Member
22 posts
thumb_up 12 likes
Joined Dec 2023
1 month ago
#17919

Really useful thread, glad it came up. Quick question for anyone who's got this working — when you write to the relay via Node-RED, are you doing it through the MQTT broker on the CCGX/Cerbo, or going direct via the Modbus TCP path?

I've got a similar garden office setup and I'm also trying to use Relay 0 to switch a contactor for EV charging (nothing massive, just a small overnight top-up circuit). Wondering whether there's any latency difference between the two approaches that might matter for that use case.

Also @WezFisher — good shout on the isolation point, that's exactly the kind of thing that bites you when you're rushing. Did you end up putting an optocoupler in line, or just a small relay board to get proper isolation?

Log in to join the discussion.

Log In to Reply