New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ANT BMS #1396
Comments
I got a custom sensor for the ANTBMS 2020 ... Unfortunatly they changed the protocol for the 2021 model :( |
Can you explain to me how you did it? did you connect to the display port? I currently use a script and connect to the bms via bluetooth |
Yes on the display port.... it's an UART ... so basic wiring, ANTBMS: (GND,TX,RX) <=> ESP32 : (GND,RX,TX) |
Have you used esphome? Do you also have the option to switch the mosfet? |
Yes ESPhome with a custom sensor : https://drive.google.com/file/d/1dwPWgargfSiYi-KMFOFXDH9V1jTvhBTh/view?usp=sharing You can play with it... Tuned for a 16S battery |
thank you very much, how did you connect the cables? i.e. you only connected gnd to gnd, rx to tx (gpio01), tx to rx (gpio03) |
right |
How does it work when you connect the display cable to the esp, the bluetooth still works? |
You can describe it in more detail, I'm not an experienced user, I would need a little more detailed explanation if possible. Thank you |
Juste install the yaml and .h files into your /config/Esphome directory. Edit in Esphome the yaml file and change your WiFi informations... Be sure to connect the TX & RX to the pins specified in the top of the .h file... Than compile and install the file on your ESP32. |
Thank you for the answer, it is possible to use the module WeMos D1 Mini, ie ESP8266 . Will it work with the new version of ANT BMS 2021? |
As I wrote from the beginnin the code I wrote sometimes ago was for the ANTbms model 2020.... Not sure it will work with the 2021 version as you have since the Appz changed between.... I guess they changed something in the protocol. But yes it's possible to use a simple WeMos D1 mini |
The include part must be in the esphome: section like
|
So I managed to compile and upload to esp32 because esp 8266 didn't work. But now I have a problem, in homeassistant I see no data for entities. In antbms_custom_sensor.h is RX at 17 and TX at 16, is that correct? It should not be the other way around. Can there be a problem with that? I also tried TX on Tx RX on RX but I still don't see any data just unknown. Plus contact from BMS should not be connected? Because if I connect a display without a plus contact, the BMS will not connect to the display. Can you please help where there may be a mistake, maybe I'm close to making it work, I'd be very grateful. That's how I connected it. |
Hi, Look at the pinout of your ANT-BMS LCD btw. the colors for the wires don´t make logical sense. But I also struggle to read anything on any wire with a multimeter so I wonder if they even work. It works via bluetooth so that's probably the way I need to go |
Hi, I use 16S exactly as the author. Unfortunately, I still don't get any data. Maybe if the author gave a photo of which version of BMS he used, we would move somewhere. I had those cables just like you, but before the assembly I swapped them according to the standard. Do you have a program that works via bluetooth? |
hi, |
Via bluetooth it works with the original application, but only locally and limited bluetooth range. I don't understand the question, what red and black cable do you want to connect? ........I already understand what cables you want to connect together. On my BMS it is enough if I connect those cables together for 1-2 seconds and the BMS turns on and if I connect them for more than 3 seconds the BMS turns off, ie without using a battery or another source ,but I have two black cables. |
So I managed to make it work. I just have a little problem. The program freezes quite often, so I want to ask someone who uses it, if it happens to you and if so, how often. Thanks |
try to remove the date_baud: 0 in the logger and maybe you will have to adjust some timing in the .h |
Could you be more detailed please? Where can I find timing in the .h so which line is it. Alternatively, as I delete date_baud: 0 in the logger. I am a beginner and this information will help me a lot. |
Hi, unfortunately I have not yet been able to test the communication between bms and esp but I have seen that new repositories have been created for the various bms and integrated with esphome like this for jk bms https://github.com/syssi/esphome-jk-bms , it would be interesting to create a repo for ant bms |
Hi, if you want to join to test and implement ant bms on esphome you can write here |
I also have two bms one 100a old and one new 300a purchased in October 2021, so I think I am in the same condition as you, have you made any changes to the code? Can you explain better? |
Your BMS is different. Do you have a display? Does it show you data from BMS? As you have it connected, take a picture. |
I have two bms both without display, I soldered some wires because I did not have the display connector however starting from the left it says on the pcb positive, gnd, B, A, assuming that the last two pins are for the display |
I have it connected like this: |
still check if you have correctly assigned pins, in the program it is: |
the original display cable have this color red, black, yellow, green red to 3.3v the problem is that if I connect the data cables in this way the esp32 disconnects and is unstable |
For me, the flood color of cables: |
Do you see the data in the APP via bluetooth? If so, try to change RX and TX or disconnect the VCC 3,3V from ESP 32. You have to try several options and see what it does. |
I think I got confused with the cables ... Anyway, do you know what kind of connector is the one of the display? |
Should be JST XH2.0 4P or JST/microMolex 1.25mm 4p |
I tried but through the custom components it does not work and there are always problems with the esp 32 that I have and unfortunately I do not know the reason but it does not work on esp8266, I had reversed the cables because the black was not gnd but tx |
@lucasimons Could you make some photos again? The BMS mainboard of lumiror is labeled ( |
This is not a BMS mainboard, but a display |
Good point. It helps nevertheless to identify |
ESP8266 don't even try it doesn't work, but as Syssi writes take photos as you have it connected. But good quality, focused so we can see the details |
take yet photo of ESP32 |
It is not visible to which pins you have the green and yellow cable connected |
That's great. Maybe I would connect it for safety on IO 17 and IO16 TX2 RX2 |
Hello , not sure to post at the correct place , |
Could you provide your yaml configuration? |
haw many amp? 20a? Can you send a pic? |
Describe the problem you have/What new integration you would like
Add support for ANT BMS over UART or ble uart
Please describe your use case for this integration and alternatives you've tried:
Now i use a python script to read the data and send to mqtt on a rpi4
Additional context
https://github.com/juamiso/ANT_BMS
https://github.com/Sgw32/BMSCtl
https://github.com/Louisvdw/dbus-serialbattery/wiki/Driver-BMS-support
https://github.com/imval/AntBMS/blob/main/AntBMS.cpp
ANT_communication_protocol_EN.1.pdf
https://diysolarforum.com/threads/for-those-of-you-looking-to-monitor-your-ant-bms-with-pi3-via-bluetooth.6726/page-6
The text was updated successfully, but these errors were encountered: