diy solar

diy solar

Victron SmartShunt / Home Assistant integration

Oakyz

New Member
Joined
Sep 13, 2022
Messages
5
Has anyone managed to get info from the Victron SmartShunt into HomeAssistant ? I know it works with Solar Assistant but it doesn't show all the available information ?
 
Hi there,

Yes, I just did this. I used an ESP8266 microcontroller to connect to the serial ve.direct port on the smart shunt. I installed the MQTT broker add-on in Home Assistant, and send all of the output from the ESP to MQTT. Then set up the appropriate config on Home Assistant for MQTT devices.

There was also a way to do it with ESPHome, but it was easier for me to do it this way than to figure out ESPHome's YAML configuration.

I don't have it packaged up for sharing, but if you are interested I could get it ready to go. It is very much in an alpha state and might take some fiddling to work in your set up, but it works.

-Kaleb
 
Has anyone managed to get info from the Victron SmartShunt into HomeAssistant ? I know it works with Solar Assistant but it doesn't show all the available information ?
What sort of info is missing from using the SA's route
 
This thread and associated code from @sijones2010 may also be of interest...


It's an ESP32 project that links a smart-shunt to CANBus, but also has MQTT I/O in it, so you could modify it as needed
 
Last edited:
Hi all, I cleaned up my code and wrote some docs on it. It can be found on GitHub here: https://github.com/KalebTheMaker/VictronSmartShunt-ESP8266-MQTT

Stuart, you can dump all the data from the Smart Shunt by uncommenting PrintData() in the main loop. You can also just use the example from the
VeDirectFrameHandler library if you dont want WiFi and MQTT configured.

Let me know if this works, or if I can help.

Edit: I just updated the GitHub repo with hardware connection info.

-Kaleb
 
Last edited:
I havent got home assistant tho, so what could I use to check the data? Would it work with the HA app?
I think the HA app just connects to the HA server. You would still need to have HA.

But... *could* install a MQTT broker on something (pi, laptop, computer etc), then have a look at that.

Where do you want to see the data? It may end up being a slightly different project, but I would be glad to give advice if I can.
 
Hi all, I cleaned up my code and wrote some docs on it. It can be found on GitHub here: https://github.com/KalebTheMaker/VictronSmartShunt-ESP8266-MQTT

Stuart, you can dump all the data from the Smart Shunt by uncommenting PrintData() in the main loop. You can also just use the example from the
VeDirectFrameHandler library if you dont want WiFi and MQTT configured.

Let me know if this works, or if I can help.

Edit: I just updated the GitHub repo with hardware connection info.

-Kaleb
Hi Kaleb

The rep url returns a 404...
Can you please share the code - this sound awesome proj
 
I have it working through node-red showing everything and more in HA. ?
1671539936860.png

The flow is a bit complex and took a while to figure out but this is what it looks like:
1671539865581.png

It does require a VenusOS device with MQTT enabled on local LAN, which from your question I guess you do not have. Node red just subscribes to the SmartShunt topics and in a function node I filter and reformat the messages and then use node-red companion entities to send these values to HA.

With the SoC now available in HA I can run automations to turn the charger on at 25% and off again when it's at 50%. This has been working great the last few months and I now don't need to worry about a low SoC anymore.
 
I have it working through node-red showing everything and more in HA. ?
View attachment 125473

The flow is a bit complex and took a while to figure out but this is what it looks like:
View attachment 125472

It does require a VenusOS device with MQTT enabled on local LAN, which from your question I guess you do not have. Node red just subscribes to the SmartShunt topics and in a function node I filter and reformat the messages and then use node-red companion entities to send these values to HA.

With the SoC now available in HA I can run automations to turn the charger on at 25% and off again when it's at 50%. This has been working great the last few months and I now don't need to worry about a low SoC anymore.
So I am in the process of setting up HA on a slim client. I have Solar Assistant to report BMS and Inverter data. I also have a Victron Shunt in my system but must get my phone into Bluetooth range to see the data. So what is the cheapest way to add VenusOS and have my shunt communicate with it so that I can add it into HA? Thanks for all the hard work
 
