Skip to content

Commit

Permalink
clean-up Louisvdw#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Strawder, Paul committed Mar 23, 2023
1 parent a37244f commit 30dacf6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 566 deletions.
2 changes: 0 additions & 2 deletions etc/dbus-serialbattery/dbus-serialbattery.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from daly import Daly
from ant import Ant
from jkbms import Jkbms
from jkbms_ble import Jkbms_Ble
# from sinowealth import Sinowealth
from renogy import Renogy
from ecs import Ecs
Expand All @@ -37,7 +36,6 @@
{"bms": Daly, "baud": 9600, "address": b"\x40"},
{"bms": Daly, "baud": 9600, "address": b"\x80"},
{"bms": Jkbms, "baud": 115200},
{"bms": Jkbms_Ble, "address": "C8:47:8C:E4:54:0E"},
# {"bms" : Sinowealth},
{"bms": Lifepower, "baud": 9600},
{"bms": Renogy, "baud": 9600, "address": b"\x30"},
Expand Down
52 changes: 26 additions & 26 deletions etc/dbus-serialbattery/dbushelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,32 @@ def setup_instance(self):
0,
0,
],
'CellVoltageMin': [path + '/CellVoltageMin', MIN_CELL_VOLTAGE, 2.5, 3.65],
'CellVoltageMax': [path + '/CellVoltageMax', MAX_CELL_VOLTAGE, 2.5, 3.65],
'CellVoltageFloat': [path + '/CellVoltageFloat', FLOAT_CELL_VOLTAGE, 2.5, 3.65],
'VoltageMaxTime': [path + '/VoltageMaxTime', MAX_VOLTAGE_TIME_SEC, 0, 0],
'VoltageResetSocLimit': [path + '/VoltageResetSocLimit', SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT, 0, 100],
'MaxChargeCurrent': [path + '/MaxCurrentCharge', MAX_BATTERY_CHARGE_CURRENT, 0.0, 500],
'MaxDischargeCurrent': [path + '/MaxCurrentDischarge', MAX_BATTERY_DISCHARGE_CURRENT, 0.0, 500],
'AllowDynamicChargeCurrent': [path + '/AllowDynamicChargeCurrent', 1, 0, 1],
'AllowDynamicDischargeCurrent': [path + '/AllowDynamicDischargeCurrent', 1, 0, 1],
'AllowDynamicChargeVoltage': [path + '/AllowDynamicChargeVoltage', 0, 0, 1],
'SocLowWarning': [path + '/SocLowWarning', SOC_LOW_WARNING, 0, 100],
'SocLowAlarm': [path + '/SocLowAlarm', SOC_LOW_ALARM, 0, 100],
'Capacity': [path + '/Capacity', BATTERY_CAPACITY, 0, 500],
'EnableInvertedCurrent': [path + '/EnableInvertedCurrent', INVERT_CURRENT_MEASUREMENT, 0, 1],
'CCMSocLimitCharge1': [path + '/CCMSocLimitCharge1', CC_SOC_LIMIT1, 0, 100],
'CCMSocLimitCharge2': [path + '/CCMSocLimitCharge2', CC_SOC_LIMIT2, 0, 100],
'CCMSocLimitCharge3': [path + '/CCMSocLimitCharge3', CC_SOC_LIMIT3, 0, 100],
'CCMCurrentLimitCharge1': [path + '/CCMCurrentLimitCharge1', CC_CURRENT_LIMIT1, 0, 500],
'CCMCurrentLimitCharge2': [path + '/CCMCurrentLimitCharge2', CC_CURRENT_LIMIT2, 0, 500],
'CCMCurrentLimitCharge3': [path + '/CCMCurrentLimitCharge3', CC_CURRENT_LIMIT3, 0, 500],
'CCMSocLimitDischarge1': [path + '/CCMSocLimitDischarge1', DC_SOC_LIMIT1, 0, 100],
'CCMSocLimitDischarge2': [path + '/CCMSocLimitDischarge2', DC_SOC_LIMIT2, 0, 100],
'CCMSocLimitDischarge3': [path + '/CCMSocLimitDischarge3', DC_SOC_LIMIT3, 0, 100],
'CCMCurrentLimitDischarge1': [path + '/CCMCurrentLimitDischarge1', DC_CURRENT_LIMIT1, 0, 500],
'CCMCurrentLimitDischarge2': [path + '/CCMCurrentLimitDischarge2', DC_CURRENT_LIMIT2, 0, 500],
'CCMCurrentLimitDischarge3': [path + '/CCMCurrentLimitDischarge3', DC_CURRENT_LIMIT3, 0, 500],
# 'CellVoltageMin': [path + '/CellVoltageMin', MIN_CELL_VOLTAGE, 2.5, 3.65],
# 'CellVoltageMax': [path + '/CellVoltageMax', MAX_CELL_VOLTAGE, 2.5, 3.65],
# 'CellVoltageFloat': [path + '/CellVoltageFloat', FLOAT_CELL_VOLTAGE, 2.5, 3.65],
# 'VoltageMaxTime': [path + '/VoltageMaxTime', MAX_VOLTAGE_TIME_SEC, 0, 0],
# 'VoltageResetSocLimit': [path + '/VoltageResetSocLimit', SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT, 0, 100],
# 'MaxChargeCurrent': [path + '/MaxCurrentCharge', MAX_BATTERY_CHARGE_CURRENT, 0.0, 500],
# 'MaxDischargeCurrent': [path + '/MaxCurrentDischarge', MAX_BATTERY_DISCHARGE_CURRENT, 0.0, 500],
# 'AllowDynamicChargeCurrent': [path + '/AllowDynamicChargeCurrent', 1, 0, 1],
# 'AllowDynamicDischargeCurrent': [path + '/AllowDynamicDischargeCurrent', 1, 0, 1],
# 'AllowDynamicChargeVoltage': [path + '/AllowDynamicChargeVoltage', 0, 0, 1],
# 'SocLowWarning': [path + '/SocLowWarning', SOC_LOW_WARNING, 0, 100],
# 'SocLowAlarm': [path + '/SocLowAlarm', SOC_LOW_ALARM, 0, 100],
# 'Capacity': [path + '/Capacity', BATTERY_CAPACITY, 0, 500],
# 'EnableInvertedCurrent': [path + '/EnableInvertedCurrent', INVERT_CURRENT_MEASUREMENT, 0, 1],
# 'CCMSocLimitCharge1': [path + '/CCMSocLimitCharge1', CC_SOC_LIMIT1, 0, 100],
# 'CCMSocLimitCharge2': [path + '/CCMSocLimitCharge2', CC_SOC_LIMIT2, 0, 100],
# 'CCMSocLimitCharge3': [path + '/CCMSocLimitCharge3', CC_SOC_LIMIT3, 0, 100],
# 'CCMCurrentLimitCharge1': [path + '/CCMCurrentLimitCharge1', CC_CURRENT_LIMIT1, 0, 500],
# 'CCMCurrentLimitCharge2': [path + '/CCMCurrentLimitCharge2', CC_CURRENT_LIMIT2, 0, 500],
# 'CCMCurrentLimitCharge3': [path + '/CCMCurrentLimitCharge3', CC_CURRENT_LIMIT3, 0, 500],
# 'CCMSocLimitDischarge1': [path + '/CCMSocLimitDischarge1', DC_SOC_LIMIT1, 0, 100],
# 'CCMSocLimitDischarge2': [path + '/CCMSocLimitDischarge2', DC_SOC_LIMIT2, 0, 100],
# 'CCMSocLimitDischarge3': [path + '/CCMSocLimitDischarge3', DC_SOC_LIMIT3, 0, 100],
# 'CCMCurrentLimitDischarge1': [path + '/CCMCurrentLimitDischarge1', DC_CURRENT_LIMIT1, 0, 500],
# 'CCMCurrentLimitDischarge2': [path + '/CCMCurrentLimitDischarge2', DC_CURRENT_LIMIT2, 0, 500],
# 'CCMCurrentLimitDischarge3': [path + '/CCMCurrentLimitDischarge3', DC_CURRENT_LIMIT3, 0, 500],
}

