Add adjustable charging cycles
This commit is contained in:
1 parent
75e2ac8155
commit
a11f2b75c8
19 files changed
+86
-20
No files matched your search
@@ -0,0 +1,28 @@
|
||||
# Charging cycles adjustment
|
||||
number:
|
||||
- platform: template
|
||||
name: "${name} ${bms_name} charging cycles base"
|
||||
id: bms${bms_id}_charging_cycles_base
|
||||
step: 1
|
||||
min_value: 0
|
||||
max_value: 65535
|
||||
restore_value: true
|
||||
mode: "${yambms_input_number_mode}"
|
||||
initial_value: 0
|
||||
icon: mdi:counter
|
||||
optimistic: true
|
||||
entity_category: config
|
||||
|
||||
sensor:
|
||||
- platform: template
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
id: bms${bms_id}_charging_cycles
|
||||
update_interval: ${bms_update_interval}
|
||||
accuracy_decimals: 0
|
||||
icon: mdi:counter
|
||||
filters:
|
||||
- or:
|
||||
- throttle: 10s
|
||||
- delta: 1
|
||||
lambda: |-
|
||||
return id(bms${bms_id}_charging_cycles_raw).state + id(bms${bms_id}_charging_cycles_base).state;
|
||||
@@ -26,6 +26,7 @@ packages:
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_BLE.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
ota:
|
||||
@@ -286,7 +287,8 @@ sensor:
|
||||
id: bms${bms_id}_battery_capacity
|
||||
name: "${name} ${bms_name} total battery capacity setting"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
total_charging_cycle_capacity:
|
||||
name: "${name} ${bms_name} total charging cycle capacity"
|
||||
|
||||
@@ -26,6 +26,7 @@ packages:
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_BLE.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
ota:
|
||||
@@ -281,7 +282,8 @@ sensor:
|
||||
id: bms${bms_id}_battery_capacity
|
||||
name: "${name} ${bms_name} total battery capacity setting"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
total_charging_cycle_capacity:
|
||||
name: "${name} ${bms_name} total charging cycle capacity"
|
||||
|
||||
@@ -26,6 +26,7 @@ packages:
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_BLE.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
ota:
|
||||
@@ -161,7 +162,8 @@ sensor:
|
||||
id: bms${bms_id}_battery_capacity
|
||||
name: "${name} ${bms_name} total battery capacity setting"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
total_charging_cycle_capacity:
|
||||
name: "${name} ${bms_name} total charging cycle capacity"
|
||||
|
||||
@@ -24,6 +24,7 @@ substitutions:
|
||||
packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
@@ -327,7 +328,8 @@ sensor:
|
||||
|
||||
# FAKE charging_cycles
|
||||
- platform: template
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
update_interval: ${bms_update_interval}
|
||||
accuracy_decimals: 0
|
||||
|
||||
@@ -22,6 +22,7 @@ packages:
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_5.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_RS485_Modbus.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
# | Component settings |
|
||||
@@ -162,7 +163,8 @@ sensor:
|
||||
id: bms${bms_id}_capacity_remaining_ah
|
||||
name: "${name} ${bms_name} battery capacity remaining"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
battery_capacity_total_charging_cycle:
|
||||
name: "${name} ${bms_name} battery capacity total charging cycle"
|
||||
|
||||
@@ -26,6 +26,7 @@ packages:
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_UART_4G-GPS.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
@@ -136,7 +137,8 @@ sensor:
|
||||
name: "${name} ${bms_name} temperature sensors"
|
||||
entity_category: diagnostic
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
total_charging_cycle_capacity:
|
||||
name: "${name} ${bms_name} total charging cycle capacity"
|
||||
|
||||
@@ -24,6 +24,7 @@ substitutions:
|
||||
packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_4.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
@@ -140,7 +141,8 @@ sensor:
|
||||
id: bms${bms_id}_state_of_charge
|
||||
name: "${name} ${bms_name} state of charge"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
state_of_health:
|
||||
id: bms${bms_id}_battery_soh
|
||||
|
||||
@@ -23,6 +23,7 @@ substitutions:
|
||||
|
||||
packages:
|
||||
bms_combine: !include bms_combine.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
# | Component settings |
|
||||
@@ -179,7 +180,8 @@ sensor:
|
||||
# charging_cycles
|
||||
- platform: modbus_controller
|
||||
modbus_controller_id: modbus_controller${bms_id}
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
register_type: read
|
||||
address: 14
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
|
||||
packages:
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
|
||||
# +-----------------------------------------------+
|
||||
@@ -88,7 +90,7 @@ canbus:
|
||||
if(x[1] == 2) id(bms${bms_id}_fault_level).publish_state("serious fault");
|
||||
id(bms${bms_id}_fault).publish_state(x[1] & 3);
|
||||
float cycles = ((x[3] << 8) | x[2]);
|
||||
id(bms${bms_id}_charging_cycles).publish_state(cycles);
|
||||
id(bms${bms_id}_charging_cycles_raw).publish_state(cycles);
|
||||
// Set cell balancing states based on x[4] and x[5]
|
||||
//for (int i = 1; i <= 8; i++) {
|
||||
// std::to_string(high_position).c_str()
|
||||
@@ -361,7 +363,8 @@ sensor:
|
||||
# Charging cycles
|
||||
- platform: template
|
||||
name: "${name} ${bms_name} cycles"
|
||||
id: "bms${bms_id}_charging_cycles"
|
||||
id: "bms${bms_id}_charging_cycles_raw"
|
||||
internal: true
|
||||
state_class: 'measurement'
|
||||
accuracy_decimals: 0
|
||||
filters:
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
|
||||
packages:
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
|
||||
# +-----------------------------------------------+
|
||||
@@ -78,7 +80,7 @@ canbus:
|
||||
if(x[1] == 2) id(bms${bms_id}_fault_level).publish_state("serious fault");
|
||||
id(bms${bms_id}_fault).publish_state(x[1] & 3);
|
||||
float cycles = ((x[3] << 8) | x[2]);
|
||||
id(bms${bms_id}_charging_cycles).publish_state(cycles);
|
||||
id(bms${bms_id}_charging_cycles_raw).publish_state(cycles);
|
||||
id(bms${bms_id}_equalizing).publish_state(x[4] | x[5]);
|
||||
|
||||
- can_id: 0x55${deye_module_id}
|
||||
@@ -236,7 +238,8 @@ sensor:
|
||||
# Charging cycles
|
||||
- platform: template
|
||||
name: "${name} ${bms_name} cycles"
|
||||
id: "bms${bms_id}_charging_cycles"
|
||||
id: "bms${bms_id}_charging_cycles_raw"
|
||||
internal: true
|
||||
state_class: 'measurement'
|
||||
accuracy_decimals: 0
|
||||
filters:
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
packages:
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_4.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
sensor:
|
||||
# battery_capacity
|
||||
@@ -301,7 +302,8 @@ sensor:
|
||||
|
||||
# charging_cycles
|
||||
- platform: template
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
update_interval: ${bms_update_interval}
|
||||
accuracy_decimals: 0
|
||||
|
||||
@@ -21,6 +21,7 @@ packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_6.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JBD.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
ota:
|
||||
@@ -116,7 +117,8 @@ sensor:
|
||||
id: bms${bms_id}_battery_capacity
|
||||
name: "${name} ${bms_name} nominal capacity"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
capacity_remaining:
|
||||
id: bms${bms_id}_capacity_remaining_ah
|
||||
|
||||
@@ -21,6 +21,7 @@ packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_6.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JBD.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
@@ -101,7 +102,8 @@ sensor:
|
||||
id: bms${bms_id}_battery_capacity
|
||||
name: "${name} ${bms_name} nominal capacity"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
capacity_remaining:
|
||||
id: bms${bms_id}_capacity_remaining_ah
|
||||
|
||||
@@ -21,6 +21,7 @@ packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_BLE.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
ota:
|
||||
@@ -156,7 +157,8 @@ sensor:
|
||||
id: bms${bms_id}_battery_capacity
|
||||
name: "${name} ${bms_name} total battery capacity setting"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
total_charging_cycle_capacity:
|
||||
name: "${name} ${bms_name} total charging cycle capacity"
|
||||
|
||||
@@ -21,6 +21,7 @@ packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_RS485_Modbus.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
# | Component settings |
|
||||
@@ -139,7 +140,8 @@ sensor:
|
||||
id: bms${bms_id}_capacity_remaining_ah
|
||||
name: "${name} ${bms_name} battery capacity remaining"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
battery_capacity_total_charging_cycle:
|
||||
name: "${name} ${bms_name} battery capacity total charging cycle"
|
||||
|
||||
@@ -21,6 +21,7 @@ packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_5.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_RS485_Modbus.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
# | Component settings |
|
||||
@@ -318,7 +319,8 @@ sensor:
|
||||
name: "${name} ${bms_name} battery capacity remaining"
|
||||
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
battery_capacity_total_charging_cycle:
|
||||
name: "${name} ${bms_name} battery capacity total charging cycle"
|
||||
|
||||
@@ -21,6 +21,7 @@ packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_5.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_RS485_Modbus.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
# | Component settings |
|
||||
@@ -161,7 +162,8 @@ sensor:
|
||||
id: bms${bms_id}_capacity_remaining_ah
|
||||
name: "${name} ${bms_name} battery capacity remaining"
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
battery_capacity_total_charging_cycle:
|
||||
name: "${name} ${bms_name} battery capacity total charging cycle"
|
||||
|
||||
@@ -21,6 +21,7 @@ packages:
|
||||
bms_base: !include bms_base.yaml
|
||||
bms_temperature_sensor: !include bms_temperature_sensor_2.yaml
|
||||
bms_errors_bitmask: !include bms_errors_bitmask_JK_UART_4G-GPS.yaml
|
||||
bms_cycles_base: !include bms_charging_cycles_base.yaml
|
||||
bms_battery_soh: !include bms_battery_soh.yaml
|
||||
|
||||
# +--------------------------------------+
|
||||
@@ -214,7 +215,8 @@ sensor:
|
||||
name: "${name} ${bms_name} temperature sensors"
|
||||
entity_category: diagnostic
|
||||
charging_cycles:
|
||||
id: bms${bms_id}_charging_cycles
|
||||
id: bms${bms_id}_charging_cycles_raw
|
||||
internal: true
|
||||
name: "${name} ${bms_name} charging cycles"
|
||||
total_charging_cycle_capacity:
|
||||
name: "${name} ${bms_name} total charging cycle capacity"
|
||||
|
||||
Reference in new issue
Block a user