diff --git a/CHANGELOG.md b/CHANGELOG.md index dc057c94..c6a50ae1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/etc/dbus-serialbattery/bms/daly.py b/etc/dbus-serialbattery/bms/daly.py index 1f67e7c8..d68eac78 100644 --- a/etc/dbus-serialbattery/bms/daly.py +++ b/etc/dbus-serialbattery/bms/daly.py @@ -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") diff --git a/etc/dbus-serialbattery/config.default.ini b/etc/dbus-serialbattery/config.default.ini index 96cd90f4..59dc3be0 100644 --- a/etc/dbus-serialbattery/config.default.ini +++ b/etc/dbus-serialbattery/config.default.ini @@ -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 diff --git a/etc/dbus-serialbattery/utils.py b/etc/dbus-serialbattery/utils.py index 2a7a57a9..fb7a93fd 100644 --- a/etc/dbus-serialbattery/utils.py +++ b/etc/dbus-serialbattery/utils.py @@ -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}" @@ -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"])