fl4p / batmon-ha

Add-on for Home Assistant to connect JK, JBD, Daly, ANT, SOK and Supervolt BMS via Bluetooth
MIT License
246 stars 53 forks source link

Feature Request: Set SoC (Daly) #144

Open XDGFX opened 9 months ago

XDGFX commented 9 months ago

I've just started using this in a standalone Docker container and so far it's working great!

I would like to suggest adding the ability to set state of charge of the BMS.

This would be useful as my Daly BMS ignores current below ~2.5A, and resultantly after a few weeks the reported SoC is up to 20-30% off the real value. When I get a low voltage cut-off, it would be good to be able to reset the SoC to 0%, which I would normally do through the app but obviously cannot if batmon is currently connected to the BMS.

Great work, thanks again!

fl4p commented 9 months ago

if you disable keep_alive and set sample_period to a couple of seconds you can still connect with your phone

fl4p commented 9 months ago

doesn't daly set SoC to 0 when it reaches uv protection?

XDGFX commented 9 months ago

Good to know, I set keep_alive to true when I was trying to get a good connection, but maybe I will test with it disabled as well.

Nope, annoyingly it doesn't. It does seem to set to 100% on overvolt protection though.

fl4p commented 7 months ago

Just curious, what are the SoC levels reported by the BMS when UV protection hits? If it is always lets say 5%, you can reduce the capacity in the bms settings and it"ll better predict when battery is empty.

For reference, here is the UART documentation for Daly BMS, it misses a SoC write entpoint (it doesn’t include the codes for settings the switches neither though). For sure there is one, because the app has that function. Need to rever-engineer that, or do you know any app that implements that?

v1.1 Daly RS485+UART Protocol.pdf

Daly UART_485 Communications Protocol V1.2 (2).pdf

XDGFX commented 7 months ago

It varies, as it gets more out of sync over time. Normally around 30% SoC as it's been a couple of weeks since a full charge, but I had UV hit this morning at 70% SoC as it's been about a month and I've been balancing the charge level when I've been driving.

I don't know of any other apps that have done it sadly. I'm not too experienced with bluetooth programming, would the options be listen with a third device when that BT command is sent, or connect to and monitor the UART on the BMS end?

verjoz commented 4 months ago

It would be a very useful feature, i have the same problem :+1:

7wells commented 4 months ago

@XDGFX

would the options be listen with a third device when that BT command is sent, or connect to and monitor the UART on the BMS end?

The (Android) app nRF Connect for Mobile is a very powerful tool. I'm no expert in using it, though.