Xiaoxiang bms

Sweet! Couldn’t get it to run on the DietPi install but the other Pi has full Pi OS and runs it fine. Now to cut down the refresh and manually add everything to HA unless there’s an easy way to get it automatically added.

I find the bluetooth connection very hit and miss but its still a great start for the add-on!
@penguinponics share your dashboard screenshot when you get some added so we can come up with i “template” that works best

1 Like

Yeah, the Bluetooth was definitely causing some hiccups. Running @flap 's code on the one Pi caused some hangups when it is barely 10 feet away. The DietPi running the other script seems to be more reliable but the MQTT paths are JSON and a mess to try and integrate when I don’t know HA as well as I knew OpenHAB.
EDIT: I went back to the one mentioned here. I’ll let it run overnight and through tomorrow to see how it gets along before going wild modifying my panel.

So the standalone via Bluetooth did eventually die (9 hours ago according to my stats). Logged into the remote Pi and it said too many errors. May have to see if I have the right JST connector and physically plug it in.

Yeah Developer @flap said he was going to increase error count so it wouldnt crash but have not seen the update yet.

21 39 hours later the other script is still working so maybe @flap will see something beneficial in the other code. I wish I wasn’t so dumb when it comes to programming.

1 Like

Been running great for days now here…
added my solar controller to the page also but still need a better layout

I gotta say, Bluetooth is arse. At least the UART dongles. Even the other script eventually fails but does run longer. Only pair it with one Pi or the other. One is 3 feet tops, the other is 10 feet away. Neither has any other Bluetooth devices paired.

I think the current Bluetooth integration is still buggy I’m sure they will get it working properly.
Others having similar problems here:

It’s not an HA problem since I’m running the standalone and another script on two different Pis. Both just send data over MQTT. The script here I run on headless Raspberry Pi OS and it connects fine just won’t last an entire day. The other script I mentioned runs on a headless DietPi install and works a little longer but eventually fails as well. So, Bluetooth and/or the bluetooth UART are the problem since I don’t have another Bluetooth device to test long term connectivity with.

Wow good job boys! I managed to install the Batmon along with the bluetooth services. I’m using a test MQTT broker Mosquito.

I see the following on the log:
INFO [sampling.py:60] batteryX volt=4001,4002,4003,4003,4003,4001,4003,4001,4002,3999,4003,4004,4004,4004 temp=[24.0, 25.8]

I can’t find a way to see it on my dashboard… how do I find these entities? Under MQTT or the Batmon addon?

Thanks!

Search for the battery x under devices or entities

hi Jason,

I just hit another issue where it’s jam my battery BMS and I need to remove/re-install the Bluetooth dongle. This is a known issues and it’s ok. Now I’m having another issue where I’m not sure it’s actually connecting to my MQTT core Mosquitto and I can see any data of the BMS.

