my intension is to control the power output of my new MultiPlus II.
I have a Venus running with 7 SmartSolar chargers, a SmartShunt (all via VE.direct) and JK BMS via CAN connected.
I have (4) different Python scripts, reading my ‘smart’ power meter, controlling my Lumentree already (zero feedin, surplus feedin in case), controlling the heating of my domestic hot water from PV and interacting with my gas heater, and controlling the charging of the accu (80% limitation during summer).
my questions:
what is the best way to command the power output of the MultiPlus (by my script system)?
Should I connect it to Venus and will there be a MQTT topic to write the setpoint? Or what would be the way to command? (connecting the MPII to Venus would be my preference, but someone told that I would have to send command via Modbus to Venus what would mean beating arround the bush requiring superfluous hardware connection…)
Or should I better ‘directly’ connect it the MPII to my Raspi and send ‘serial’ commands? Will it be Modbus or what protocol is used on the VE.bus?
What ist the VE.bus connection pysically?
is it RS485? is the ‘V+’ a source (used to power an adapter) or sink (to power the comm chips inside MPII (because in some schematics it is called ‘VIN’))?
do I need to opto-isolate or is the VE.bus ‘decoupled’ inside the MPII?
sorry for my (perhaps ‘stupid’) question, but I have already several pdfs regarding communication with the inverters, but it is some kind of information overkill since I haven’t found the ‘general strategy’ up to now…
If you already have a device with Venus OS, then I would also connect the MP2 with that device.
That way the MP2 will appear on the Venus dbus, you’ll have there a lot of info about MP2 and also the ability to send commands to MP2 through the dbus.
Not to mention that the MP2 will be present on the same device where you already have the scripts, which is an advantage, right?
Yes, it’s a RS485 bus.
V+ is probably some kind of “power over the network”, most likely for powering eventual optoisolated devices.
Always is better to have optoisolated communication.
@Philippoo I guess it depends if you want to simply turn the Multiplus on and off or if you want to directly control some other aspect of the multiplus programming. If you want to simply turn it on and off you could use relay contact closure connected to the remote control connector.
@Yachtbird it is not simply turn on/off but mainly commanding the power output / setpoint. My system is operating the Lumentree in a marvellous way, but it all alone is ‘a little’ week. So the calculated setpoint value will go 1/4 to Lumentree, 3/4 to MP2, and almost 4kW will last for the washing machine + base load + some extra.
@alexpescaru so do I understand right that pure setpoint control is possible via setting dbus ‘variables’? If so I would be glad since as I learned the dbus ‘variables’ are accessible via MQTT as well. And for sure it would be great to have all the info available that way…
The MK3-USB VE.Bus adapter is an isolated RS485 adapter? Or is there any further ‘intelligence’ inside the little box?
ps. the scripts run on two other Raspis than the Venus. I was told that the Venus OS is not too suitable to run other than Venus related tasks… Aside the Venus Raspi 3 there is a Raspi 4 operating the power control, Lumetree communication and charge control and ioBroker and influxDB and garfana server and … and downstairs in the basement there is a third Raspi (2) to do Optolink communication to the Viessmann system and switching this to MQTT and TCP/IP and doing the hot water stuff (mainly switching relais and reading 1-wire temp sensors and some MQTT).
so I can not directly access the Venus dbus system but since flashmq this seems to be no problem anymore…
If your system is setup in ESS mode, then you can just control the grid set point via modbus. This is the approach I took with my home automation system (Loxone).
This lets you easily implement modes such as:
force discharge (set point to -4400, or whatever is appropriate for your inverter size)
Grid pass through (set point to the same as your consumption figure)
Export excess solar but don’t charge battery (set point to the same as solar minus loads)
I’m not using this as much now as I’m playing with DESS now that it supports the UK, but these have been very useful to optimise my usage with dynamic energy tariffs.
If you connect the MP2 to Venus OS, then, as long as on that Venus OS you have a dbus where you have all things about all Victron devices, why complicate yourself with MQTT and not directly access, locally, through your scripts, the dbus variables/parameters using dbus utilities?
And yes, you can directly access the setpoint by accessing the corresponding dbus variable.
Indeed, when you want to access the Victron “universe” from outside world, then yes, use MQTT, Modbus, etc.
But when you have all locally, on the same machine, use local utilities.
as I said - the scripts run on a different Raspi than the Venus. I found the dbus config file for local area network access, but there is a huge warning not to open dbus. worst case I will do buut since MQTT is working fine already this would be my perference.
My question regarding the MK3 adapter was if there is ‘intelligence’ inside, which means more than the usb2serial chip? In other words: Can I use a simple isolated rs485 usb adapter to connect the MPII via VE.bus to the Venus? Or must I buy an official MK3toUSB?
@BenH my intention was to avoid an additional serial / Modbus connection to the Venus. I have enough bus wires already and each claims for isolation. also it is much easier to simply write a value to a dbus or MQTT ‘variable’ than to implement an additional modbus communication / protocol…
@alexpescaru I was always told that the Venus OS is not meant to run other than Venus related tasks. You always talk of doing so - what kind of (control) prorgrams do you run aside Venus on the same machine?
@Philippoo, the modbus connection is modbus-tcp. So it’s done over the lan connection, no additional wires were needed. My home automation software had modbus functionality, so this was the easiest way to interface for me.
You said the above. So you have a Cerbo-like device running. On that device, also connect the MP2.
Then inside its OS, using Node-Red or Python scripts (like Victron) or command prompt utilities, command the MP2.
I didn’t saw an MK3 adapter open in order to say for sure if it has other intelligence than the RS485 converter chip. I’ve just told/confirmed you that’s an RS485 comm by looking at the same schematic from where you took that connector.
You said you have 7 devices connected through VE.Direct interface. Just open one MK3 and post a hi-res picture here to draw a conclusion.
oh, I missed that - thank you! So this might get taken into consideration. May I ask you for the code snippet that controls/sets the power output to grid? What settings are required to make it working?
I have Home Assistant running. I considered to do the control there but stopped to continue when I tried utilizing serial interface (horrible with HA) to do the communication with the Lumentree and read my smart meter. No Lumentree plugin, the smartmeter plugins do not work with the eBZ interface I utilized. Also my control loop is quite complex, several hundreds of lines py code. javascript is far less ‘comfortable’ than python and it would take several hours or days to port it.
@alexpescaru as soon as I will have a MK3toUSB, there will be no need anymore to find out if I could have used a common RS485 adapter I will try with a std RS485 and if it will not work, it is almost sure that there is ‘intelligence’ inside the MK3 box and I will have to get me one…
My system users a visual programming language, so unfortunately I don’t have code I can share. The way it works is pretty simple though. It basically connects to the MP2 via modbus and sets the register relating to the ESS set point. The benefit of this approach is that the system will still balance everything, so you don’t have to worry about charge rates, loads etc.
I tried with a standard RS485 interface. TX RX LEDs are flashing but no connection to Venus (at least the MP2 does not appear in the device list) and apparently no connection to VEConfigure.
I read a little further and to me it looks as if the VE.Bus Protocol is a special ‘multi-point’ protocol also to ‘sync’ inverters in a complex system (3 phase etc.). The MK2/3 is a diffenrent protocol, point-to-point.
So my conclusion: the MK3toUSB box does contain ‘intelligence’. No way to control the MP2 output to grid ‘remotely’ without the Victron adapter (or alternatively CX device with built-in VE.Bus interface).
fu…, why haven’t I simply bought another chinese inverter!? With the Lumentree it was a 10 minutes job to control the output via my scripts using a 5€ RS232/USB adapter…
@alexpescaru do I understand right that I can run my Py scripts or even Node-Red on the Venus OS?!? Home Assistant also possible? What are the restrictions? (aside possibly computing resources?) How about utilising hardware as e.g. UART or GPIO? What about installing extensions like phao-mqtt etc?
Which library to use with Py scripts ‘inside’ Venus OS to access dbus? Is it already present on Venus?
What command prompt options are available to control the MP2? (docu link?)
Node Red is part of the Venus OS large.
Victron Py scripts are on the /opt/victronenergy folder inside Venus OS, accessible via SSH.
Many of them, info and example scripts are on the Victron Github repositories.
Also on Venus OS wiki on dbus here and here.