So I am in the process of setting up HA on a slim client. I have Solar Assistant to report BMS and Inverter data. I also have a Victron Shunt in my system but must get my phone into Bluetooth range to see the data. So what is the cheapest way to add VenusOS and have my shunt communicate with it so that I can add it into HA? Thanks for all the hard work
You can connect the shunt to SA so all the victron Data is on SA removing the need for Bluetooth.

The only missing info that doesn't appear in the SA interface is the consumed Ah figure. But SA mentioned they will rectify in the next update. "hopefully"
 
So I am in the process of setting up HA on a slim client. I have Solar Assistant to report BMS and Inverter data. I also have a Victron Shunt in my system but must get my phone into Bluetooth range to see the data. So what is the cheapest way to add VenusOS and have my shunt communicate with it so that I can add it into HA? Thanks for all the hard work
I have VenusOS installed on a raspberry pi for a little over a year now. Since I already had multiple rpi's that did not cost me anything extra. Then linked it to victron's VRM portal for nice statistics and for using the app without the need to be in bluetooth range. I have four MPPT's because I have a lot of shadow issues and this allows multiple different panels. And in my case I am using a BMV but that's basically the same as a SmartShunt.

All 5 devices are connected with official VE.Direct to USB cables but there are cheaper options that I have not tried. A cable is about 30 euro's and the rpi maybe 40-50 euro. So that is your minimum cheapest option.

It's not really difficult to setup but I don't know your skill level ofcourse. :)
 
You can connect the shunt to SA so all the victron Data is on SA removing the need for Bluetooth.

The only missing info that doesn't appear in the SA interface is the consumed Ah figure. But SA mentioned they will rectify in the next update. "hopefully"
With the local LAN MQTT on a VenusOS (rpi) everything you can see and do from the app is possible! I was even able to enable and disable the load output on a MPPT...but that's a little more complex than just reading the statistics. You can use MQTT-Explorer to see the data that is available and then configure that in HA directly or Node-Red.

Since I had already figured out how to calculate "Remaining ChargeTime" I really wanted that to be in HA. Could not figure it out in HA directly which is why I went with node-red. This calculation requires the Ah value...and it's available. I have no experience with SolarAssistant so I can't say why it's not there already.
 
I have VenusOS installed on a raspberry pi for a little over a year now. Since I already had multiple rpi's that did not cost me anything extra. Then linked it to victron's VRM portal for nice statistics and for using the app without the need to be in bluetooth range. I have four MPPT's because I have a lot of shadow issues and this allows multiple different panels. And in my case I am using a BMV but that's basically the same as a SmartShunt.

All 5 devices are connected with official VE.Direct to USB cables but there are cheaper options that I have not tried. A cable is about 30 euro's and the rpi maybe 40-50 euro. So that is your minimum cheapest option.

It's not really difficult to setup but I don't know your skill level ofcourse. :)
So VenusOS can be run on a Pi? Interesting. I know I can choose to attach my Victron shunt to Solar Assistant. My problem with that is I would lose my battery BMS data because Solar Assistant only accepts one or the other not both. I would like both. I am on the steep learning curve with HA. I bought an Orange Pi to install HA on but after reading many issues people are having with their Pi’s crashing over time. I started looking for another platform other than the Pi. Several smart guys have started working with Slim Clients instead of Pi’s and they seem to be working out great. So I just purchased a slim client off eBay and I think that’s the route I’m going. Another Slim Client for Venus OS might work too. That way I could attach my shunt via data cable to the second slim Client. Or I could use another Pi also. Then I’m assuming the Pi’s feed their data to HA correct? When I first read this thread I thought I was going to have to purchase another piece of Victron hardware that operate the VenusOS. But if the VenusOS is just an operating system that can be installed on a computer of some sort then that’s a winner.
 
