Skip to content

Add the ability to read/get information about a stacked Seplos v2 battery system #171

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

Closed
4 tasks done
bogi9999 opened this issue Feb 3, 2025 · 77 comments
Closed
4 tasks done
Labels
enhancement New feature or request

Comments

@bogi9999
Copy link

bogi9999 commented Feb 3, 2025

Checklist

  • I have filled out the template to the best of my ability.
  • I have understood that this integration is only about battery management systems with Bluetooth Low Energy support.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate of any previous feature requests.

Please describe the enhancement you would like to have.

This is a request to read several Seplos Mason 280 battery packs via Bluetooth.
The first pack (master) has Bluetooth, the others are connected to the master via RS485.
In a Setup like that, the master combines the Value SOC of each Pack to a sum of all and send this information to an Energy Storage System Controler (eg. Victron Cerbo) via CAN Bus. The Master knows all values of each Pack and each Cell. You cann access thes information through an bluetooth connection to the master (BP00), and switch then to the next Pack in the Bluetooth App (BP01/02/03.....)
The benefit of this reuquest whould be, to have information of the whole setup for health monitoring of that system.
In my case, i have a setup of five battery-packs available for testing. I am not a developer, but I will contribute to the implementation with a few helpful hints.

Additional context

No response

@bogi9999 bogi9999 added the enhancement New feature or request label Feb 3, 2025
@patman15
Copy link
Owner

patman15 commented Feb 3, 2025

Hi! Thanks for raising the issue. There was a long discussion in #101 about the sub-packs and how to query them. Seems that multiple possible setups are possible.
Anyway, could you please attach a debug log of your setup? The result information should already contain the information about your 5 packs. I can then add further queries to add Infos like I did for the V3 as well.

@bogi9999
Copy link
Author

bogi9999 commented Feb 12, 2025 via email

@patman15
Copy link
Owner

@bogi9999 the attachment did not go through via e-mail, can you please attach it directly to this issue?

@bogi9999
Copy link
Author

@patman15
Copy link
Owner

The problem with the disappearance of the data seems to be the retrieval function of the additional batteries.
There is probably a round trip in BP01, then BP02, then BP03 etc.

I'm not sure what you mean. I can see from the log that you only added BP00, no other device is there. So why do you say the data disappears? When was it available?
The functionality to query all packs via a single BT connection is not yet there, so I'm confused about your question.

@bogi9999
Copy link
Author

The data disappear in the log at 11:51:05 --> 2025-02-13 11:52:05.323 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching BP00 data in 13.126 seconds (success: False)

After a couple minutes it will came back.

@patman15
Copy link
Owner

Ok, got it, I can have a look at it, but this is a different issue than mentioned in the title, so let's open a new one -> #189

@his1220
Copy link

his1220 commented Feb 17, 2025

I will help testing whenever needed. Thanks for your great work!!

@idanny50
Copy link

as I know seplos v2, when in packed, bp00 it is master, and from there you access slaves units. When i connect with phone I only see bp00 pack, I connect to it and then I can change to slave packs and read info about them.

@patman15 patman15 self-assigned this Feb 19, 2025
@patman15 patman15 linked a pull request Feb 21, 2025 that will close this issue
@patman15
Copy link
Owner

@bogi9999, @his1220, and anyone who has a Seplos v2 and is willing to help. I have redone and smoke-tested the new code.
Please install the beta release, see if it does what you expect and be so kind to provide me:

  • any findings you have (deviations of values to the app)
  • info about your setup (how many battery packs in total, how many BT modules, the address of the individual packs)
  • a debug log of a few minutes

As per the definition in the README you should the sensors should provide the overall system information and each sensor (as listed) should have an attribute, providing the individual pack information. Thanks a lot for helping!

Important

This release requires HA version 2025.2.2 or later!

@bogi9999
Copy link
Author

bogi9999 commented Feb 21, 2025

