question

paulm avatar image
paulm asked

Venus OS MQTT - A simple way of publishing customised MQTT data with no programming.

Not exactly a question - but I thought someone may find this helpful with utilising the MQTT data available through the Venus MQTT broker.

I've recently installed a small solar PV system using a Victron MPPT charger and Inverter. I've had an MQTT based home monitoring system running for some time and was pleased to see the Venus OS was available for the Raspberry Pi as my home system is all Arduino & Raspberry Pi based. Having installed and set up Venus OS and the MQTT broker I found it very difficult to utilise the myriad of topics and data available, even when adding a topics list to the keepalive message, due to the varying topic formats.

In my relatively simple MQTT structure each data source has an MQTT broker and publishes topics in a fixed format 'Source/DeviceParameter/Data'. A central MQTT broker is 'bridged' with each of the sources, and I use a simple Python script (found online) to accumulate data into an InfluxDB database, which is then displayed using Grafana. The Python script expects the fixed format topics and is where I was struggling to incorporate the Victron data.

The solution turned out to be very simple, without any programming :-) I installed 'Venus OS Large' and enabled MQTT and Node Red. The MQTT broker doesn't publish any data if you never send it a 'keepalive' message. Using Node Red I added Victron Energy nodes for the Charger and Inverter data I wanted and connected each to an 'MQTTout' node set up to publish topics in the simple format I use, direct to the Victron MQTT broker. Voila, the Venus MQTT now broker publishes the data I want, in the format I want, directly into my existing system by doing nothing other than bridging the Venus MQTT broker into my system :-)

Not rocket science, but it has proved a lot easier than modifying my existing system to accomodate the Victron format MQTT data :-)

PaulM


Venus OSMQTT
2 |3000

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

1 Answer
paulm avatar image
paulm answered ·

Found a problem with this :-(

If you reboot the raspberry pi the Victron nodes in NodeRed do not reconnect to the system, even if you edit and re-deploy them. The only solution I found (quickly) was to delete them and insert them again, then they connect when you click deploy.

Reported in a new thread...

PaulM


2 |3000

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