self.settings = SettingsDevice(get_bus(), settings, self.handle_changed_setting)
Expand Down
6 changes: 3 additions & 3 deletions etc/dbus-serialbattery/default_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ DC_CURRENT_LIMIT3_FRACTION = 0.5
CVCM_ENABLE = False

; Simulate Midpoint graph (True/False).
MIDPOINT_ENABLE = True
MIDPOINT_ENABLE = False

; soc low levels
SOC_LOW_WARNING = 20
SOC_LOW_ALARM = 10

; Daly settings
; Battery capacity (amps) if the BMS does not support reading it
BATTERY_CAPACITY = 280
BATTERY_CAPACITY = 50
; Invert Battery Current. Default non-inverted. Set to -1 to invert
INVERT_CURRENT_MEASUREMENT = 1

Expand All @@ -114,7 +114,7 @@ TIME_TO_SOC_POINTS=100,95,90,85,75,50,25,20,10,0
; TIME_TO_SOC_VALUE_TYPE = 1 ; Seconds
; TIME_TO_SOC_VALUE_TYPE = 2 ; Time string HH:MN:SC
; Both Seconds and time str "<seconds> [days, HR:MN:SC]"
TIME_TO_SOC_VALUE_TYPE = 1
TIME_TO_SOC_VALUE_TYPE = 3
; Specify how many loop cycles between each TimeToSoc updates
TIME_TO_SOC_LOOP_CYCLES = 5
; Include TimeToSoC points when moving away from the SoC point. [Valid values True,False]
Expand Down
162 changes: 0 additions & 162 deletions etc/dbus-serialbattery/jkbms_ble.py

This file was deleted.

Loading

0 comments on commit 30dacf6

Please sign in to comment.