Node-red and EVCS modbus TCP

Hi guys.

I have a victron ev charger and node-red on a PC. Nothing more. (no other victron items etc)

I want to use modbus tcp in node-red to control the charger amps based on info I have coming in on node-red from the import/export.

But I currently can’t seem to get any data from the EVCS on modbus into Node-red.

In nod-red when I try to read on the modbus-tcp, I have FC set to 4, unit-id 1, address 5010, quantity 1.

this gives an error: “Error: Data length error, expected 7 got 5”

Any ideas as to where I am going wrong?

Advise use Mqtt instead off modbus.

Send this info to the Mqtt out node via function node :

let Site = VRM number from your installation ;

let Current = Current value you want;

msg.topic = “W/” + Site + “/evcharger/40/SetCurrent”;

msg.payload = {“value”: Current}

Thanks for the reply. I don’t understand.

I have 1 victron device, the EVCS, no other victron hardware.

How does the EVCS communicate to MQTT as it won’t know the server address…

Hi @cqw .
Modbus function 4 is Read Input Registers.
The EVCS contains only Holding Registers.
Please try Modbus function 3 (Read Holding Registers) — it should work.

P.S. I think @Sdb is referring to the GX device. The EVCS does not contain an MQTT broker. This is only possible if you have a GX device in your system. Through the MQTT broker on the GX, you can control the EVCS also.

Many thanks, that sorted it.

but there must be some sort of bug in node-red, using a modbus flex getter, I have to injet via a function node, not via the inject node directly(as that causes an error)

Anyway it works.

Is it fc 6 to alter the max charge current value, that’s what I need to work on next.

Regards

Just looking at the modbus xls table:

I’m controlling the charging current via node-red using register 5016 ‘charging current’

what is 5129 ‘charging current limit external’ for ?