Okay, the result is different than expected.
I now have the capacity of the entire system. So all five packs. Also the total current and the total power as well as the total SoC. But the whole thing is only displayed briefly and the Name is still BP00.
I have cross-checked the displayed information with the Victron Dashboard - the data is valid.
There is only the Information from the "multi-pack" no informations/data from one of the singe packs.
After downgrading to the current release, only one pack is available again.

:edit If debugging is active, the system remains available. If debugging is off, it disappears for about 5 minutes.

home-assistant_bms_ble_2025-02-21T21-59-42.575Z.log

@patman15
Copy link
Owner

patman15 commented Feb 21, 2025

There is only the Information from the "multi-pack" no informations/data from one of the singe packs.

Have you checked the attributes, as mentioned ... and each sensor (as listed) should have an attribute ...?
Anyway, the system does not report all pack information, just the first.

Could you please capture the Bluetooth traffic on Android or iOS while using the app and switch through the pack tabs?
I found an old trace which shows the app queries the pack information from another Bluetooth module. So I fear the effort from the last days to implement this is lost. But let's see.

@patman15
Copy link
Owner

@bogi9999 any follow up action you want me to take?

@patman15 patman15 removed their assignment Feb 28, 2025
@bogi9999
Copy link
Author

bogi9999 commented Mar 2, 2025

@patman15 Sorry, I was away for a few days.
I'm not sure whether the access to the data of the “slaves” with the V3 BMS also works with the V2 BMS.
I can't actually select them in the App. I can only select BP00 and the sum of all data. The total is also currently displayed. If someone is reading along here who also has several V2 BMS, could they perhaps create a log?

@andreas-bulling
Copy link

According to this repository/tool, access to multiple batteries should be possible through rs485
https://github.com/mworion/dbus-seplos

@bogi9999
Copy link
Author

bogi9999 commented Mar 3, 2025

According to this repository/tool, access to multiple batteries should be possible through rs485 https://github.com/mworion/dbus-seplos

Of course this is an option, but unfortunately it does not work for the master if it is connected to the PV system via CAN. Then only the BP01-BPxx packs are available.

@andreas-bulling
Copy link

As far as I understand, reading out both batteries via RS485 should work?!

@bogi9999
Copy link
Author

bogi9999 commented Mar 3, 2025

I use more than two of these packs. And as soon as the master is connected to CAN, it can no longer be read out via RS485, but via Bluetooth. Only the slaves can still be accessed via RS485.
In addition, only one RS485 connection is possible. And I need the connection primarily for the Cerbo (in my case the Victron CAN protocol). The Bluetooth option would be to monitor the health of the cells/packs.

:edit
Okay, i See, that this is a Modifikation for the Cerbo itself.
I should take a deeper Look about that.

@patman15
Copy link
Owner

patman15 commented Mar 4, 2025

Hi @bogi9999, @andreas-bulling! My main question is: is it possible to query the cell states of packs other than the main (BP00) through the BP00? There are commands to query the packs (you can give the number in the query). This would mean that there is some sort of connection between the packs and the master. So far all packs were queried individually using BP00, BP01, ... but there are users who have only one Bluetooth module.
Can someone investigate, clarify, provide logs ... ?

@bogi9999
Copy link
Author

bogi9999 commented Mar 5, 2025

Hi @patman15
I get the other packs displayed, if I want to select them, an error message appears, presumably in Chinese. I can select BP00 or “Multi” which is the sum of all packs.
In my case, only the master actually has a Bluetooth module.

@patman15
Copy link
Owner

patman15 commented Mar 5, 2025

Hi @bogi9999 ,

Now I'm confused, in the formulation of this request you wrote:

The Master knows all values of each Pack and each Cell. You cann access thes information through an bluetooth connection to the master (BP00), and switch then to the next Pack in the Bluetooth App (BP01/02/03.....)

but now you say:

I get the other packs displayed, if I want to select them, an error message appears, presumably in Chinese. I can select BP00 or “Multi” which is the sum of all packs. In my case, only the master actually has a Bluetooth module.

