patman15 / BMS_BLE-HA

This integration allows to monitor Bluetooth Low Energy (BLE) battery management systems (BMS) from within Home Assistant.
GNU Lesser General Public License v2.1
20 stars 3 forks source link

Seplos BMS V3 #24

Closed Goaheadz closed 2 months ago

Goaheadz commented 3 months ago

Checklist

Is your feature request related to a problem? Please describe.

Need help to start integration with Seplos BMS 3.0

Describe the solution you'd like

Guidance to implement this.

Additional context

I have Bluetooth proxy near BMS, but I dont see MAC adress. Should I see one? If it is not suposed to see results in scan/esp32 logs, then file known_devices.yaml should log the BMS mac? I can connect with no problems via Seplos Android app, but app does not show mac adress. image image

From the begining..what should I try first?

patman15 commented 3 months ago

Getting there, need to fix the battery still a bit. :smile: seplos

Goaheadz commented 3 months ago

6.5kA...Cable must be red hot!! eheheh I believe all units are in millesimal. mV, mA etc

Keep up the good work.

patman15 commented 2 months ago

6.5kA...Cable must be red hot!! eheheh

You won't believe what my virtual battery can survive! :rofl: And you won't believe the units they are using ... 32bit signed integer for 0.1A units?! That is a lot of amps ...

Anyway, just pushed an update, can you try? Please make sure that you exited the Seplos app. I need to make the code a bit more robust, but in general the BMS is not very well programmed, so it is hard to make the readout really reliable. If it works (or doesn't) please attach a home-assistant.log. Be patient in the beginning, it might take 1-2 minutes till you see values.

Goaheadz commented 2 months ago

🤣 Seplos support is not the best. I made alot of questions regarding bluetooth and they had no awnser...at least the guy I talk to. Probably the app was done by a rookie, just for marketing..every bms in the market as bluetooth app, so had to release something.

You are getting there...but the hard way, with alot of efford. I thank you for that.

Without app (before 21:34), there was only one rx data ble line. (SP05B2312190075 ) Rx BLE data (cnt.): bytearray(b'\x00\x84\x02\x93\x01')

As you can see in log, I started de app at 21:34 and close it. 2024-07-08 21:34:31.863 DEBUG (MainThread) [custom_components.bms_ble.plugins.seplos_bms] (SP05B2312190075 ) Rx BLE data (start): bytearray(b'\x00\x044\x14\xa6\x00\x00\x00\x00\x00\x004\x80\x00\x00m\x00\x00\x00\xf1\x00\x00m\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x07\x08\x00\x00\x07\x08\x00\x00\x02@\x01\xd0\x00\x01\x00\n\x01\xe0\x03\xe77\n')

I notice something as changed, so I restart the seplos app at 21:36 to check home assistant, and data was flowing.

home-assistant.log

After running seplos app: image

So theres still something not ok in the request data, that seplos app does and we are not doing.

Goaheadz commented 2 months ago

Fixing data received can be done after you figure out the request header.

I wish I could help in this task...

image

patman15 commented 2 months ago

Pushed another commit that you could try. The mistake was on my side. The commands use number of registers (2 byte) as length, while the length in the reply is in bytes. No idea why I would design a protocol like that. :facepalm:

Goaheadz commented 2 months ago

Finally we have some data, without having to call Seplos app. Well done @patman15 !! :clap:

Screenshot_2024-07-09-09-34-24-19_c3a231c25ed346e59462e84656a70e50

patman15 commented 2 months ago

Finally we have some data, without having to call Seplos app. Well done @patman15 !! 👏

:smile: Are the values correct? At least the cycles seem wrong because they should be an integer. Can you try removing the device, update the integration, reboot, and re-add the device? Also I wonder that your delta voltage is exactly zero, but that could be correct. In my testing it worked, but it was quite late, so ... :wink: If you see other troubles, a log would be great, I'll continue with a lot of cleanups to prepare a release.

Goaheadz commented 2 months ago

I always delete de device, clear de pycache restart and wait for it to be discovered again :)

Beside "cycles", the temperature entitie is cell average temperature (I have 4 sensors in cells, one environment and another from bms mosfets): Charging, current and power can only be tested later. Currently I have the battery in idle. (not charging and not discharging)

Bluetooth integration: Screenshot_2024-07-09-16-58-43-17_c3a231c25ed346e59462e84656a70e50

RS485 Integration: Screenshot_2024-07-09-16-59-21-19_c3a231c25ed346e59462e84656a70e50

In conclusion: image

Goaheadz commented 2 months ago

image

patman15 commented 2 months ago

Thanks, found the typo, will have fix very soon.

patman15 commented 2 months ago

Fixed. Voltage is the overall battery voltage. The icon is the default from HA, you can change it in the settings of the entity, as well as the number digits you want to see. General description of the values is on the homepage. Yes, cell temperature is the average. I still need to work on the delta voltage as this is currently not correct if you have more than 1 battery pack (seems not to be the case for you.)

Goaheadz commented 2 months ago

I confirm Delta is fixed.

Yes just one battery pack.

I think its important to see cell voltages also. For me and what I read from forums, people always want to see the cell number that is the highest and the number of the one is the lowest. Not very interresting for routines/automations, but...who knows.

Once again..amazing work @patman15

patman15 commented 2 months ago

Once again..amazing work @patman15

Thanks! :blush:

For me and what I read from forums, people always want to see the cell number that is the highest and the number of the one is the lowest.

These people are mostly people that built their own battery and want to replace individual cells.

I now

If you can confirm it (still) works, I think I'm done except for loads of tests that I need to not mess it up later again. :wink: Thanks for testing!

Goaheadz commented 2 months ago

Still working!

I only have one battery, but cant find any reference like pack#1

Goaheadz commented 2 months ago

image

Goaheadz commented 2 months ago

image

All ok for now. If runtime is just a formula for discharge till 0% SOC, then I also assume its ok.

patman15 commented 2 months ago

I only have one battery, but cant find any reference like pack#1

I just made the cell numbers increase. From 0-15 it is the first pack, from 16-31 the second, ...

If runtime is just a formula for discharge till 0% SOC, then I also assume its ok.

Yes, just a formula as this BMS does not provide the number.

Just did a final update including test coverage. If you could update and confirm you are fine, I would merge the branch and make a new release.

Thanks!

Goaheadz commented 2 months ago

Update done. Still works,...would not expect other way, from your excelente work! ehehehe

Quick question: For delta voltage, you use atrributes, but the only cell voltages I can find in "status" are from rs485 integration..not from the ble. What are those sensor called? where can I check them?

image

image

patman15 commented 2 months ago

Hi!

You can find the data in the developer tools and/or create a template sensor from it if you want some of them to be separate entities. grafik

patman15 commented 2 months ago

I just now released v1.6.0, if you are happy, I would close this issue. Feel free to open a new one, if any topic pops up. Thanks for the excellent cooperation!

Goaheadz commented 2 months ago

No, I thank you for all your time and dedication in this subject. Your the best! You can close the issue.

patman15 commented 2 months ago

Thanks!