diy solar

diy solar

Custom monitoring of Growatt and JBD bms

drbytes

New Member
Joined
Oct 21, 2021
Messages
113
I got frustrated one day and started to roll my own monitoring software for my growatts and jbd bms and have it report to Homeassistant via mqtt. The standard stuff, pv watts, the load, etc.
I added a rest api to it so I can perform actions from nodered. I like nodered for automation, you get to see the whole workflow in a glance without having to go through your code.

I did add a Battery management system of sorts in the code itself, for instance there is a configurable rule that will kick in when the SOC is 1%, it'll emergency charge the battery by instructing the growatt inverters to charge the battery from the grid. A backstop --because I have nodered monitoring it as well.
What else does it do... there is a angular interface where you can change output source, input source, float/bulk voltages as well as to and from grid settings.
You can view the info coming from a jbd bms, cells, soc, voltages, temp..


1644096571492.png

THis is what my nodered looks like at the moment, it calls the restapi to instruct the inverters

1644097552572.png

Since all the info is ingested in Homeassistant, and it itself is dumping sensor values into Influxdb, I can graph just about anything from solar performance to battery performance using grafana.

I can reach my homeassistant instance from anywhere in the world so I can perform actions from anywhere :

1644097789141.png

It needs some tidying up but the core functionality is pretty much done and dusted, I'm dogfooding it and has reached a stable state the last couple of dsays.

Currently I'm working on emulating a BMS for the growatts using the data from the jbd.

that's my show and tell.
 
I rolled my own based on that very document. The doc is not completly up to date, for instance the register value for the cutt off voltage for the battery is not in the doc and required some snooping around in the growatt's holding register. (it's at address 94)
It's bog standard modbus rtu, dead easy to read out.

The whole thing is written in C# and runs on a RaspPi using .net core 6
 
I rolled my own based on that very document. The doc is not completly up to date, for instance the register value for the cutt off voltage for the battery is not in the doc and required some snooping around in the growatt's holding register. (it's at address 94)
It's bog standard modbus rtu, dead easy to read out.

The whole thing is written in C# and runs on a RaspPi using .net core 6
1 BMS or multiple? And are you communicating over the usb adaptor or BT?
 
I have one battery pack at the moment, so just one BMS. I'm using a standard RS485 dongle that can be had for 6 euro. No bt whatsoever. The rs485 protocol isn't that hard either I'm not using anythiong fancy to talk to it, standard System.IO.Ports.SerialPort.
 
I'm doing this project because I want to break in my new mechanical keyboard, loads of typing. It's also not rocket science, it's spielerei.
 
This is great! I'm working on something similar with a MPP-Solar unit. How often are you reading data? How long does it take to run your commands?

Instead of getting the data from the BMS I'm getting current readings from a DIY ammeter and tracking capacity that way.
 
The polling interval is about 5000ms, I made this configurable and I can ramp it up by issuing a command to the rest interface.
The commands return near immediately.
 
@Pete B : what are you on about? I have a BMS on my battery, it's a JBD. I'm not trying to create a BMS.
 
The polling interval is about 5000ms, I made this configurable and I can ramp it up by issuing a command to the rest interface.
The commands return near immediately.
I have my driver's listening on an MQTT topic for config changes then expose it with a service layer. I'm hoping to use a broker bridge for easy cloud deployment but I haven't got that far yet.
 
The idea is to emulate a pylontech battery using the data I get off of the JBD. Translate it so to speak and feed it to the growatt either via canbus or rs485. However in order to start developing I would need to do some major work to my current setup, like un-parallel the inverters, disconnect the battery on one of them and letting the other run solo on pv and provide service to the load.
Why because that is how it is set up, parallel inverters both sucking on the battery and both servicing the house with opwer. if i change the battery properties in one of the inverters and it's not spot on then the parallel function can't properly work and the inverters cut power to the load which results in unhappy wifu.
I would have to disconnect and undo a lot of cabling -- and I only finished everything late last month.
 
The idea is to emulate a pylontech battery using the data I get off of the JBD. Translate it so to speak and feed it to the growatt either via canbus or rs485. However in order to start developing I would need to do some major work to my current setup, like un-parallel the inverters, disconnect the battery on one of them and letting the other run solo on pv and provide service to the load.
Why because that is how it is set up, parallel inverters both sucking on the battery and both servicing the house with opwer. if i change the battery properties in one of the inverters and it's not spot on then the parallel function can't properly work and the inverters cut power to the load which results in unhappy wifu.
I would have to disconnect and undo a lot of cabling -- and I only finished everything late last month.
do you have multiple Growatts in parallel? What model? also, do you have to connect to each to get their data? Or is it all output over the "master"/"host" inverter when in parallel? Thanks!
 
Why do you need to emulate a pylontech battery to send data to your growatt? Can't you do that with your pi already? I'm only working with a single unit, I hadn't thought of the challenges a parallel system would introduce.

Tinkering with an operational system is so tempting but bring a lot of challenges, my PC's power supply is a bit temperamental after suddenly losing power a dozen times or so.
 
Haha, I hear you. After losing power a couple of times in a row my nest thermostat gave up. Blew a capacitor -- it's currently on the healing bench.

I cannot write to the modbus register to communicate the status of the battery, I need to go via the canbus or rs485 connection of the inverter itself. There is no other way, AFAIK, to let the growat talk to the jbd.

However,.. I've actually completed all my milestones: read the bms, soc, voltage, current and the voltage of every cell, control the output of the inverters, control the charging sources, set voltages etc.
The emulated pylontech would just be gravy :)
 
do you have multiple Growatts in parallel? What model? also, do you have to connect to each to get their data? Or is it all output over the "master"/"host" inverter when in parallel? Thanks!

There are two. I have them both connected to the Pi. I loop over them and read/set values.
 
If you are willing to share I'd love to take a look at your Growatt driver code. I've been using this python library to talk to my MPP-Solar hardware https://github.com/jblance/mpp-solar/ and it really helped me get a jump start on my project.
I think I might either open source it or create individual nuget packages for use with .net.
I'd need to clean it up a bit, I would need to build in more abstraction, refactor it a bit and take out all the swear words.

I have it on github atm.
 
Back
Top