In the logs of the modified version I can clearly see that asking the master for data from the other packs just returns the information of the first (master) pack. Numbers are just identical, as I think I saw also when doing the original implementation.

So can you please summarize your view, because mine is, the app does not show other data, the commands just deliver x-times the same, so in my opinion, you cannot ask the master for the other packs in Seplos v2 (v3 works).
Unless, there is an additional issue, e.g. addressing. I assume addresses 0, 1, 2, 3, ...
Maybe you want to use Google translate to figure out what the error message means?

Please let me know how you think this can work. Unfortunately, I do not see much input from other Seplos v2 users that could clarify this issue.

@bogi9999
Copy link
Author

bogi9999 commented Mar 5, 2025

Hi @patman15
But it is as I say. The master has all the information for the slave packs, because it outputs total information for all packs.
I've been getting this information since your last update.
Previously, I only had the information from the master itself, i.e. from BP00.
What can I say. On the other hand, I can reach and read out all the slaves via the RS485 port on the master.
I'll try to take a screenshot of the message/app later.

@patman15
Copy link
Owner

patman15 commented Mar 5, 2025

But it is as I say. The master has all the information for the slave packs, because it outputs total information for all packs.

Via CAN or RS485 you mean? Can be, but maybe the information is internally not provided to the BT module that is what needs to be clarified.

I've been getting this information since your last update.

I know there is some information. But, emphasizing my previous message, did you notice that the voltage level of cell 0 is equal to 16 to 32 and 48? Same for cell 1, 17, 33, 49. Also SoC and current are equal among all packs. So I highly doubt this is correct information.

@bogi9999
Copy link
Author

bogi9999 commented Mar 5, 2025

Image

Image

Image

Image

Image

The message is "Equipment not asked for, No. re-sweep"

@Tulexcorp
Copy link

Tulexcorp commented Apr 16, 2025

Just wanted to verify something. As noted earlier, because HA doesn't play well with some Realtek bluetooth adapters, I can only have one devise on that adapter, and it HAS to be the master battery. Any other combination breaks it. Knowing that, I realized having the Realtek adapter still in play could be causing issues, even though it's not breaking the readings. So, I removed one battery from the approved bluetooth adapter and moved the master to that adapter, allowing me to disable the Realtek adapter. Rebooted the system. Of the 4 slaves that I can now see, the results are still the same. Eight of the entities still show no values for the slaves.

@patman15
Copy link
Owner

Hey @Tulexcorp, your data is incredibly helpful! Thanks a lot! I had one parsing error, mostly due to incorrect test data. No idea, where I had that from, but I could now fix it hopefully. Can you check again with the updated branch? Basically, you should find all data in the attributes of the BP00 device. I just kept the other device to verify how they behave, so in theory you should be able to ignore them.
Please provide me a debug log again!

@Tulexcorp
Copy link

Log below for just the master battery installed. One device, 13 entities. I can see 96 values under attributes for cell delta. Because it only reports 2 places in attribues, I can't tell if what the entity is reporting is the master battery or some kind of average. Other entities also list multiple attributes, but don't think they are correct. For example, current might show as 2 amps for current entity, but attributes all show 0.

home-assistant_bms_ble_2025-04-16T17-08-34.291Z.log

Will install the others and send a log.

@Tulexcorp
Copy link

home-assistant_bms_ble_2025-04-16T17-22-16.492Z.log

Log with master and 4 slaves. Attributes stayed the same for master battery, but no attributes available for slaves. Same results, no values for slave batteries for most entities.

@patman15
Copy link
Owner

@Tulexcorp thanks, for the info, it now worked correctly, but the BMS just returned one pack of data but that multiple times. I did a further update to not use the battery address but the group, can you try again?
If that brings no success, could you please see if you are able to capture the Bluetooth traffic on Android or iOS while using the vendor app with the battery and walking through all the packs?
If that brings no success, I need to give up and keep the current setup with all packs kept separate devices. Anyway this thread will come soon to an end. 😌

