diy solar

diy solar

DIY Battery via Smart shunt to inverter integration (Solis etc)

Where did you pick up the 4 pin connector to fit in the VE Direct port?
I just used the DuPont jumpers - it fit relatively snug but threw on a few drops of hot glue to make sure anyway.

Also, if anyone is wondering if the solution would work with a Victron BMV as opposed to the smart shunt standalone- it does. I'm also not sure what BMS my rack battery has in it, but I do think it isn't any of the 2 that it was tested on by @sijones2010 . So appears the solution is indeed BMS agnostic and will just work on whatever.

Thanks again @sijones2010 . Amazing work.
 
Last edited:
Ah am really glad it's working.

Can everyone using this solution please drop in here what you're using, victron device and inverter, I can then make a list of compatible hardware on my github.
 
Ah am really glad it's working.

Can everyone using this solution please drop in here what you're using, victron device and inverter, I can then make a list of compatible hardware on my github.
Victron BMV 700 (3.3v so no resistors needed)
Solis RHI-5K-48es (not the 5G)
Unknown BMS but I suspect it's a brand called SMARTBMS. I have a rebranded 50ah but did some digging and seems a rebrand from Leoch.
Waiting for the arrival of a replacement 200ah which has a JBD BMS - convinced it will just work post flash with the new battery values - thankfully.

Also : If this might at all be helpful to anyone out there - I decided to use a small 10000mah Powerbank I had laying about as a permanent power supply for the ESP32. Works splendidly.
 
Last edited:
Using Solis RHI-3.6K-48ES-5G (hybrid) - works with both pylontech and generic (user-defined) battery types - now using the latter.

Was using Victron Smart-shunt; now modified code to run on ESP32 using 2 threads and interfaced directly with Overkill (JBD) BMS.
 
Ah am really glad it's working.

Can everyone using this solution please drop in here what you're using, victron device and inverter, I can then make a list of compatible hardware on my github.
Solis RHI-3.6K-48ES-5G & Victron Smart Shunt - still building the whole setup atm :)IMG_20221015_193258_DRO.-50p.jpg
 
Using Solis RHI-3.6K-48ES-5G (hybrid) - works with both pylontech and generic (user-defined) battery types - now using the latter.

Was using Victron Smart-shunt; now modified code to run on ESP32 using 2 threads and interfaced directly with Overkill (JBD) BMS.
"Using 2 threads" = runs faster??
 
"Using 2 threads" = runs faster??
short answer, Doesn't run any faster.

Long answer.

The data from the victron is done via push, the esp32 has to receive this in real time, any delay and the data is lost. This data is sent every second, so the code uses a task (thread) that has the highest priority to handle this receiving of data.

The can bus data has to be sent every second, delays to this can trigger the can fail message on the inverter, this is in another task but lower priority.

So in effect there is 2 tasks (threads) running the important code to make sure it happens on time, then other processing is ran in between the tasks.

The original version I released didn't have a separate task for CAN bus data and this caused an issue, the one available now does include it.

More stuff will be coming in future releases.
 
Hi All,

I've taken some code that handles Victron's VE.Direct protocol (Smart Shunt) and added in CAN Bus / PylonTech protocol connections, this allows the State of Charge, Voltage, Amps etc all be sent to the inverter - any one that supports the PylonTech protocol.

I have it connected to a Solis and works perfectly.

Secondly as it has MQTT I implemented commands that can be sent to enable and disable charging, and force charging, this I did so if solar isn't going to be good the following day (using Forecast Solar), then Home Assistant turns on the force charge and the inverter will charge the batteries, please note as per protocol it turns off at 97% SOC.

Currently I have a daly BMS on a 200amp battery pack, and a JKBMS on a 320Amp pack, tied together through the Victron Smart Shunt and it all works perfectly.

Code is here: https://github.com/sijones/VE.DirectMQTTCANBUS


Do these pin mappings look correct @sijones2010 (snagged via your photos)?
 

Attachments

  • Pin_Mappings_ESP32_CANBUS_Adapter.jpg
    Pin_Mappings_ESP32_CANBUS_Adapter.jpg
    54.3 KB · Views: 33
Those are correct. The one you put a question mark by is the chip select. That is connected to D2, but is also configurable in the software - see config.h entry "#define CAN_CS_PIN D2 // CAN CS PIN"
 
Those are correct. The one you put a question mark by is the chip select. That is connected to D2, but is also configurable in the software - see config.h entry "#define CAN_CS_PIN D2 // CAN CS PIN"
Many thanks SeaGal
 
@SeaGal / @sijones2010

In:

change the following to 280000 for a 16S 280Ah setup?

#define initBattCapacity 475000
Yes that's fine.

Ps. On your previous post, I'd recommend not changing any pin allocation as am changing the way the configuration works in the future and updates to make it easier for everyone, so please stick to the pins unless you know what you're doing.
 
20220806_205931.jpg
Just checking - in this demo setup, am I correct in thinking that there was no need to have 5V injected to the shunt because that's only required when connecting the shunt to actual Victron equipment (which I won't be doing)?
 
Last edited:
Just checking - in this demo setup, am I correct in thinking that there was no need to have 5V injected to the shunt because that's only required when connecting teh shunt to actual Victron equipment (which I won't be doing)?
The 5v pin on the shunt is actually power out not in. The idea of it is to power an isolated interface. You don't need that as your only using ground and signal.
 
In the README.md, you mention:

"I use Home Assistant to automate off peak battery charging (using Force Charge) and can also enable and disable the charging and discharging."

...is that something you'd consider adding to the github repo (no worries if not - always worth asking! :))
 
In the README.md, you mention:

"I use Home Assistant to automate off peak battery charging (using Force Charge) and can also enable and disable the charging and discharging."

...is that something you'd consider adding to the github repo (no worries if not - always worth asking! :))
The configuration for the mqtt commands is in a file called homeassistant.yaml, but I think it's in the old format so I'll update it later today.

You'll need an mqtt server running or be using the home assistant add on mqtt server.

Feel free to ask what ever, am more than happy to share what I've done, just sometimes am quite busy so can be slow to reply.
 
I've updated the file to be the new way HomeAsssistant likes the MQTT configuration.

In case you don't know, you need the Mosquitto add on, and under configuration put:
- username: emon
password: emonmqtt

password "p" needs to be inline with the "u" of username.
 
The configuration for the mqtt commands is in a file called homeassistant.yaml, but I think it's in the old format so I'll update it later today.

You'll need an mqtt server running or be using the home assistant add on mqtt server.

Feel free to ask what ever, am more than happy to share what I've done, just sometimes am quite busy so can be slow to reply.
That's great, many thanks; just wondering if it'd be quickest for you to create a HAExamples folder in the github repo with some of the automation scripts?
 
Back
Top