Here’s the log:
INFO [bt.py:53] BMS JbdBt(A4:C1:38:D6:5B:A1) keep alive enabled
INFO [main.py:160] connecting mqtt root@core-mosquitto
INFO [sampling.py:33] connecting bms JbdBt(A4:C1:38:D6:5B:A1)
INFO [sampling.py:39] connected bms JbdBt(A4:C1:38:D6:5B:A1)!
ERROR [sampling.py:70] batteryXXXXX error: <class ‘asyncio.exceptions.TimeoutError’>
ERROR [sampling.py:70] batteryXXXXX error: 3 already waiting
ERROR [main.py:93] Error (num 1) reading BMS: 3 already waiting
ERROR [main.py:94] Stack: Traceback (most recent call last):
File “/app/main.py”, line 89, in fetch_loop
await fn()
File “/app/bmslib/sampling.py”, line 24, in call
return await self.sample()
File “/app/bmslib/sampling.py”, line 41, in sample
sample = await bms.fetch()
File “/app/bmslib/jbd.py”, line 65, in fetch
buf = await self._q(cmd=0x03)
File “/app/bmslib/jbd.py”, line 54, in _q
assert cmd not in self._fetch_futures, “%s already waiting” % cmd
AssertionError: 3 already waiting
ERROR [sampling.py:70] batteryXXXXX error: 3 already waiting
ERROR [main.py:93] Error (num 2) reading BMS: 3 already waiting
ERROR [main.py:94] Stack: Traceback (most recent call last):
File “/app/main.py”, line 89, in fetch_loop
await fn()
File “/app/bmslib/sampling.py”, line 24, in call
return await self.sample()
File “/app/bmslib/sampling.py”, line 41, in sample
sample = await bms.fetch()
File “/app/bmslib/jbd.py”, line 65, in fetch
buf = await self._q(cmd=0x03)
File “/app/bmslib/jbd.py”, line 54, in _q
assert cmd not in self._fetch_futures, “%s already waiting” % cmd
AssertionError: 3 already waiting
ERROR [sampling.py:70] batteryXXXXX error: 3 already waiting
ERROR [main.py:93] Error (num 3) reading BMS: 3 already waiting
ERROR [main.py:94] Stack: Traceback (most recent call last):
File “/app/main.py”, line 89, in fetch_loop
await fn()
File “/app/bmslib/sampling.py”, line 24, in call
return await self.sample()
File “/app/bmslib/sampling.py”, line 41, in sample
sample = await bms.fetch()
File “/app/bmslib/jbd.py”, line 65, in fetch
buf = await self._q(cmd=0x03)
File “/app/bmslib/jbd.py”, line 54, in _q
assert cmd not in self._fetch_futures, “%s already waiting” % cmd
AssertionError: 3 already waiting
ERROR [sampling.py:70] batteryXXXXX error: 3 already waiting
ERROR [main.py:93] Error (num 4) reading BMS: 3 already waiting
ERROR [main.py:94] Stack: Traceback (most recent call last):
File “/app/main.py”, line 89, in fetch_loop
await fn()
File “/app/bmslib/sampling.py”, line 24, in call
return await self.sample()
File “/app/bmslib/sampling.py”, line 41, in sample
sample = await bms.fetch()
File “/app/bmslib/jbd.py”, line 65, in fetch
buf = await self._q(cmd=0x03)
File “/app/bmslib/jbd.py”, line 54, in _q
assert cmd not in self._fetch_futures, “%s already waiting” % cmd
AssertionError: 3 already waiting
ERROR [sampling.py:70] batteryXXXXX error: 3 already waiting
ERROR [main.py:93] Error (num 5) reading BMS: 3 already waiting
ERROR [main.py:94] Stack: Traceback (most recent call last):
File “/app/main.py”, line 89, in fetch_loop
await fn()
File “/app/bmslib/sampling.py”, line 24, in call
return await self.sample()
File “/app/bmslib/sampling.py”, line 41, in sample
sample = await bms.fetch()
File “/app/bmslib/jbd.py”, line 65, in fetch
buf = await self._q(cmd=0x03)
File “/app/bmslib/jbd.py”, line 54, in _q
assert cmd not in self._fetch_futures, “%s already waiting” % cmd
AssertionError: 3 already waiting
WARNING [main.py:96] too many errors, abort
INFO [main.py:216] Disconnecting JbdBt(A4:C1:38:D6:5B:A1)
WARNING [bt.py:16] BMS JbdBt(A4:C1:38:D6:5B:A1) disconnected!
INFO [main.py:224] exit signal handler…
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

.37 is supposed to address the already waiting issue.

I have not tested it

Hello,

I don’t see this version available on the add on store. I tried to reboot, delete repository & application, reinstall everything and I’still don’t see 0.37. Only 0.36 is available for installation.

Am I the only one who’s having this issue?

HA core and OS are up to date.

Thanks

Manually install it it’s not in add on store as update yet. Or wait for the update in store

thanks for the quick reply!

I never installed any application manually on HA. I did some research on google/Youtube and couldn’t find any tutorial on how to install addon manually.

Do you have any thing in writing on how to perform a manual addon installation?

I’m running HA on a Rasp pi4.

Hi Jason,

Do you know what is the time frame to have the addon update on the Store?

HA just released a new update and the addon Batmon appeared right after the update.

So far, it’s working flawlessly on the 2 set of battery I configured!! Amazing app.

Thanks

I dont think HA update fixes Bluetooth driver issue yet… so I’m assuming it will still be a problem.