@Tulexcorp
Copy link

Don't think there is any difference. Both master only and with slaves logs.

home-assistant_bms_ble_2025-04-16T19-16-18.095Z.log
home-assistant_bms_ble_2025-04-16T19-08-03.226Z.log

Not sure what you are asking for with capturing the bluetooth traffic on the android app.

@Tulexcorp
Copy link

I went into the bluetooth app. Won't connect if HA is connected to it, which makes sense. There is no logging ability. There is the ability to view it as multi which sees it as one big battery, or each individual battery. Everything looked normal.

I'm good with using the regular version. The only real benefit to what I believe you are trying to do here is to eliminate using multiple slots. Only really an issue if you are running other bluetooth items or have a lot of batteries.

@patman15
Copy link
Owner

Thanks for the logs, the master still does not report the other packages, just clones of it's own battery values. 😞

I went into the bluetooth app. Won't connect if HA is connected to it, which makes sense. There is no logging ability. There is the ability to view it as multi which sees it as one big battery, or each individual battery. Everything looked normal.

I had it in my previous comment, here are two links on how to capture the Bluetooth traffic on Android or iOS.

There is the ability to view it as multi which sees it as one big battery, or each individual battery. Everything looked normal.

I'd need a recording of the BT traffic when using this view, this is the last chance to figure out whether also the app uses multiple BT connection at the same time.

I'm good with using the regular version. The only real benefit to what I believe you are trying to do here is to eliminate using multiple slots. Only really an issue if you are running other bluetooth items or have a lot of batteries.

That and the fact that you get e.g. the current automatically summed up. All other BMSs do it like this, even Seplos v3.

@Tulexcorp
Copy link

Sorry, didn't catch that those were links. I installed wireshark and followed the directions. I thought I captured the bluetooth, but it doesn't create a log I can read or at least understand. Or, it's above my head and I'm doing it wrong. Is a .pcapng file what you would be looking for?

@patman15
Copy link
Owner

Is a .pcapng file what you would be looking for?

Yes. that sounds good to me!

@Tulexcorp
Copy link

seplos.txt

You will have to rename it as a .pcapng file as it wouldn't let me attach it as was.

@patman15
Copy link
Owner

@Tulexcorp file is readable, but USB communication, not the BT traffic. Are you sure you selected the right interface when recording?

@Tulexcorp
Copy link

I will try again. As I can't tell what it is, I have no idea what I'm sending. The directions make it sound simple, but in reality, setting up Wireshark and using it is not intuitive.

@patman15
Copy link
Owner

Sorry, for that. As I'm no iOS user, I cannot help more here.

@Tulexcorp
Copy link

Unless someone can walk me through the setup, I don't believe I can help with this. The directions say:

"Helpfully, newer versions of Wireshark include an androiddump utility to capture Bluetooth traffic directly from Android phones. The setup couldn't be simpler: connect the phone to the computer via USB, enable USB debugging, select the "Android Bluetooth" capture source in Wireshark, and start recording!"

If you click on the androiddump link, it says:

androiddump(1) Manual Page
NAME
androiddump - Provide interfaces to capture from Android devices

SYNOPSIS
androiddump [ --help ] [ --version ] [ --extcap-version ] [ --debug ] [ --extcap-interfaces ] [ --extcap-dlts ] [ --extcap-interface= ] [ --extcap-config ] [ --extcap-capture-filter= ] [ --capture ] [ --fifo= ] [ --adb-server-ip= ] [ --adb-server-tcp-port= ] [ --logcat-text= ] [ --bt-server-tcp-port= ] [ --bt-forward-socket= ] [ --bt-local-ip= ] [ --bt-local-tcp-port= ]

androiddump --extcap-interfaces [ --adb-server-ip= ] [ --adb-server-tcp-port= ]

androiddump --extcap-interface= [ --extcap-dlts ]

androiddump --extcap-interface= [ --extcap-config ]

androiddump --extcap-interface= --fifo= --capture