You can connect the shunt to SA so all the victron Data is on SA removing the need for Bluetooth.

The only missing info that doesn't appear in the SA interface is the consumed Ah figure. But SA mentioned they will rectify in the next update. "hopefully"
My only issue with that is SA makes you choose what supplies battery data. Either the BMS or the shunt. You can’t use both which is really what I want to do. Truthfully the shunt data is probably a little more accurate multiple battery installations absolutely true if you have multiple brands of batteries that don’t communicate with each other. However I like having all the data available.
 
My problem with that is I would lose my battery BMS data because Solar Assistant only accepts one or the other not both. I would like both.
Like I said I have no experience with SolarAssistant so I could not tell you if it will work together or not. All I can say is what I have done on my own setup to get the data into HA.
I am on the steep learning curve with HA. I bought an Orange Pi to install HA on but after reading many issues people are having with their Pi’s crashing over time. I started looking for another platform other than the Pi. Several smart guys have started working with Slim Clients instead of Pi’s and they seem to be working out great. So I just purchased a slim client off eBay and I think that’s the route I’m going. Another Slim Client for Venus OS might work too. That way I could attach my shunt via data cable to the second slim Client. Or I could use another Pi also.
There is indeed a big learning curve to master Home Assistant...I have had it running for about 5 years now but only did really basic stuff until a few months ago when I started with Zigbee smart lights....but that's another story. In short I would say that the learning curve is worth it! But try to find the simplest solution for your problem. If there is a plugin already for something...use that instead for example. But for Victron solar equipment there is nothing (yet) so we kind of have to right now.

I am assuming by "slim client" you are actually talking about "Thin Clients" right? That could be a better alternative to a raspberry Pi...but the biggest issue from what I have heard is cheap SD cards. And I would recommend NOT running Home Assistant on a Rpi on an SD card! It need to write A LOT to it's internal event database and that would wear out the SD card. That's why the cheap cards get corrupted easily and the system crashes. There are options to connect SSD's over USB and boot from it. I am running home assistant in docker on a basic intel NUC with a SSD. It's not super powerful but better than a raspberry pi with SD card

I was actually worried about the SD card corrupting on VenusOS too as that IS running on a raspberry pi. But the biggest reason for crashing Rpi's is corrupted SD cards from too many writes...which is what HA is doing. For VenusOS as I understood it's not writing anything to the local SD card unless there is no internet available. Normally it will upload all statistics to VRM and not keep a local copy but when the internet connection is lost you can configure it to keep the records locally on the SD card. When the connection is restored it will upload to VRM and your statistics keep their timestamps.
When I first read this thread I thought I was going to have to purchase another piece of Victron hardware that operate the VenusOS. But if the VenusOS is just an operating system that can be installed on a computer of some sort then that’s a winner.
There are victron devices that run VenusOS but they only make sense if you got the money or need to connect a lot of devices. Once you factor in the cost of 5 VE.direct cables (30 euro x 5) and a VE.BUS MK3-USB (80 euro) then a Cerbo GX that costs about 300 euro is going to be a cheaper option. Plus the Cerbo has more features that might be useful...but I don't have one and run it on a Raspberry Pi 3.

While VenusOS is just a custom Linux image there is no official support from Victron on running it on anything else than a Cerbo GX (or other victron device). The Raspberry Pi image is provided by Victron but they do not support it directly. The idea is to ask support on their forums.

I have no idea if it will run on something else. I am assuming most thin clients would be based on an intel compatible CPU and both the Cerbo and Rpi are ARM CPU's....so that would not work. I do know a lot of the victron services that are run on VenusOS are using python so it's not really depending on the architecture of the CPU...I think.

Hope that helps.
 
Well thanks for all the advice. I have an Orange Pi that was a Christmas gift and I also have a thin client. Interesting you have your running on a NUC. I have access to those from a local hospital that is replacing theirs. I may grab one or two for future use.
 
Back
Top