Skip to content

Commit

Permalink
Fixes #1072
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jun 3, 2024
1 parent 1fff640 commit c0cae90
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* Changed: Fixed SoC is None on driver startup https://github.com/mr-manuel/venus-os_dbus-serialbattery/issues/32 by @mr-manuel
* Changed: JKBMS BLE - Fixed problem with second temperature sensor, which was introduced with `v1.1.20240128dev` https://github.com/mr-manuel/venus-os_dbus-serialbattery/issues/26 by @mr-manuel
* Changed: Optimized SOC reset to 100% and 0% when `SOC_CALCULATION` is enabled by @mr-manuel
* Changed: Seplos BMS - Fixed temperature display https://github.com/Louisvdw/dbus-serialbattery/issues/1072 by @wollew


## v1.2.20240408
Expand Down
36 changes: 24 additions & 12 deletions etc/dbus-serialbattery/bms/seplos.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,35 @@ def decode_status_data(self, data):
)
self.cells[i].voltage = voltage
logger.debug("Voltage cell[{}]={}V".format(i, voltage))
for i in range(min(4, self.cell_count)):
temp = (
Seplos.int_from_2byte_hex_ascii(data, temps_offset + i * 4) - 2731
) / 10
self.cells[i].temp = temp
logger.debug("Temp cell[{}]={}°C".format(i, temp))

self.temp1 = (
Seplos.int_from_2byte_hex_ascii(data, temps_offset + 4 * 4) - 2731
Seplos.int_from_2byte_hex_ascii(data, temps_offset + 0 * 4) - 2731
) / 10
self.temp2 = (
Seplos.int_from_2byte_hex_ascii(data, temps_offset + 1 * 4) - 2731
) / 10
self.temp3 = (
Seplos.int_from_2byte_hex_ascii(data, temps_offset + 2 * 4) - 2731
) / 10
self.temp4 = (
Seplos.int_from_2byte_hex_ascii(data, temps_offset + 3 * 4) - 2731
) / 10
temp_environment = (
Seplos.int_from_2byte_hex_ascii(data, temps_offset + 4 * 4) - 2731
) / 10 # currently not available in the Battery class
self.temp_mos = (
Seplos.int_from_2byte_hex_ascii(data, temps_offset + 5 * 4) - 2731
) / 10
logger.debug("Temp cell1={}°C".format(self.temp1))
logger.debug("Temp cell2={}°C".format(self.temp2))
logger.debug("Temp cell3={}°C".format(self.temp3))
logger.debug("Temp cell4={}°C".format(self.temp4))
logger.debug(
"Environment temp = {}°C, Power/MOSFET temp = {}°C".format(
temp_environment, self.temp_mos
)
)

self.current = (
Seplos.int_from_2byte_hex_ascii(data, offset=96, signed=True) / 100
)
Expand All @@ -261,11 +278,6 @@ def decode_status_data(self, data):
)
)
logger.debug("Cycles = {}".format(self.cycles))
logger.debug(
"Environment temp = {}°C , Power temp = {}°C".format(
self.temp1, self.temp2
)
)
logger.debug("HW:" + self.hardware_version)

return True
Expand Down
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _get_list_from_config(


# Constants
DRIVER_VERSION = "1.3.20240602dev"
DRIVER_VERSION = "1.3.20240603dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

Expand Down

0 comments on commit c0cae90

Please sign in to comment.