MQTT Image


Venus MQTT keepalive - how to do this in python script with topic list payload ??

I have a python script to send the 'keepalive' message to the Venus MQTT broker running on a raspberry pi 3 :

import paho.mqtt.client as mqtt     # MQTT support
import time
import json

mqttBroker ="victronpi"                 # define MQTT broker address
client = mqtt.Client("KeepAlive") # identify client
client.connect(mqttBroker)              # connect to broker
print("VictronPi MQTT broker connected...")

while True:
  # send 'keepalive' message
  errcode = client.publish("R/b123abc7d123/keepalive") # publish all topics
#  topics = json.dumps("solarcharger/+/Dc/0/Voltage")
#  errcode = client.publish("R/b123abc7d123/keepalive",topics) # publish selected topics
  print("VictronPi KeepAlive sent : ",errcode)

I'd like to just keep alive the topics I'm interested in. I gather you can do this by including a payload in the 'keepalive' message but I'm struggling with the python syntax to do this, see commented out lines above, which just create a new read topic. Can anyone enlighten me what the correct python syntax to do this is please ?


paulm asked
paulm published ·

1 Answer

Struggling with local access to MQTT data

I have a simple home solar PV system - 2 panels, MPPT 100/20 charger, AGM batteries & Phoenix 24/800 inverter. It's up and running and I've added a Raspberry Pi 3 running Venus OS, connected to the two Victron devices with VE.Direct USB cables. I can connect to the Venus system with a browser and can see the devices data fine. I can connect using the VRM portal and can also see the devices data fine.

I've enabled the Venus MQTT broker for SSL and PlainText and can connect to it from MQTT Explorer but all I see is the following :


I know there is a 'keepalive' requirement I've seen discussed in the forums, but as I understand it the Venus MQTT broker is enabled when accessed from the VRM portal and should be accessible from the LAN when that happens.

My problem at present is I cannot see any data from the two victron devices in MQTT Explorer. I assume I've missed something, but trawled the forums for a while and cannot see what it is ??

My aim is to bridge the central MQTT broker in my existing home automation system to the Venus MQTT broker so I can add the Victron data into my home automation database (InfluxDB) and display it, along with other data, using Grafana.

I've spent hours reading forums posts etc. but cannot see where I've gone wrong. It would be much appreciated if someone could give some guidance as to how I can achieve my aim of adding the Venus MQTT data into my existing home automation system, with the 'keepalive' function and without using the VRM portal. I have no need to se the VRM portal as I have already have VPN access to my existing system, so will be able to see the PV data when added into the system.



paulm asked
paulm answered ·

1 Answer

MQTT change MaxChargeCurrent not working on multiplus after I connected bluesolar MPPT


