Skip to content

Commit

Permalink
Daly BMS make auto reset soc configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jun 20, 2023
1 parent e950009 commit b384400
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v1.0.x
* Added: Bluetooth: Show signal strength of BMS in log by @mr-manuel
* Added: Create unique identifier, if not provided from BMS by @mr-manuel
* Added: Daly BMS: Auto reset SoC when changing to float (can be turned off in the config file) by @transistorgit
* Added: Exclude a device from beeing used by the dbus-serialbattery driver by @mr-manuel
* Added: Implement callback function for update by @seidler2547
* Added: JKBMS BLE - Show last five characters from the MAC address in the custom name (which is displayed in the device list) by @mr-manuel
Expand Down
3 changes: 2 additions & 1 deletion etc/dbus-serialbattery/bms/daly.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ def refresh_data(self):

self.write_charge_discharge_mos(ser)

self.update_soc(ser)
if utils.AUTO_RESET_SOC:
self.update_soc(ser)

except OSError:
logger.warning("Couldn't open serial port")
Expand Down
5 changes: 5 additions & 0 deletions etc/dbus-serialbattery/config.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ EXCLUDED_DEVICES =
; /dev/ttyUSB0:My first battery,/dev/ttyUSB1:My second battery
CUSTOM_BATTERY_NAMES =

; Auto reset SoC
; If on, then SoC is reset to 100%, if the value switches from absorption to float voltage
; Currently only working for Daly BMS
AUTO_RESET_SOC = True

; Publish the config settings to the dbus path "/Info/Config/"
PUBLISH_CONFIG_VALUES = 1

Expand Down
7 changes: 6 additions & 1 deletion etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _get_list_from_config(


# Constants - Need to dynamically get them in future
DRIVER_VERSION = "1.0.20230617dev"
DRIVER_VERSION = "1.0.20230620dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

Expand Down Expand Up @@ -298,6 +298,11 @@ def _get_list_from_config(
"DEFAULT", "CUSTOM_BATTERY_NAMES", lambda v: str(v)
)

# Auto reset SoC
# If on, then SoC is reset to 100%, if the value switches from absorption to float voltage
# Currently only working for Daly BMS
AUTO_RESET_SOC = "True" == config["DEFAULT"]["AUTO_RESET_SOC"]

# Publish the config settings to the dbus path "/Info/Config/"
PUBLISH_CONFIG_VALUES = int(config["DEFAULT"]["PUBLISH_CONFIG_VALUES"])

Expand Down

0 comments on commit b384400

Please sign in to comment.