DESCRIPTION
Androiddump is a extcap tool that provide interfaces to capture from an Android device. There are only two requirements:

  1. You must have the Android SDK and add it to your PATH environment variable. PATH should contain directory with tools like "adb" and "android". Android SDK for various platform are available on: https://developer.android.com/sdk/index.html#Other

  2. You must have permission to capture from the Android device. Some Android devices require on-screen authentication.

Don't know if all the synopsis doesn't apply as it's part of Wireshark
Don't know about Android SDK at all. Have it where, and about adding it to what path?

Simply, I don't see an actual setting in wireshark to enable USB debugging, and I don't see Android bluetooth as an option.

@patman15
Copy link
Owner

patman15 commented Apr 18, 2025

And why don't you use my suggestion to capture the Bluetooth traffic on Android? It's much simpler, do the second part with the bullet points ...
Have you enabled BT debugging on the phone?

@Tulexcorp
Copy link

Your link takes me to a page about using wireshark. Only further down does it reference using the android to capture. I tried to capture with the phone. I can't find the file. Reading further, it talks about using the SDK and rooting the phone. Not rooting my phone, so don't appear to have access to the log file.

@Tulexcorp
Copy link

Pat,

I've gone down the worm hole about as far as I can. I installed Android studio to get to the phone, I simply am not tech savvy enough to follow all of this. Every step introduces more steps that become more technical. Hopefully someone will come along that understands what to do and will be able to help you out.

@Tulexcorp
Copy link

Ok, because it irritates me when I can't figure things out, I dove deeper. Maybe one of these are what you are looking for.

btsnoop_hci.log

1btsnoop_hci.log

@patman15
Copy link
Owner

💯 pefect! I can see the right data, will investigate tomorrow. Thanks!

@patman15
Copy link
Owner

@Tulexcorp thanks a lot for your help! Unfortunately it proofed to be true that there is no way to receive all data from the masters BT module. Thus, I will keep the solution with separate devices and just merge a few fixes that I could gather from all your data. Thanks a lot again, your data was very valuable!
@bogi9999 FYI

@patman15 patman15 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 19, 2025
@Tulexcorp
Copy link

Well, that's a bummer. I can see the benefit of only taking up one slot, as I've noticed the bluetooth keeps randomly dropping and picking up various BMSs. Will have to play with that. Will take a look at the latest version. Thanks again for trying.

@bogi9999
Copy link
Author

bogi9999 commented Apr 19, 2025

Well, that's a bummer.

It is.
I already suspected this during the first tests.
Well, the version with two ESP32 with RS485-UART interfaces has been running successfully ever since.
@patman15
Thanks for your efford.

@maps0n
Copy link

maps0n commented Apr 20, 2025

.Well, the version with two ESP32 with RS485-UART interfaces has been running successfully ever since.

Where are more information regarding this approach?

@Privatecoder
Copy link

@Privatecoder does this mean that with the right cabling, the BT module of the master should be able to provide the information of all packs? So far I could not see a prove for that. Would you, by any chance, be able to test my BT implementation? Thanks, Patrick

You know what, I will try this next month. I have no clue on how the BT module works, but if it fetches the data from the second RS485-bus and we combine all packs through this second bus, there is a chance this could work.

@Privatecoder
Copy link

Also there is always the intra-pack communication (cid2=0x5A) available which is not as detailed as the cid2=0x42 responses (no per-cell voltages and other missing things) – see here.

@bogi9999
Copy link
Author

bogi9999 commented Apr 20, 2025

Where are more information regarding this approach?
@maps0n

Starts here
The Yaml Info for the ESP32 cann be found here
The wiring of the ESP32-RS485 can be found here
Use the second rs485 module.

@patman15
Copy link
Owner

You know what, I will try this next month. I have no clue on how the BT module works, but if it fetches the data from the second RS485-bus and we combine all packs through this second bus, there is a chance this could work.

Ok, just ping me if you want to try something, for the moment I will stop the efforts, as even the app does not go via the master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants