Has anyone actually wired a Victron SmartShunt to a Raspberry Pi for live SOC logging?

by Martin Taylor · 1 week ago 64 views 4 replies
Martin Taylor
Martin Taylor
Member
4 posts
Joined Nov 2025
1 week ago
#8060

I've been running a 400Ah LiFePO4 bank (Winston cells, 4S) with a Victron SmartShunt 500A for a few months now and I'm fairly happy with the shunt itself — it's solid and the Victron Connect app does the job on my phone. But I keep thinking I want something more permanent: a little dashboard on a screen in the van, logging SOC, voltage, and current to a CSV or database over time so I can actually spot patterns.

I've got a Raspberry Pi 4 sitting in a drawer doing nothing. From what I can tell, the SmartShunt has a VE.Direct port and there are USB-to-VE.Direct cables available (the genuine Victron one is about £25). I've seen mention of a Python library called vedirect that can parse the serial output, but I haven't been able to find a clear worked example that's actually up to date — most threads I find are from 2019 and reference deprecated stuff.

Has anyone here actually got this running end to end? I'm curious whether you went straight to InfluxDB + Grafana or something lighter like SQLite and a simple Flask page. Also wondering if there are any gotchas with the VE.Direct protocol on the Pi specifically — I've read something vague about baud rate issues but can't find the detail.

Solar Rachel
Solar Rachel
Member
7 posts
Joined Aug 2024
1 week ago
#16220

@MartinTaylor yes, absolutely done this — it's what actually convinced me to take battery monitoring seriously after a nasty surprise during a winter power cut where I thought I had 60% SOC and actually had about 12%.

The SmartShunt talks over VE.Direct (the little 3.3V serial interface), and there's a brilliant Python library called vedirect that handles the parsing. Wire it up via a USB-to-VE.Direct cable (Victron sell one, roughly £20), then it just appears as a serial device on your Pi.

I log to InfluxDB and visualise in Grafana — the whole stack runs happily on a Pi Zero 2W drawing barely anything.

One genuine gotcha: the VE.Direct port can only handle one connection at a time, so if you leave Victron Connect paired via Bluetooth simultaneously, you can get weird data dropout.

RM_Marine
RM_Marine
Member
5 posts
Joined Sep 2025
5 days ago
#16351

Great thread, @MartinTaylor. I've had a SmartShunt talking to a Pi 4 for about eight months now using the VE.Direct to USB cable — dead straightforward once you've got the vedirect.py library sorted. I'm pulling SOC, voltage, current, and power into InfluxDB every 10 seconds and visualising it through Grafana. The historical graphs have been genuinely eye-opening for spotting parasitic loads I hadn't noticed before.

One thing worth mentioning — make sure you set the correct battery capacity and charge efficiency factor in VictronConnect before you start logging, otherwise your historical SOC data will be skewed and you'll spend ages wondering why the numbers look off. Ask me how I know 😅

Happy to share my Python script if that's useful to you.

Russ Oliver
Russ Oliver
Member
4 posts
Joined Sep 2025
4 days ago
#16362

Great timing on this thread — I did exactly this about six months ago on my narrowboat setup. One thing worth mentioning that I haven't seen covered yet: make sure you set your tail current and charged voltage thresholds correctly in VictronConnect before you start logging, otherwise your SOC resets will be all over the place and your historical data becomes meaningless fairly quickly.

Also @MartinTaylor, with Winston cells specifically, I'd recommend logging voltage alongside SOC rather than relying on SOC alone — Winston cells have a notoriously flat discharge curve and the shunt's coulomb counting can drift over time. Having both gives you a useful sanity check.

I'm using a simple Python script with victron-ble polling every 30 seconds into InfluxDB, then Grafana for visualisation. Happy to share the script if that'd help anyone.

Birch Runner
Birch Runner
Active Member
15 posts
thumb_up 5 likes
Joined Jan 2024
4 days ago
#16547

@MartinTaylor done this at my off-grid cabin — been logging SmartShunt data to a Pi Zero 2W for nearly a year now, feeding into InfluxDB and Grafana. The VE.Direct cable is the key bit; I grabbed one from Victron's own accessories range rather than a third-party one and it's been rock solid.

One thing nobody's mentioned yet: watch your Pi's power draw if you're battery-conscious. The Zero 2W idles around 0.4W which is almost nothing, but a full Pi 4 adds up overnight when your solar isn't generating. Felt that one personally during a grim February.

Also worth pulling in the vedirect.py library from Victron's GitHub — it handles the protocol parsing cleanly and you're not reinventing the wheel. Pair it with a cron job every 30 seconds and you've got genuinely useful SOC trend data rather than just snapshots.

Log in to join the discussion.

Log In to Reply