I have a problem, which appeared after I connected bluesolar charger to my battery. Before there was only multiplus II and when I changed DC charge current, it was working properly. MQTT topic is venus-home/N/xxxxxxxxxxx/vebus/289/Dc/0/MaxChargeCurrent (of course I'm using W instead of N to change values).

Problem appeared, when I connected bluesolar to the system. Now when I change the MaxChargeCurrent value, it's working, but a few seconds later it change back to 35A.

I'd like to control charging current of the multiplus, not whole system, so that the bluesolar is charging full power and multiplus is controlled by MQTT. But since I connected bluesolar it's not working. Is it a bug or am I missed something? (sorry for my english :/ )

supiiik asked
supiiik answered ·

1 Answer

Getting started with MQTT, some beginner questions

Hi all
I've just finished the installation of an ESS system to improve my autoconsumption here in Belgium.
I would like to add the information of the battery transfers and state to my home made PV monitoring system.

My current idea is to use MQTT to (locally, port 18883) read values at a relatively slow rate (once per 5 min). I'm mostly interested in battery state and the energy to and from batteries. Then write that to a file and FTP it to a website.

To be honest I'm new to MQTT (but I should be able to manage :) ) , is there a beginner's guide somewhere?

Today I tried MQTT explorer to browse through the available values. I could find what I was needing.
But one thing that I already see is that using the explorer the MQTT is refreshed only when I use the VRM. I guess that has something to do with the keep alive or so?
How will that be when I have the client running on my Pi connecting?


jeanphi500 asked
Manda answered ·

1 Answer

Disable inverter in a ESS system


I have a Multiplus II, Cerbo GX, Victron MPPT and a Fronius inverter. The fronius is on AC IN. The system works fine. When there is sun MPPT charges the battery together with the Multiplus II from the energy produced by Fornius as long as the house load is covered first.

My electricity price is variable and changes every hour, i have made some automation in Nodered to start charging EV when the electricity is at it's lowest BUT i don't want to use the battery for charging the EV since i want to buy from the grid. I want to keep the battery when the energy is expensive.

I have access to Modbus and MQTT so i am looking for suggestion what i should do in case i don't want to discharge from battery. I tried the Switch mode from Modbus 33 to set to Charger only and that works since the MPPT can continue to charge battery while i buy from grid but the question is, is that the correct way to do it ? There are also Hub4/DisableFeedIn but the name doesn't sound correct because i want DisableDischarge. Maybe setting the gridpoint could do this ?


peternielsen asked
peternielsen commented ·

3 Answers

MultiPlus 24/500/10 als USV mit AC Solarstrom und MQTT

Hallo Community,

ich habe ein paar Fragen zum MultiPlus 24/500/10, hierfür habe ich leider in der Anleitung nicht viel finden können.

  • Kann das Gerät, wie der MultiPlus II, mit LiFePo4 betrieben werden (Spannungsbereich) und das BMS via CAN Bus über das Cerbo GX angeschlossen werden?
  • Kann der Ladestrom für die Batterie über das Cerbo GX mit hilfe von MQTT gesteuert werden? In der Cerbo GX Anleitung findet sich dabei der Hinweis "Ermöglicht MQTT im LAN - Weitere Informationen über MQTT sind auf Victron Community verfügbar."

Ich möchte eine alte USV ersetzen. Wenn möglich soll das neue System die Servertechnik weitesgehend mit Solarstrom versorgen. Die PV Anlage und auch ein Zähler in der Verteilung ist bereits vorhanden. auch die Daten der PV Anlage und vom Modbuszähler sind über ioBroker und NodeRed verfügbar. Eine Steuerung über MQTT ist mit der bestehenden Technik mit wehnig Aufwand möglich. Ein vereinfachtes Shema meiner vorstellung im Anhang.




cschepelmann asked

0 Answers

MQTT-PRC broker error #15


Where I can find an explanation of MQTT-RPC broker error #15?

When trying to connect to my smart devices (2 MPPTs and 1 SmartShunt) I am getting this massage:


Does anyone know what to do with it?

Best Regards.

marekp asked
marekp answered ·

3 Answers

Only discharge battery when grid power is above certain threshold

Starting this year, our peak usage will be monitored and taxed. In the summer, PV can recharge the batteries fully and there is no issue. However, in the winter, the batteries do not get fully charged and I would like to configure them so they are only used when peak usage is detected.

What I would like to do is to have the battery only discharge when power usage is above a certain threshold, let's say 2000 Watts.

By manipulating the AcPowerSetPoint (grid setpoint) via MQTT I can create something close to what I want.

I set the grid setpoint at 2000 watts and the battery will only discharge if usage is over 2000 watts. However, this also means that if the usage is less than 2000 watts, it will charge the battery. This is not what I want.

I can continuously monitor the usage and adapt the grid setpoint, but if that process fails, it could mean the battery fully charges, which is not supposed to happen and could be costly.

Is this my best option or are there other ways of implementing this?

peterb asked
peterb commented ·

1 Answer

MQTT Topic Disappeared (N/XXX/solarcharger/YYY/Pv/I)

I don't seem to have the I topic available from my CerboGX.

MPPT Current Value.

Happened in last month and I didn't notice on my NR dashboard.



Mark Maritz asked

0 Answers

Where are the Energy in and out Counter for Battery ? (Pylontech BMS -> GX -> MQTT)


where can i find the Energy in and out counter for the Battery.
(mean's from Battery in kWh and to Battery in kWh)

I can see them on VRM Portal :



but they are not on MQTT Tree ...

i need them to determine some forecastcalulation ....

yvl asked
steffen-graap answered ·

3 Answers

Expected traffic to the mqtt{1 to 128} server farm?

I am running Venus-large and have a fairly extensive Node-Red flow consisting of about 100 nodes. My router is reporting a permanent TCP/IP session with one of the mqtt{1 to 128} servers with constant traffic of just over 10 kbit/s upload and just under 1 kbit/s download. This seems high to me but maybe it's because of my 100-node flow. Is this level of traffic to be expected?

paulcooper asked
paulcooper answered ·

1 Answer

Venus RPi Cloud Broker

I have enabled MQTT on a Venus Raspberry Pi install. Access to the local broker works.

However, can't get any data (not even the serial) from the cloud broker (in my case

When I look at the dbus-mqtt log, I see a connection with the local broker being established, but nothing on the cloud broker.

I am running 2.80-25. Is there anything else I need to do to enable cloud mqtt access?



metro asked

0 Answers

VenusGX mqtt unstable after 2.72 firmware upgrade.

After upgrading the firmware of my Venus GX to version 2.72 I am having issues with it not continuously publishing to the mqtt broker.
When I connect a client to the broker in the GX I receive the subscribed messages for about a minute after which an empty message is received and no more messages are received until about 1 minute or 2 later. This just keeps on repeating.
I suspect there is a timeout issue or it somehow does not get the keep-alive messages.

I was unable to find a change-log for 2.70 to 2.72.
I would also rather not roll back but I also cant seem to find a way to even roll back the firmware.

After creating a profesional account I am able to access the changelog. Though that did not really explain why mqtt is misbehaving in 2.72.
It did however point out how to roll back so I rolled back to 2.66 which resolved the mqtt issues.

However that may cause me to be unable to configure my EM24 ethernet as that was not yet added in 2.66.

rwarps asked
mvader (Victron Energy) answered ·

2 Answers

External energy meter and grid set point


I am not sure i understand, if i set the grid set point to 50W then i set the Energy Meter to external what happens then ? If i set the grid set point using dBus or MQTT then i need to make the phase calculation myself as described in the ESS manual ? Is that what ESS does when it has energy meter itself, it sets the grid setpoint dynamically based on the loads on the phases that it's told or am i misunderstanding ?


peternielsen asked
peternielsen commented ·

1 Answer

Adding a additonal SmartShunt .. will it show in the Raspberrypi


I am looking to gather the data in my Home Assistant Dashboard for the Orion-TR smart 12-12 30AD c-DC I know that the data is fed with the Bluetooth but Victron don't give us the possibility to connect to I was thinking adding an additional Shut at the output of the DC-DC with the Ve-cable

- It this feasible?

- Will it disturb the overall electrical system?

- If yes, will the additional shut be displayed on the RaspberryPI 7 inch screen?

- If yes, will it be possible the get the information via the MQQT mapping


fenix asked
Stefanie commented ·

1 Answer

145 Posts
112 Users

Topic Experts

71 Points
Rob Howdle
0 Points
0 Points