question

paul-lebeau avatar image
paul-lebeau asked

Remote control of inverters

Hi

I am part of a project to manage a cluster of PV/inverter/battery installations at various premises from a cloud-based application. This has already started with devices from several other manufacturers, but we would like to add a user who has a Victron system.

The aim is to:

  1. Get live meter data, and persist to a (remote ie. cloud) database
  2. Send control signals (ie. grid set point) to the inverter based on a rules engine.

AFAICS, the recommended method for #1, is to use MQTT, which is fine with us.

However, I have been trying to work out how to achieve #2. I have spent quite some time going through the documentation on this site, and various external resources. But I haven't yet found anything that indicates how to do this with Victron devices. I presume Victron has an API for this, like all other manufacturers, but I have not found it yet.

Can someone point me at the right direction, please?

The first test device we have access to is a Victron Energy Multiplus II 48/8000

Thanks very much in advance

Paul


multiple inverters
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

tb-pb avatar image tb-pb commented ·
Hi Paul,

I have exactly the same problem. I am not a professional programmer but i can use python to ducttape together most things. Did you find a working solution yet? Would love to hear it. I was also thinking about nodered and then fetching data from there, but it doesn't feel elegant. Would love to hear your progress!


0 Likes 0 ·
4 Answers
matt1309 avatar image
matt1309 answered ·

Hi @Paul LeBeau


You'll need a gx device or a multiplus GX model (for one built in). I find victron far more open that other providers so you've got a fair few more options for integrating these system.

GX devices can run node red so you could just forward the data in whatever format you want directly to you database by writing it in node red might be nice/quick solution to add lots of them in future ie just import prewritten node red code and it'll add to your system.

You could write a custom python driver installed on gx device to forward data directly from dbus (bit more involved), more details of which can be found on venus os github wiki.

The other option like you mentioned (probably easiest) is send the local MQTT data to whatever database you have.

If you want live/granular data I would install something locally or even on the GX device to forward the MQTT data if that's an option. GX devices run embedded linux (and allows root ssh access) so you can install pretty much anything (opkg package manager is preinstalled).


Here's documentation on how to access the MQTT and the topic structures:

GitHub - victronenergy/dbus-mqtt: Venus OS service mapping the D-Bus on Venus OS to MQTT

I also find the dbus paths useful for identifying the topics:

dbus · victronenergy/venus Wiki · GitHub


However you could also get the data via victron cloud (vrm) this might not be granular enough for your use case but here's the info just in case.

VRM API documentation (victronenergy.com)


EDIT: victron also supports ModbusTCP is that's preferred over MQTT.

EDIT2: i think there is remote access to MQTT externally via MQTT broker also. I'm not so familiar with this:

MQTT local & via MQTT broker - Victron Community (victronenergy.com)

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

matt1309 avatar image matt1309 commented ·

Hi @Paul LeBeau


Mqtt, modbus definitley allow writing settings use W/ topic. Not N/

I dont use vrm api so can't comment if that's possible.

Modbus tcp registers file also tell you which are writable. These will be the same in mqtt.

This can be found on victron manuals section.

https://www.victronenergy.com/upload/documents/CCGX-Modbus-TCP-register-list-3.10.xlsx


Benefit of victron is data isn't gated by cloud services. Systems will still work and data still accessible even if victron cloud goes down.

Some settings are not writable ie veconfigure settings via mqtt they will require remote configure. However I suspect these aren't settings you'll not want to be dynamically editing ie battery chemistry/cut off and sustain voltages etc.


Happy to give mqtt topic examples if you've got a list of data/required controls.

0 Likes 0 ·
paul-lebeau avatar image
paul-lebeau answered ·

Hi @matt1309

Thanks for the detailed answer. Much appreciated

However I don't see anything there that will allow us to send control signals to the inverter from outside the customer's local network.

We've connected inverters from six other manufacturers to our system. They all supply a REST API that allows us to get meter data and send control signals (such as charge/discharge). Victron has multiple interfaces (VRM API, MQTT, Modbus-TCP), but they all seem to be one-way only - out (AFAICS).

Is there something I'm missing? Does Victron simply not allow this?

The only possible solution I have come up with, is to use an HTTP Endpoint node in Node-RED. But that seems like a complicated solution.

Does anyone have an alternate suggestion?

Cheers

Paul

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

paul-lebeau avatar image
paul-lebeau answered ·

Ok. Thanks Matt. That's useful. So it looks like I'll need to get on the end customer's local network somehow (eg VPN) and send modbus packets to their GX device (?)

Does that sound right?


> Happy to give mqtt topic examples if you've got a list of data/required controls

We'll need basic info like charge/discharge rate, battery SOC, etc


Thanks for your help so far.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

matt1309 avatar image
matt1309 answered ·

That method will work.

If you dont want to setup/install VPN then could use externally accessible MQTT that is used to send data to VRM (victron's cloud). No need to install anything extra in client networks then.

This post seems to give a good guide on getting MQTT address in python.

MQTT local & via MQTT broker - Victron Community (victronenergy.com)

For getting data VRM API can probably get that data. I've never used it so not sure if it allows as much control as direct MQTT will though.


The other option is rather than periodically querying API's you could get node red on the gx devices to live send the data to your servers/endpoints.


The MQTT topics follow same structure as dbus paths:

dbus · victronenergy/venus Wiki · GitHub

Just need to prefix them with W (write) or N and VRM ID. That's all explained here though:

GitHub - victronenergy/dbus-mqtt: Venus OS service mapping the D-Bus on Venus OS to MQTT



2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic