VE.Direct over MQTT

Publish detailed solar statistrics over MQTT for use in services such as HomeAssistant.

VE.Direct over MQTT
Photo by Andreas Gücklhorn / Unsplash

Victron solar charge controllers use their own open-source VE.Direct protocol to send solar data back to their different controllers like the Cerbo GX.

This is in reality a UART bus that we could for example connect to a raspberry pi. I decided to write some code to do just that.

GitHub - metrafonic/asyncio-vedirect-mqtt: Publish serial data from ve.direct to an MQTT broker
Publish serial data from ve.direct to an MQTT broker - metrafonic/asyncio-vedirect-mqtt

The data is published according to the Home Assistant MQTT Discovery specification. This allows the device to be auto-discovered in home assistant.

This implementation listens for VE.Direct text mode messages, which are by default transmitted constantly from all up-to-date victron smartsolar/bluesolar devices. The whitepaper PDF has all the protocol specifications

Connecting your device

The connector used in VE.Direct is a 4-pin JST-PH. If you were to use the one linked to here, then from left to right the green cable is GND, white is RX, red is TX and black is 5V. We only need GND and TX to be connected to the Pi Serial pins (Victron GND to Pi GND, Victron TX to pi RX).

I have this running on a raspberry pi zero, which consumes less than 100mA. The repo contains details on setting it up as a system service.

Let me know what you think!