Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of automatic SOC reset for JK BMS Bluetooth only (HW Version 11) #736

Merged
merged 11 commits into from
Sep 17, 2023

Conversation

ArendsM
Copy link
Contributor

@ArendsM ArendsM commented Jun 27, 2023

This will add a feature to automatically reset SOC of JK BMS based on the manage_charge_voltage calculations.

Warning: This will modify OVP and OVPR settings of your BMS when enabled. Use it at your own risk!

The feature is disabled by default. AUTO_RESET_SOC and JK_BMS_AUTO_RESET_SOC have to be enabled in your config to make it work.

Probably fixes #703

@@ -417,6 +420,9 @@ def manage_charge_voltage_step(self) -> None:
):
# example 2
self.max_voltage_start_time = time()
# Assume battery SOC ist 100% at this stage
# Function for each battery that supports reset of SOC
self.trigger_soc_reset()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@@ -275,6 +275,9 @@ def manage_charge_voltage_linear(self) -> None:
and self.allow_max_voltage
):
self.max_voltage_start_time = int(time())
# Assume battery SOC ist 100% at this stage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you are german :-) ist -> is

@@ -1094,6 +1100,19 @@ def log_settings(self) -> None:
logger.info(
f"> CCCM SOC: {str(utils.CCCM_SOC_ENABLE).ljust(5)} | DCCM SOC: {utils.DCCM_SOC_ENABLE}"
)
if utils.AUTO_RESET_SOC and utils.JK_BMS_AUTO_RESET_SOC:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using two settings? This makes the configuration much more complicated for nothing.

f"> Timeout to next possible SOC reset: {str(utils.JK_BMS_WAIT_UNTIL_NEXT_SOC_RESET)}"
)
else:
logger.info("JK BMS SOC reset disabled")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for all this complicated variables.

JK_BMS_OVP_DEFAULT = 3.550
JK_BMS_OVPR_TRIGGER_RESET = 3.300
JK_BMS_OVP_TRIGGER_RESET = 3.400
JK_BMS_WAIT_UNTIL_NEXT_SOC_RESET = 3600
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need all this complicated settings. This is only generating a lot of questions for the users.

The way to go should be:

  1. Read OVP and OVPR from BMS and save it to variables
  2. Disable the alert
  3. Set OVP to MAX_CELL_VOLTAGE and OVPR to MAX_CELL_VOLTAGE - 0.25
  4. Check if SoC is reseted to 100%
  5. Set OVP and OVPR to the original values
  6. Enable alert again

If you let the user decide JK_BMS_WAIT_UNTIL_NEXT_SOC_RESET then one of the most questions will be: What is the best value to set? To avoid this please set a fixed value as a constant in the script. I would recommend that SoC is set only once a day.

@ogurevich
Copy link
Contributor

A consideration. What if we only set the SOC to 100% after the absorption period is over ?
here ?
https://github.com/ArendsM/dbus-serialbattery/blob/dev/etc/dbus-serialbattery/battery.py#L353-L354

@mr-manuel
Copy link
Collaborator

@ogurevich I was thinking about the same. This would also make the JK_BMS_WAIT_UNTIL_NEXT_SOC_RESET unneeded in my eyes.

@ArendsM
Copy link
Contributor Author

ArendsM commented Jun 28, 2023

Hi Manuel, hi Oleg, thanks for sharing your comments. I'll do some modifications based on that and create a new PR then.

@ArendsM ArendsM closed this Jun 28, 2023
@ogurevich
Copy link
Contributor

@ogurevich I was thinking about the same. This would also make the JK_BMS_WAIT_UNTIL_NEXT_SOC_RESET unneeded in my eyes.

On the other hand, that would be the right place for the "Reset SOC", which we only trigger for one battery in parallel if there are several batteries. Then we need a solution how to propagate this event for all batteries. I think the idea of being able to reset the SOC is very cool.

@mr-manuel
Copy link
Collaborator

@ArendsM you don't need to open a new PR. The new commits are added automatically.

@mr-manuel mr-manuel reopened this Jun 28, 2023
@mr-manuel
Copy link
Collaborator

@ogurevich the driver is only aware of one battery, so it does this for every single battery seperately.

@ogurevich
Copy link
Contributor

@mr-manuel exactly.
The first battery that meets the conditions completes absorption and goes into float mode. The CVL is thereby lowered. All others remain in bulk. The condition does not apply to them

image

@mr-manuel
Copy link
Collaborator

Thats not completely correct. Since only one BMS can lower the CVL. If you have multiple batteries the aggregator decides when to lower the CVL. The indipendend battery lowers the CVL but it has no effect.

@ogurevich
Copy link
Contributor

correct,
case 1 : "only one BMS (referenced in DVCC)can lower the CVL. When this BMS goes in to foat first

the other case is the aggregator. It sends whole System into "float"
Screenshot 2023-06-28 at 09 52 01

@ArendsM
Copy link
Contributor Author

ArendsM commented Jun 29, 2023

@ogurevich I was thinking about the same. This would also make the JK_BMS_WAIT_UNTIL_NEXT_SOC_RESET unneeded in my eyes.

On the other hand, that would be the right place for the "Reset SOC", which we only trigger for one battery in parallel if there are several batteries. Then we need a solution how to propagate this event for all batteries. I think the idea of being able to reset the SOC is very cool.

Hi Oleg, yust thinking loud, maybe we can provide the JK SOC reset function to Node Red and you can trigger the SOC reset for each battery as soon the master BMS lowerd the CVL? I guess that is possible for other BMS already.

@ogurevich
Copy link
Contributor

Thank you for sharing ideas. At this point, I am not sufficiently familiar with the connections in Venos ecosystem and drivers. Manuel is the right man for architecture decisions. A third-party software component in my opinion as Node Red is only used by a few users, which only brings an unnecessary handicap. I can well imagine a shared flag exchange somewhere on the dbus (serial-battery.shared...). That would enable the exchange and without having to add any other components

@mr-manuel
Copy link
Collaborator

Almost everything on the dbus is readable and writable with MQTT.

I would recommend to use the existing function reset_soc_callback:

def reset_soc_callback(self, path, value):
# callback for handling reset soc request
return

self._dbusservice.add_path(
"/Settings/ResetSoc",
0,
writeable=True,
onchangecallback=self.battery.reset_soc_callback,
)

For Daly you can use a specific SoC value, for JKBMS the SoC should be reset to 100% independent of the value given.

…guration.

Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
@mr-manuel mr-manuel changed the title Introduction of automatic SOC reset for JK BMS (HW Version 11) Introduction of automatic SOC reset for JK BMS Bluetooth only (HW Version 11) Jul 14, 2023
@ArendsM
Copy link
Contributor Author

ArendsM commented Jul 18, 2023

Hi Manuel. I‘ve committed a version with no need of additional configuration options. The code works fine for me after some days of testing now.

@mr-manuel
Copy link
Collaborator

Please be more detailed in the code comments, that this works only for the JKBMS BLE driver, since it's not working for the JKBMS serial driver. Therefore add the BLE after JKBMS.

@@ -352,6 +352,8 @@ def manage_charge_voltage_linear(self) -> None:
self.transition_start_time = current_time
self.initial_control_voltage = self.control_voltage
chargeMode = "Float Transition"
# Assume battery SOC ist 100% at this stage
self.trigger_soc_reset()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@transistorgit would it maybe be better to use this also for Daly instead of this?

def update_soc(self, ser):
if self.last_charge_mode is not None and self.charge_mode is not None:
if not self.last_charge_mode.startswith(
"Float"
) and self.charge_mode.startswith("Float"):
# we just entered float mode, so the battery must be full
self.soc_to_set = 100
self.write_soc_and_datetime(ser)
self.last_charge_mode = self.charge_mode


# Set values back to default
ovp_reset = round(self.bms_status["settings"]["cell_ovp"], 3)
ovpr_reset = round(self.bms_status["settings"]["cell_ovpr"], 3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be before all other, else if the data refreshes you have lost the old values.

# Lowering OVPR / OVP
# That will trigger a High Voltage Alert
ovpr_trigger = round(self.bms_status["settings"]["cell_ovpr"] - 0.250, 3)
ovp_trigger = round(self.bms_status["settings"]["cell_ovp"] - 0.250, 3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend:

opv_trigger = self.get_max_cell_voltage() - 0.05
ovpr_trigger = self.get_max_cell_voltage() - 0.10

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good idea, should always fit to the actual situation. I'll take that over and do some testing.

@drago-more
Copy link

@ArendsM Just curious about the status ... is it planned to merge it to dev sometimes in the near future?

Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert
@ArendsM
Copy link
Contributor Author

ArendsM commented Sep 6, 2023

Pull request has been closed while merging my fork to current dev branch. Hopefully it will work again. I did some optimizations like suggested by Manuel. Test is running from tomorrow.

@ArendsM ArendsM reopened this Sep 6, 2023
@ghost
Copy link

ghost commented Sep 8, 2023 via email

@mr-manuel
Copy link
Collaborator

mr-manuel commented Sep 10, 2023

@schmidtsailor please ask this in the Victron Community. I'm not aware of any audible alarm. Best would be to try it yourself.

@mr-manuel
Copy link
Collaborator

@ArendsM if you finished testing I will merge this.

@ArendsM
Copy link
Contributor Author

ArendsM commented Sep 15, 2023

Hi Manuel, it's now working fine for some days so I'm happy to see other people testing it as well in the dev branch.

@mr-manuel mr-manuel merged commit 7c5f1c7 into Louisvdw:dev Sep 17, 2023
@drago-more
Copy link

@ArendsM I just tested the new function with my two 12V batteries in parallel, both with JKBMS. The SOC is not reset to 100% when going from absorption to float.

  • dbus-serialbattery v1.0.20230905dev
  • JKBMS HW v11.XW

@ArendsM
Copy link
Contributor Author

ArendsM commented Sep 20, 2023

@drago-more : Could you please try with config LINEAR_LIMITATION_ENABLE = True? I guess I have to add the trigger on a second position in case LINEAR_LIMITATION_ENABLE = False

@drago-more
Copy link

@ArendsM I am only working in step mode and would like to avoid to start playing with the linear mode. Could you make the changes required for the step mode? Happy to test ...

@drago-more
Copy link

@ArendsM Just fyi ... I have a typical RV setup (camper). Charging the batteries using grid and solar is centrally controlled by the serial driver. However, when driving, the charging is through the alternator/booster. This is independent from the Victron equipment and is using a fix charge curve (absorption 14.2V for 30 minutes, float 13.6V). Not sure if this could have any unforeseeable side effects.

@ArendsM
Copy link
Contributor Author

ArendsM commented Sep 20, 2023

@drago-more : I've opened a new pull request #813 . Let's wait for Manuel's opinion.

@mr-manuel
Copy link
Collaborator

@drago-more the PR was merged. Feel free to test.

@drago-more
Copy link

@ArendsM I am travelling today and tomorrow … will test on the weekend and let you know.

@drago-more
Copy link

@ArendsM @mr-manuel I tested it now using different charge/discharge scenarios and it works fine. For my setup (two batteries, BatteryAggregator by Pulquero, see my config.ini below) the SOCs of the two batteries are both reset to 100% and also the charge modes bulk/absorption/float are perfectly in sync.

[DEFAULT]

; If you want to add custom values/settings, then check the values/settings you want to change in "config.default.ini"
; and insert them below to persist future driver updates.

; --------- Battery Current limits ---------
MAX_BATTERY_CHARGE_CURRENT    = 40.0
MAX_BATTERY_DISCHARGE_CURRENT = 150.0

; --------- Cell Voltages ---------
; Description: Cell min/max voltages which are used to calculate the min/max battery voltage
; Example: 16 cells * 3.45V/cell = 55.2V max charge voltage. 16 cells * 2.90V = 46.4V min discharge voltage
MIN_CELL_VOLTAGE   = 2.900
; Max voltage can seen as absorption voltage
MAX_CELL_VOLTAGE   = 3.450
FLOAT_CELL_VOLTAGE = 3.375

; Bulk voltage (may be needed to reset the SoC to 100% once in a while for some BMS)
; Has to be higher as the MAX_CELL_VOLTAGE
BULK_CELL_VOLTAGE  = 3.57
; Specify after how many days the bulk voltage should be reached again
; The timer is reset when the bulk voltage is reached
; Leave empty if you don't want to use this
; Example: Value is set to 15
; day 1: bulk reached once
; day 16: bulk reached twice
; day 31: bulk not reached since it's very cloudy
; day 34: bulk reached since the sun came out
; day 49: bulk reached again, since last time it took 3 days to reach bulk voltage
BULK_AFTER_DAYS =

; --------- Bluetooth BMS ---------
; Description: List the Bluetooth BMS here that you want to install
; -- Available Bluetooth BMS:
; Jkbms_Ble, LltJbd_Ble
; Example:
;     1 BMS: Jkbms_Ble C8:47:8C:00:00:00
;     3 BMS: Jkbms_Ble C8:47:8C:00:00:00, Jkbms_Ble C8:47:8C:00:00:11, Jkbms_Ble C8:47:8C:00:00:22
; BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:E6:E2:00, Jkbms_Ble C8:47:8C:E6:E3:C3
BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:E6:E2:00, Jkbms_Ble C8:47:8C:E6:E3:C3

; --------- Charge mode ---------
; Choose the mode for voltage / current limitations (True / False)
; False is a step mode: This is the default with limitations on hard boundary steps
; True is a linear mode:
;     For CCL and DCL the values between the steps are calculated for smoother values (by WaldemarFech)
;     For CVL max battery voltage is calculated dynamically in order that the max cell voltage is not exceeded
LINEAR_LIMITATION_ENABLE = False

; -- CVL reset based on SoC option (step mode)
; Specify how long the max voltage should be kept, if reached then switch to float voltage
MAX_VOLTAGE_TIME_SEC = 900
; Specify SoC where CVL limit is reset to max voltage, if value gets below
SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT = 90

; --------- Cell Voltage Current limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be in-/decreased depending on min and max cell voltages
; Example: 18 cells * 3.55V/cell = 63.9V max charge voltage
;          18 cells * 2.70V/cell = 48.6V min discharge voltage
;          But in reality not all cells reach the same voltage at the same time. The (dis)charge current
;          will be (in-/)decreased, if even ONE SINGLE BATTERY CELL reaches the limits
; 
; Charge current control management referring to cell-voltage enable (True/False).
CCCM_CV_ENABLE = False      
; Discharge current control management referring to cell-voltage enable (True/False).
DCCM_CV_ENABLE = False

; --------- Temperature limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be in-/decreased depending on temperature
; Example: The temperature limit will be monitored to control the currents. If there are two temperature senors,
;          then the worst case will be calculated and the more secure lower current will be set.
; Charge current control management referring to temperature enable (True/False).
CCCM_T_ENABLE = False
; Charge current control management referring to temperature enable (True/False).
DCCM_T_ENABLE = False

; --------- SOC limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be increased / decreased depending on State of Charge,
;              see CC_SOC_LIMIT1 etc.
; Example: The SoC limit will be monitored to control the currents.
; Charge current control management enable (True/False).
CCCM_SOC_ENABLE = False
; Discharge current control management enable (True/False).
DCCM_SOC_ENABLE = False

; --------- Additional settings ---------
; Specify only one BMS type to load else leave empty to try to load all available
; -- Available BMS:
; Daly, Ecs, HeltecModbus, HLPdataBMS4S, Jkbms, Lifepower, LltJbd, Renogy, Seplos
; -- Available BMS, but disabled by default:
; https://louisvdw.github.io/dbus-serialbattery/general/install#how-to-enable-a-disabled-bms
; Ant, MNB, Sinowealth
BMS_TYPE = Jkbms

; 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 and JK BMS BLE
AUTO_RESET_SOC = True

Louisvdw pushed a commit that referenced this pull request Nov 25, 2023
* Update reinstall-local.sh: Fixed charge current parameter

Update reinstall-local.sh: Corrected charge current parameter for  initial config.ini

* Exclude devices from driver startup
This prevents blocking the serial port

* implement callback function for update

* fix comments to reflect new logic

* update changelog

* set soc=100% when charge mode changes to float, apply exponential smoothing on current readout

* remove scan for devices

the scan for devices and check if the BMS to test is present doesn't add value
if the device is not within range (or the MAC is wrong), then the subsequent start_scraping call will either fail or fail to produce usable data

* JKBMS_BLE driver fixes

* added Bluetooth signal strenght, increased debug

* Optimized reinstallation procedure
- Changed: Optimized restart sequence for the bluetooth installation
- Changed: Run serial part first and then bluetooth part. This allows the serial driver to get operative faster
- Removed: $DRIVERNAME variable for clearer paths
- Removed: Bluetooth system driver restart, since the devices get disconnected by the service before starting the dbus-serialbatterydriver

* Improved Jkbms_Ble error handling

* optimized disable procedure

* small fixes

* save custom name and make it restart persistant
#100

* changed unique identifier from string to function
function can be overridden by BMS battery class

* fix typo

* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: Manuel <[email protected]>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

---------

Co-authored-by: Holger Schultheiß <[email protected]>
Co-authored-by: Stefan Seidel <[email protected]>
Co-authored-by: Bernd Stahlbock <[email protected]>
Co-authored-by: seidler2547 <[email protected]>
Co-authored-by: ogurevich <[email protected]>
Co-authored-by: wollew <[email protected]>
Co-authored-by: Oleg Gurevich <[email protected]>
Co-authored-by: peterohman <[email protected]>
Co-authored-by: Strawder, Paul <[email protected]>
Co-authored-by: Paul Strawder <[email protected]>
Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: ArendsM <[email protected]>
Co-authored-by: Meik Arends <[email protected]>
Louisvdw pushed a commit that referenced this pull request Feb 28, 2024
* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: Manuel <[email protected]>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* Some changes for lost bluetooth connection / hci_uart stack restart

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

* Bind device instance to unique_identifier
#718

* added data types to battery class
disabled unused variables

* save current charge state
#840

* correct file permissions

* updated changelog

* added periodic saveChargeDetails

* fix some small errors

* fix issue with ruuvi tags
When there are hundreds of unused ruuvi tags in the settings list that where added because thei where nearby the driver does not start correctly. These stale entries are disabled on the driver startup.
The issue was already filed to Victron developers

* CVL with i-controller instead of penaltysum

* cvl_controller: switch to choose PenaltySum or ICOntroller + documentation

* docu enhancement

* Add setting and install logic for usb bluetooth module

* round temperatures

* changed battery disconnect behaviour

* Fixes #891
#891

* updated changelog

* Add bluetooth device note to config.default.ini

* Fix typo in bluetooth note in config.default.ini

* fixed error in new cvl_controller

* fixed float division by zero and code optimization

* Restart MAX_VOLTAGE_TIME_SEC if cell diff > CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART

* Calculation of the SOC based on coloumb-counting (#868)

* Calculation of the SOC in the driver based on coloumb-counting

* soc_calc: add current correction before integration

* soc_calc: correction map for current

* Soc_calc: CorrectionMap, switch to turn on/off correction, selectable initial value

* soc_calc: Bugfix

* soc_calc: Bugfix

* store soc in dbus for restart

* store soc in dbus for restart (formatted)

* store soc in dbus for restart (bugfix)

* save soc_calc only after change > 1.0

* store soc in dbus for restart (bugfix)

* logger does not work this way. do not know why

* writing and reading to dbus works

* Removed options: SOC_CALC_CURRENT_CORRECTION, SOC_CALC_RESET_VALUE_ON_RESTART, SOC_CALC_INIT_VALUE
sort soc_calc alphabetically

* fixed comments

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Fix #898
#898

* Changed: Fix issue loading settings from dbus

* Added nightly install option
makes it easier for users to pretest fixes

* Changed: more detailed error output when an exception happens

* Possible fix for #912
#912

* Fixes #919
#919

* Changed: Exit script with error, if port excluded
else the serialstarter stops at the dbus-serialbattery

* Fixed some smaller errors

* Updated pre-release workflow

* Fix JK BMS connection restart when bluetooth fails.

This fix installs a new thread to monitor the state of the original
scraping thread.
If scraping thread dies, it verifies that it did not because the
scraping was intentionally stopped by calling stop_scrapping.
When restarting the scrapper, it first calls the bluetooth
reset lambda function that was passed in the class contructor, such that
bluetooth is ready to make a proper connection.

* Fixes #916
#916

* Added Venus OS version to logfile

* Fix #840
#840

* Small code formatting fixes

* Optimized reinstall script. Restart GUI only on changes.

* Display debugging data in GUI when DEBUG enabled

* Install script now shows repositories and version numbers

* Update daly_can.py

Fixing #950 for DalyBMS

* Update jkbms_can.py

Fixing #950 for Jk BMS

* Fix black lint check

* Fixes #970
#970

* Fixed some errors in restoring values from dbus settings

* Moved sleep on start for all BMS

* Update config description

* Reworked a part of the default config

* fix typo in stopping services when reinstalling

* Fix Time-to-SoC and Time-to-Go calculation

* Add changelog info

* Round sum and diff voltage

* Temperature limitation variables where changed

* SoC limitation variables where changed

* Added error messages

* Remove unneeded code

* Reset SoC to 0% if empty

* Add GUIv2 for dbus-serialbattery

* Check free space before installing

* Added new GUIv2 version

* Removed Python 2 compatibility

* Changelog update

* Code cleanup
- Removed: get_temperatures()
- Removed: update_last_seen()

* Bluetooth code optimizations

* Fixed some JKBMS BLE not starting
#819

* Check if packages are already installed before install

* Fixed some SOC calculation errors

* Fixed None SOC on driver start

* Do not show and allow button change when callback is missing for:
- ForceChargingOff
- ForceDischargingOff
- TurnBalancingOff

* Check if a device instance is already used by creating a PID file

* Log and execute SOC reset to 100% or 0% only once

* Update GitHub workflow and issue templates

* Fixed LLT/JBD BMS with only on temperature sensor #791
#971

* Fix warning on reinstall

* Fix missing IO control for JBDBMS #992
#992

* Prepare for removing dev branch

---------

Co-authored-by: ogurevich <[email protected]>
Co-authored-by: Bernd Stahlbock <[email protected]>
Co-authored-by: wollew <[email protected]>
Co-authored-by: Oleg Gurevich <[email protected]>
Co-authored-by: peterohman <[email protected]>
Co-authored-by: Strawder, Paul <[email protected]>
Co-authored-by: Paul Strawder <[email protected]>
Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: ArendsM <[email protected]>
Co-authored-by: Meik Arends <[email protected]>
Co-authored-by: Marvo2011 <[email protected]>
Co-authored-by: cflenker <[email protected]>
Co-authored-by: cflenker <[email protected]>
Co-authored-by: Cupertino Miranda <[email protected]>
Co-authored-by: Martin Polehla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants