• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

YamBMS JK-BMS-CAN with new Cut-Off Charging Logic (open-source)

canbus:
# CANBUS NODE 1
- platform: mcp2515
spi_id: bus_spi1
id: canbus_node1
cs_pin: 5
can_id: 2
bit_rate: 500kbps
clock: 16MHZ
Yep - that did the trick for the CAN status, it seems to work, but log only receives this message:
Code:
[19:52:37][D][canbus:072]: received can message (#1) std can_id=0x305 size=8

Should there be more data from the inverter?
 
Last edited:
Yep - that did the trick for the CAN status, it seems to work, but log only receives this message:
Code:
[19:52:37][D][canbus:072]: received can message (#1) std can_id=0x305 size=8

Should there be more data from the inverter?

With the standard PYLON protocol, the inverter responds with an ACK 0x305 every 1s. No other information is sent by the inverter.

If your inverter receives the information on the CAN bus then it is good now.

Well found @goldserve
 
Not sure if it matters but what version of esphome and python do you use ? I also get windows curses errors, I suck at this stuff

Last version on Linux.

I know that on Windows you have to install this package.

Bash:
pip install setuptools
 
With the standard PYLON protocol, the inverter responds with an ACK 0x305 every 1s. No other information is sent by the inverter.

If your inverter receives the information on the CAN bus then it is good now.

Well found @goldserve
Ok, attached are my updated working configs in case someone else goes this route with Waveshare S3 with their Pico CAN module, this combo is ready to go for CAN, RS485, BLE, and has 6 AC/DC relays.

Inverter Brand : Midnite
Inverter Model : MN15-12KW-AIO
Inverter battery mode : Pylon 1.2
BMS model : jk-pb2a16s20p
BMS protocol : BLE
RS485 board : not sure, kit model
ESP32 board : ESP32-S3 DevKitC-1 Waveshare
CAN name : Automatic
CAN protocol : PYLON 1.2
CAN transceiver : MCP2515
Multi-BMS : yes
 

Attachments

Very cool platform. Unfortunately the default module used does not have some psram onboard to help alleviate the heap memory pressure when using MQTT and multiple BTLE connections.
 
What am I getting wrong? Trying to install multi BLE for the first time - but failing at the first hurdle with this message of missing package;

ModuleNotFoundError: No module named 'pkg_resources':


File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/platformio/builder/main.py", line 173:


env.SConscript("$BUILD_SCRIPT")

(Installing on Mac OS from the terminal. ESPhome installed ok. Python 3 installed ok)
 
What am I getting wrong? Trying to install multi BLE for the first time - but failing at the first hurdle with this message of missing package;

ModuleNotFoundError: No module named 'pkg_resources':


File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/platformio/builder/main.py", line 173:


env.SConscript("$BUILD_SCRIPT")

(Installing on Mac OS from the terminal. ESPhome installed ok. Python 3 installed ok)
did you download the entire github? You should have at least 5 folders and 7-10 files in your working directory all from the github repo
 
What am I getting wrong? Trying to install multi BLE for the first time - but failing at the first hurdle with this message of missing package;

ModuleNotFoundError: No module named 'pkg_resources':


File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/platformio/builder/main.py", line 173:


env.SConscript("$BUILD_SCRIPT")

(Installing on Mac OS from the terminal. ESPhome installed ok. Python 3 installed ok)

Bash:
pip install setuptools
 
What am I getting wrong? Trying to install multi BLE for the first time - but failing at the first hurdle with this message of missing package;

ModuleNotFoundError: No module named 'pkg_resources':


File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/platformio/builder/main.py", line 173:


env.SConscript("$BUILD_SCRIPT")

(Installing on Mac OS from the terminal. ESPhome installed ok. Python 3 installed ok)
The ESPHome folks are aware of this issue of setuptools not being installed alongside esphome.
 
Hi @All,
i setted up my DiY Battery 5 Days ago with YamBMS and connected it to Home-Assistent and it is running well since then.

But one Question: i have small differences in the voltage of the bms reporting and my deye reporting. Do i have to calibrate it some way?
Is there any procedure to do that?
 
Hi @All,
i setted up my DiY Battery 5 Days ago with YamBMS and connected it to Home-Assistent and it is running well since then.

But one Question: i have small differences in the voltage of the bms reporting and my deye reporting. Do i have to calibrate it some way?
Is there any procedure to do that?
Jk bms can be calibrated. But I wouldn't trust the inverter or the bms as truth.
 
Jk bms can be calibrated. But I wouldn't trust the inverter or the bms as truth.
Hi,
calibrate your BMS to your measurings. the Deye does need a "inverter offset" , because it is not accurate.
I use my deye only as battery inverter, i add 0.5v inverter offset in yambms to reach the desired voltage in my bms.
IF you use the PV or Generator Function of the Deye, its not as easy (negative and postive offset), you have to dig into this thread, i cant tell you more.
Dont bother opening a ticket at Deye, they declare this as "normal behavior"

1729781794154.png1729781832389.png
 
Hi @All,
i setted up my DiY Battery 5 Days ago with YamBMS and connected it to Home-Assistent and it is running well since then.

But one Question: i have small differences in the voltage of the bms reporting and my deye reporting. Do i have to calibrate it some way?
Is there any procedure to do that?

Yes it is good to calibrate your BMS for a good measurement of voltage and current.

The best is to have a good reliable multimeter.

The Deye cannot be calibrated, the one I have is quite well calibrated but not perfect. But be careful, you should not measure the voltage of your inverter during a charging phase because the inverter naturally increases the voltage to charge the battery.

The ideal would be to make the measurement on a system at rest, just the inverter connected to the battery.
At rest the voltage of my BMS corresponds roughly to the voltage of my Deye.

If you do not have a good reliable multimeter, be careful, it is riskier to define a voltage too low than too high.

Concerning the current measurement, you must do it with a stable current, the easiest is to charge the battery from GRID and limit the charging current of your Deye to a number of amps that corresponds to your average load. You can use another technique, the most important is to have a stable current.

Topic to read regarding Deye voltage offset.
 
Hello,
I have a friend who will like to use this project to his diy battery but unfortunately his inverter does not have can port communication, it has just rs485. What he need to do in order to be able to use this project?
 
What brand and model? Does it have a port labeled "BMS" or it only has a single RS485 port? What battery does it currently communicate with and which communication protocol? Such as Pylon, etc?
 
Hello,
I have a friend who will like to use this project to his diy battery but unfortunately his inverter does not have can port communication, it has just rs485. What he need to do in order to be able to use this project?

If there is already an eshome component to communicate with the inverter then it is easy to do.
 
If there is already an eshome component to communicate with the inverter then it is easy to do.
He don't have comunication Between HA and inverter. The inverter is a MPP Solar and it has just rs485 port to connect with BMS and BMS is the black JK BMS B series. Until now he used the inverter on user setings.
 
He don't have comunication Between HA and inverter. The inverter is a MPP Solar and it has just rs485 port to connect with BMS and BMS is the black JK BMS B series. Until now he used the inverter on user setings.

What model exactly?
 

diy solar

diy solar
Back
Top