Pushing Victron solar data over MQTT

Get detailed solar statistics from your victron setup! Publishes data from VE.direct over MQTT to home assistant with automatic discovery.

Pushing Victron solar data over MQTT

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 - GitHub - metrafonic/asyncio-vedirect-mqtt: Publish serial data from ve.direct to an MQTT broker

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).

4 pin JST-PH from adafruit

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!