Home Assistant integration for Victron inverters using the MK3 USB interface

TL;DR: I have developed an integration for Home Assistant to talk to Victron inverters / chargers using the Victron MK3 USB interface.

Source code and documentation: GitHub - j9brown/victron-mk3-hacs

Why make a new Victron integration for Home Assistant?

There are already a few integrations for monitoring Victron devices from Home Assistant and they each rely on different interfaces and have different capabilities.

Until recently, I used a Victron VE.Bus Smart Dongle to monitor my Victron Multiplus II over Bluetooth LE and I controlled the device state using an optocoupler wired to the remote on/off terminal. It worked well but I could only switch the device on or off and I wanted to programmatically switch it between on and charger-only instead.

It turns out the Victron MK3 USB interface can set the operating mode and current limit programmatically, thereby achieving my goal of toggling charger-only mode. It also exposes a little more detail about the device’s behavior such as the AC input and output voltages and frequency which is nice. I’m not aware of any existing Home Assistant integrations for the Victron MK3 USB interface so I just wrote one. :smiley:

I hope you find this new integration useful and I welcome your feedback!
Jeff.

4 Likes

Hi, i have HAos on RPi4. I have an MK3 and an SSD drive connected to the USB port on the RPi. Everything works fine, but only for about 3-4 hours. Then the RPi freezes.
Neither a powered USB hub nor reducing the polling to 5 seconds helps.
What am I doing wrong? Thanks. Fitor

When you say the RPi4 freezes up, do you mean it becomes completely unresponsive (and needs to be reset)? If so, I would guess the root cause is unrelated to the Victron MK3. After all, the MK3 just looks like a serial port to the RPi4. I think the MK3 is galvanically isolated too.

It could be that your RPi4 power supply isn’t capable of supplying enough current and sometimes that results in a low voltage brownout. You could try using different power supplies to see if that helps.

It could be that your USB SSD experiences some kind of hiccup when other USB devices are active on the bus. If file I/O requests started failing then that might look like a hang.

Ultimately, I think you’ll need to extract kernel logs from the device to figure out what’s going on.

Perhaps you could try upgrading the RPi4 firmware or the kernel in case it’s a weird software glitch.

Anyhow, I hope you can figure it out!