-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support for JK BMS #19
Comments
Hi @downset, as I do not own such a BMS, I would need more information in order to be able to add it to the supported BMS as I need to be able to test the implementation to assure some quality. Can you specify in more detail, which BMS you are looking at? JK seems to have a number of different ones ... |
Thanks for the reply. |
Thanks a lot, that is already good information for me. If it works with the Batmon HA and the protocol "JK" it should be doable. I tried to build a fake battery to be able to test the setup but failed so far. The BMS seems to have some very strange/specific properties regarding BT. Can you confirm that your BMS works with this app https://play.google.com/store/apps/details?id=com.jktech.bms ? I might need some more info to properly detect the BMS later. 🤔 |
Sorry I can not confirm this app cause I don't own an Android Phone - but it is the app JK QR code in the Manual links for this BMS |
Hi! I spent yesterday quite some time to try to get a fake battery that I can test with the app but it didn't work out for unknown reason. So testing against a known good seems to be out of reach. 😞 Anyhow, if you like, I can port the implementation from batmon, do some dry runs with samples I found and you test it real life? Do you have a new firmware (>=11)? |
Thank you very much for your efforts. Greets downset |
Ok, great thanks. I already started working on it, device detection works, shouldn't take too long till I have an alpha version for testing. Allow me some time, I can only work some evenings or weekend. I'll give you a ping when I have something ready to be checked. |
Hi @downset, I have a test implementation you could try on the jikong_bms branch. You can install it manually. If you do not succeed, I could also generate a draft release. Let me know the outcome, a debug log would be great, independent of the actual result. That would help me to verify some assumptions. |
The Integration now finds both BMS but no data in the Entitäten. Hope This is the logfile you need |
Hi!
I actually doubt that. Had a look at the log and it looks like you have a totally different BMS (protocol). Did you ever try it with BatMON? Basically, BatMON supports a subset of the BMS listed here https://github.com/syssi/esphome-jk-bms and yours is not listed at all. |
mhh thats strange, https://youtu.be/Iq0vvR-mQUs?si=i9ikFvMm_VU6aYL4 PS: no it is not listed on the Batmon site but also refering to the video, also the newer models work with Batmon |
Hi! I had a look at the video and I think we are talking two different BMS types here. Andy is always talking about is "battery#2" and "battery#3" he is testing with BatMON. In the video, timecode 11:38 I can see his Bluetooth scan where those batteries are mentioned and there is another JK_PB2A16S20P-06 he is never talking about. Unfortunately, he doesn't mention the type of BMS is actually using/testing and I'm quite sure he did not try that as his configuration does not contain the MAC address of the JK_PB2A16S20P-06. Your BMS seems to have a separate UART BT module that needs to be configured. A hint is here syssi/esphome-jk-bms#412 (reply in thread). I assume that this is the issue as I can see the BMS sending "AT" messages. |
I |
Here is the new log file home-assistant_bms_ble_2024-06-10T09-51-35.086Z.log greets Downset |
Here it is :) |
I can see some, so the fix did bring us significantly forward. Do the values look plausible to you?
The protocol is still messed up so readout is not stable. I'll have detailed look soon, but at least values are arriving now. 😃 |
That sounds good. Greets |
Hey @downset, I again did an update to fix the current and the general protocol handling. Could you give it another test, same procedure as before and provide me with logs? Thanks a lot! |
and here it is: everything looks very nice... looking forwoard what you say about the Log Many Thanks |
and here a log in this situation at 13:09 MEZ i startet 3kw car charger and so i discharged both batterys with around 30a Edit: |
Hey! Sorry, had to fix the current again, now it should work. The runtime is the expected remaining time the battery has till 0% SoC. It's calculated so cannot be found in the app. If you can confirm the values now to be correct, I would be mainly interested in the stability, i.e. are the values always available. Would be cool if you can again send me a log, I'd like to do some more optimizations to reduce the BT load so likelihood of interference is lower. Thanks so much for taking the effort.
That is a general task I put onto my agenda (see outlook) and I would add it for all models at the same time. If you are ok, I'd like to do that after the main values are stable, because then I need to annoy you less with testing. ;-) |
Now also negativ values are correct Feel free to contact me if you need any testing support |
Signed values do not seem to be my strength. 😆 Fixed. I now cleaned the code and the tests and significantly reduced the BT traffic (and logging). Let me know if it still works as expected. If so, I would do further cleaning over the next days and then merge it to master for a release. Also if you could have a look at graphs to see if the values are continuously reported that would be great. |
New Version in not working anymore Old version seams quite stable one or to times i have seen value unavalable but never for long time Graph is complete |
Hey @downset! Ok, the behavior is really strange, there is no way I can replicate this on my side. I tested the old and modified version and all my tests (artificial, emulated battery) passed. Due to your feedback, I decided to revert the BT optimization and just kept the fixes for the remaining time. Hope it works this time again and we can conclude here and move over to the cell voltage values as a new feature. 😄 |
This is working again, but still no negativ Runtime value :) It is up to you how to move foreword if you are willing to make more optimation tries of cause i will test it :) |
I have to thank yo for your efforts :) if you have anything to test also unreleated to the jk just in general for the integration, feel free to contact me |
Hi @downset, I'm thinking again about a small BT optimization for your BMS. I have seen in the offgrid garage video that the BMS beeps on the first connection (when the integration starts). Can you confirm? I'd like to avoid that happening every 30 seconds ... |
Yes this is correct it beeps every 30 sec :) |
Do you prefer to
Any preferences? Then I would give it a try again. |
for me the beep is in the Basement so no problem |
Hey! Can you give this branch a try? Note, it's based on 1.4.1, so either upgrade and replace one file, or replace all ... |
just updated to 1.4.1 everything working, than updated just the jkbms file correct? |
did an other try to dubble check... |
After updating the files, did you restart HA? Otherwise, reloading of the new functionality is not guaranteed. |
yes i did both times |
This BMS behaves so strange. Since I cannot find a clear documentation, I will need to rely on the BT traces that are available, meaning that I cannot stop the BMS from permanently sending data (although not necessary). But the good news is, I can fix the missing values (I think). 😄 |
Could you try this branch? It should now basically never show you "unknown" data and probably it removes the regular beeps (just a wild guess). |
It is working and no more Beeping :) home-assistant_bms_ble_2024-06-24T17-07-46.873Z.log I will monitor and update this post if I get "unknown" values again Thank you |
Hey @downset! In case you are bored 😎, could you test what happens if you just comment (deactivate) this part of the code? BMS_BLE-HA/custom_components/bms_ble/plugins/jikong_bms.py Lines 180 to 183 in 1ff8667
I'm wondering if this is necessary to be sent or if it is just optional. Totally not urgent or important. |
No thanks. I think we have reached quite the optimum of what is doable with the BMS. I'm currently working on cell voltage readout to give you something useful for all your efforts. |
if its easy to do in this step all Temp sensors and the direct from the bms calculated cell differenze would also be nice :) |
Looks Perfect |
Not fully happy with my code yet, but I think it should be working for you and show you cell voltages using this branch. I want to add the feature for all BMS types before releasing, so it might still take a while till it comes to a release. |
Hi! Ok, looks like it works. 👍 The user presentation is a bit strange but defined by HA. If you take a look at the developer tools the presentation is with 3 digits as the readout from the BMS is. |
Again i would like to thank you for all your efforts to make the JK work. |
@downset thanks a million for that nice motivating feedback. Highly appreciated! If you want to contact me personally, I have a discord link in my profile and I now added a buymeacoffee button to the project. Actually, I was thinking that there are people who are in much more need of money than me so I would appreciate if you could donate the amount you were thinking of to an organization of your choice helping people in need. 😊
Didn't figure that out myself yet, no idea unfortunately. |
I now released v1.5.0 which should have all requested features. Thanks for your support, if there is anything more, let me know by contacting me or opening a new issue! |
Just updated to this Version, All working fine Thank you |
Checklist
Is your feature request related to a problem? Please describe.
I would love to see support for the new JK Inverter BMS.
Describe the solution you'd like
Found your project through the Offgrid Garage video and have the same problem as Andy with the Batmon addon, because i would like to use the ESPHome BLE proxy.
So your project would be a perfekt solution.
Are you planing to add the JK Inverter BMS to your solution?
I opened this Feature Request to track the progress (if integration is planed) and maybe can help Beta testing
Best Regards
Additional context
No response
The text was updated successfully, but these errors were encountered: