-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Trouble connecting using bluetooth proxy with a LithTech battery (same Bluetooth as Electronicx battery) #187
Comments
Hi! Thanks for the info, I will check against the Elektronicx battery implementation and provide an update soon. |
Let me know if you need any other logs or info. Thanks! Btw there are a few apps for different batteries which work with these Lithtech batteries I have. So possibly a common BMS Bluetooth module across them. Eg Volithium - https://play.google.com/store/apps/details?id=com.bluetooth.voltium.bmsforAndroid Generic app on the play store Other manufacturers apks I found to work: |
@jc259, I fixed the detection given that the battery really uses the same protocol. Can you try the attached branch via manual install?
Not sure, because your snippet |
@patman15 I put the code in manually and it picked up the two batteries and I was able to get the addon running when I added them. But data isn't coming through properly. Everything is showing as unavailable for the main sensors view. I did "once" see a full set of data show up but haven't seen it since. If I click on each sensor I can see some history and download data entity_id state last_changed Is there any way for me to get you a screen shot. I just realized, a few other batteries I have start with LT- Eg: Are you able to add the LT- format as well? Thank for helping with this! |
Grabbed a sample of the advertisement for the other batteries that are not showing up. {"name":"LT-12V-0002\r\n","address":"05:23:01:64:00:B1","rssi":-94,"manufacturer_data":{},"service_data":{},"service_uuids":[],"source":"D0:EF:76:34:04:20","connectable":true,"time":1739317503.3669958,"tx_power":5} These two use LT- where the other two I started off investiging use L- |
Update on the two batteries that are connecting to the BLE plugin (ie the ones that start with L-12V......... ). I read through the closed issues for Electronicx and found that previously someone noted the battery was not displaying data in the BLE plugin if the battery wasn't charging or discharging. Seems this might be the case with these as well. As soon as I put a charger on the battery I am seeing consistent sensor data, instead of the sensors showing unavailable when the battery is just sitting on its own. Is this a result of how the plugin handles being denied a connection to the bluetooth of the BMS? Could this be due to the BMS bluetooth limiting how often the connection can be established? Is there any chance the plugin could hold the most recent value instead of storing unavailable for the latest connection data? I've attached some snippets of logs for two cases:
Not sure if I grabbed useful sections or not but figured something was better then nothing. |
For me this, together with your low
Yes, done, branch updated. Note, with more than 3 batteries, you will run into the BT proxy connection limit!
Since your battery is not consistently offline, I would first guess for an connection quality issue.
That doesn't make sense, as the integration, like any other in HA, is supposed to report missing values. In normal conditions the integration tries to reestablish the connection every 30s. Best regards, |
HI Patrick, Adding the new battery format LT-12...... worked great, thanks!. I can see them all now so long as there aren't too many batteries enabled in the plugin at once as I only have one bluetooth proxy in the room where all the batteries are. From your previous note about signal strength - the bluetooth proxy is right beside my battery for the testing I am doing now and I moved the proxy much closer to my wifi router. I disabled all batteries except one and did some testing..... Immediately after plugging a charger into the battery the sensor values show up for all sensors. And if you remove the charger the values reset back to "UNAVAILABLE" . I think what is happening is the BMS bluetooth used in these batteries (Lithtech, Electronix, etc) is only allowing a poll of the data at a set interval (likely to save power) when the battery is sitting idle (ie not charging). This interval means 99% of the time the sensors show "UNAVAILABLE" since the plujgin is trying to get data it isn't allowed. The problem is in general lots of these batteries will not be sitting in a charging state and the idea of the plugin at least for me is to be able to check on the state of charge, monitor cell in balances and then create some automations to alert me. Would it be possible in your plugin for these type of batteries bluetooth - to not update values with UNAVAILABLE when it can't get data? Another thing I thought of was could the polling interval be a config in the plugin per battery so that we could reduce how often the plugin polls for the data in general? Thanks again for all this work, the plug in is a great tool. If you want more logs just let me know. Hold that thought. I am going to test some more as I think I am seeing discrepancies between the two battery types when I started looking at the logs. I'll get back to you with an update. |
Is the app able to connect when the BMS is idling? If so, can you get me a BT communication recording of that? |
I did some more testing - added some notes in a text file I attached and a log of just the BLE plugin debug data. It seems the battery is showing connected but not getting data a short period after the connection to home assistant is made. If you reload the individual battery in the BLE intergration you get a correct data reading and the sensors populate. What could I use to capture the bluetooth logs between the Android phone and the battery when it's sitting idle with the app open? To see if the app is taking updates or not? home-assistant_2025-02-13T01-29-47.553Z.log |
I can confirm what you said. Obviously, the BT connection is still alive, but the BMS seems to go to sleep mode. A reconnect seems to solve the issue. Maybe there is some sort of keep-awake command that is missing. Let's see from the app, if possible. Thanks, |
Hi Patrick, I grabbed a log with nRF connect. Not sure if is helpful or not. I have attached it. This was with the app sitting open connected to the battery. I can't really tell if it just captured the first read and then held it. I can do another test with a charger connected if you want. |
Hi, Ran one more test where i: I attached the log and an summary of what I did with time stamps. |
Hi! I looked at the logs but there is nothing special in it, but I'm not sure the nRF connect captured all necessary information, especially at the beginning of the communication. Can you try it using these methods? Android or iOS |
No luck with the latest change. It still goes to showing UNAVAILABLE after about 5 mins. I didn't notice you put links previously, I'll try that method to capture the bluetooth communication between the phone app and the battery and update you. |
Checklist
Please describe the enhancement you would like to have.
I have a battery from Lithtech Energy (China company). The battery Bluetooth uses the same name format as the Electronicx batteries. LT-........ I am able to connect the Electronicx app to my battery (https://play.google.com/store/apps/details?id=com.battery.electronicxlifepo4&hl=en_CA) and view all the stats the same way the original bluetooth android app does I was provided by the Chinese company.
I can see the battery in my bluetooth proxy advertisement data
{"name":"L-12V100AH-0902","address":"02:00:07:B5:4B:1D","rssi":-87,"manufacturer_data":{},"service_data":{},"service_uuids":[],"source":"D0:EF:76:34:04:20","connectable":true,"time":1739233329.3303301,"tx_power":5}
But when I try and add the BLE battery Management integration it just says "No supported devices found via Bluetooth"
I am not sure if I need to somehow pair the battery as I don't see the battery blueetooth address showing up in the proxy log "02:00:07:B5:4B:1D"?
I know the bluetooth proxy is working as I have a Victron battery monitor that is connecting through it to another plugin.
If I edit my bluetooth proxy device in ESPhome in Home assistant I get this which is where I believe I need to put active: true;
substitutions:
name: esp32-bluetooth-proxy-26792c
friendly_name: Garage-26792c-BLE Proxy
packages:
esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic/esp32-generic.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
api:
encryption:
key: m2aEMORqcQnh6HSR1W3cvdYQUb6UKANY6uhleJb=
web_server:
port: 80
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
bluetooth_proxy:
active: true
Additional context
No response
The text was updated successfully, but these errors were encountered: