diy solar

diy solar

ESPhome pbmstools equivalent, applicable to Pace P16S100A BMS and here applied to SOK 100Ah 48v

gary_lankford

New Member
Joined
Mar 18, 2023
Messages
14
Location
Texas

I've been running Solar Assistant on an Orange Pi 3 LTS for control data in Home Assistant for a while. Recently, I had an issue with the Pi and thought it was dead. Ultimately, that issue was resolved, but it led me to casting about for an alternative...

This is to report the successful implementation of esphome-pace-bms for a set of SOK 100Ah 48v server rack batteries using Pace BMS P16S100A-1B470-4.07 version (previously unconfirmed for the SOK battery).

Code flashed to an ESP32-WROOM and using an RS485 TTL serial port converter board plugged to the RS485 port next to the CAN port.

The only significant deviation from the procedure shown on the page above was to switch RX and TX.

Potential advantages of esphome-pace-bms over Solar Assistant for battery data monitoring and control are a more complete data set and configuration of parameters from within esphome/HA and a lower cost.

This is 'like' pbmstools in HA, but I have yet to understand whether it only addresses the slave battery and whether the slave is really the only battery in a set of significance to monitor/control the set.
 
I'm very excited to see this. I see the corresponding commit in the github repository, confirming that the SOK battery works with this configuration.

I've been researching the UL 9540 situation with SOK batteries and an EG4 6000XP inverter. It seems possible that I'll need to rig up my own device to command battery shutdown and I think this configuration might do the trick. (It appears that there is a supported command to tell the BMS to disable the discharge MOSFET, which I believe should accomplish the shutdown I am after.)

I presume you are currently only using this to monitor the packs, not to command them. True?
 
Yes, true... I just implemented this and hadn't even considered what you are suggesting.

After saying that all functions of pbmstools are available, now I'm not sure those are. Though the charging/discharging and operation states are displayed, I'm not sure they can be directly controlled by a 'switch', or if they can be, how... Those are in the data section rather than the configuration section (pbms pages) and aren't shown as input boxes.

I have to confess to being fairly new to Home Assistant and ESPhome and just wanted to get this out there as an alternative to Solar Assistant.

NOTE: I need to mention also that in order to consistently get data from my Packs 2 and 3 using the RS485 port (next to the CAN port), I had to "daisy chain" the packs together by putting a splitter on Pack 1 and 2 to cable the three packs together. (Sometimes, data from Pack 2 and 3 was not being retrieved before I added this cabling).

I suspect this wouldn't be necessary if you were using the RS232 and already had the other RS485 ports cabled as for Solar Assistant, but I wasn't ready to give up SA yet and this solution is allowing me to get data from both SA and the ESPhome-Pace-BMS for comparison.

I probably should add a signature stating that I am old and dumb as a disclaimer...
 
I think you are being entirely too hard on yourself :).

I'm grateful to you for creating, testing and sharing the configuration and also for putting the specification PDFs into the repository. After spending quite a bit of time reading and re-reading them, I think I agree with your assessment. For whatever reason, the documented RS485 communication can only give the status of the charge and discharge MOSFET while the RS232 connection can also command them. Ultimately, I think this may be helpful, as it ends up putting the master battery in charge of dealing with the other BMSes, which based on my experience, it seems capable of doing. (I am getting accurate aggregate charge information and charge/discharge rate information over CAN connection to the master battery at the moment.)

I should add that it's entirely unclear to me if I am actually bound by UL 9540 in this case. I hope not, because it is quite clearly a system level qualification. I can certainly try to demonstrate that I have somehow wired in a BMS shutdown as part of inverter shutdown but I won't be subjecting it to qualification testing by Underwriters. :)

Will try to report my progress (or lack of it) when I start to try writing and wiring this up.

Thanks again!
 
Syssi (Sebastian Musznski) is the owner of the github repository and the creator of the ESPhome example.

All I did was implement it for my use on SOK batteries and mention it here when I could not find it mentioned previously...

I'm currently using a Magnum MS4448pae inverter, so getting no integration from the inverter and depending a great deal on the SOK battery supplied data for Home Assistant integration.

I'm tiring of the Magnum limitations for grid-tied application and seriously considering the new EG4 12kPV as a replacement.
 
RS485B and RS485C are for the "Master" battery BMS to pull data from each battery. Adding any other device will interfere with the Master BMS being able to query and get data from each battery.

The RS485A and CAN are for inverter communications and response to inverter commands/requests and the data provided is a compilation of the data from all batteries as compiled by the Master BMS.

The RS232 port on the Master BMS gives you access to the data (SOC, Battery Voltage, Individual Cells Voltages Alarm Data etc) for all batteries connected via the RS485B and RS485C ports. "Pbmstools" or "SOKTools" or "Solar Assistant" connect to this port. I have observed that "Solar Assistant" does pull a lot of data from the batteries but does not appear to display it. For example I would like the state of both the Charge and Discharge MOSFETS to be displayed as well as the Battery State; Charging, Discharging or Idel

You can view all batteries using the "Pbmstools" or "SOKTools" (download from Current Connected) connected to the Master BMS if you enter "FF" as the "Pack" address before opening the serial port.

If esphome-pace-bms knows the addresses of all the SOK batteries (Or SunGoldPower clone) then it should be able to pull all data for each battery if it connected to the RS232 port on the Master BMS
 
RS485B and RS485C are for the "Master" battery BMS to pull data from each battery. Adding any other device will interfere with the Master BMS being able to query and get data from each battery.

The RS485A and CAN are for inverter communications and response to inverter commands/requests and the data provided is a compilation of the data from all batteries as compiled by the Master BMS.

The RS232 port on the Master BMS gives you access to the data (SOC, Battery Voltage, Individual Cells Voltages Alarm Data etc) for all batteries connected via the RS485B and RS485C ports. "Pbmstools" or "SOKTools" or "Solar Assistant" connect to this port. I have observed that "Solar Assistant" does pull a lot of data from the batteries but does not appear to display it. For example I would like the state of both the Charge and Discharge MOSFETS to be displayed as well as the Battery State; Charging, Discharging or Idel

You can view all batteries using the "Pbmstools" or "SOKTools" (download from Current Connected) connected to the Master BMS if you enter "FF" as the "Pack" address before opening the serial port.

If esphome-pace-bms knows the addresses of all the SOK batteries (Or SunGoldPower clone) then it should be able to pull all data for each battery if it connected to the RS232 port on the Master BMS
Yes, I haven't done it, as I haven't been willing to disconnect Solar Assistant from the RS232 port, but ESPhome-Pace-BMS should work on RS232 with the right adapter. I do know you can't connect SA and pbmstools to the RS232 at the same time using a splitter; SA won't allow it.

As for RS485A being a compilation of all packs, I don't believe that to be true, as I can pull different data from each pack one at a time, or at the same time by cabling the RS485A's together as mentioned above. The packs are addressed individually in the ESPhome yaml and even pack ser#, BMS version, and BMS ser# are discretely pulled as in the image attached.

I am pulling the same data from SA on RS232 and ESPhome-Pace-BMS on RS485A simultaneously.

I did an equalization to generate the Alarm/Protection shown in the image... Before that all I saw was MOSFET_DCHG MOSFET_CHG
 

Attachments

  • Screenshot_20240714_171629_Chrome.jpg
    Screenshot_20240714_171629_Chrome.jpg
    90.5 KB · Views: 4
  • Screenshot_20240714_172228_Chrome.jpg
    Screenshot_20240714_172228_Chrome.jpg
    64.3 KB · Views: 4

diy solar

diy solar
Back
Top