Skip to content

Commit 910cab0

Browse files
authored
refactor: remove unit field from battery cycle sensors and update translations (#180)
Remove the `unit: cycles` field from battery cycle count sensors across all register definition files (a.yaml, d.yaml, e_v12.yaml, e_v3.yaml) because cycles are not a real physical unit. Also update translation strings in German, English, and Dutch to use more descriptive names like "Full Cycles (BMS)" and "Full Cycles (calculated)" instead of generic terms. _Follow-up to #177_
2 parents 592a16d + 099d39a commit 910cab0

8 files changed

Lines changed: 20 additions & 35 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Below is a per-key table showing descriptive fields and the register defined in
114114
| total_daily_discharging_energy | Total daily discharging energy | int32 | 4 | 0.01 | kWh | 33006 | 33006 | 33006 | 33006 |
115115
| total_monthly_charging_energy | Total monthly charging energy | uint32 | 4 | 0.01 | kWh | 33008 | 33008 | 33008 | 33008 |
116116
| total_monthly_discharging_energy | Total monthly discharging energy | int32 | 4 | 0.01 | kWh | 33010 | 33010 | 33010 | 33010 |
117-
| battery_cycle_count | Native cycle counter | uint16 | 2 | 1 | cycles | 34003 | 34003 | | 34003 |
117+
| battery_cycle_count | Native cycle counter | uint16 | 2 | 1 | - | 34003 | 34003 | | 34003 |
118118
| ac_voltage | AC voltage | uint16 | 2 | 0.1 | V | 32200 | 32200 | 32200 | 32200 |
119119
| ac_current | AC current | int16 | 2 | 0.004/0.01| A | 37004 | 37004 | 32201 | 37004 |
120120
| ac_power | AC power | int16/32| 2/4 | 1 | W | 30006 | 30006 | 32202 | 30006 |
@@ -274,7 +274,7 @@ Below is a per-key table showing descriptive fields and the register defined in
274274
| round_trip_efficiency_monthly | Round-trip efficiency (monthly charge/discharge) | calculated | - | - | % | | | | |
275275
| conversion_efficiency | Conversion efficiency (battery ↔ AC) | calculated | - | - | % | | | | |
276276
| stored_energy | Stored battery energy (SOC × capacity) | calculated | - | - | kWh | | | | |
277-
| battery_cycle_count_calc | Cycle count calculated from total discharge and capacity | calculated | - | - | cycles | | | | |
277+
| battery_cycle_count_calc | Cycle count calculated from total discharge and capacity | calculated | - | - | - | | | | |
278278

279279
_Notes:_
280280
- Columns `a`, `d`, `e_v12` and `e_v3` correspond to the YAML files under `custom_components/marstek_modbus/registers/`.

custom_components/marstek_modbus/registers/a.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ SENSOR_DEFINITIONS:
282282
battery_cycle_count:
283283
register: 34003
284284
scale: 1
285-
unit: cycles
286285
icon: "mdi:counter"
287286
state_class: total_increasing
288287
category: diagnostic
@@ -1349,7 +1348,7 @@ SENSOR_DEFINITIONS:
13491348
category: diagnostic
13501349
enabled_by_default: false
13511350
scan_interval: medium
1352-
1351+
13531352
BINARY_SENSOR_DEFINITIONS:
13541353
wifi_status:
13551354
register: 30300

custom_components/marstek_modbus/registers/d.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ SENSOR_DEFINITIONS:
228228
battery_cycle_count:
229229
register: 34003
230230
scale: 1
231-
unit: cycles
232231
icon: "mdi:counter"
233232
state_class: total_increasing
234233
category: diagnostic

custom_components/marstek_modbus/registers/e_v12.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ SWITCH_DEFINITIONS:
648648
category: config
649649
scan_interval: very_low
650650

651-
652651
NUMBER_DEFINITIONS:
653652
set_charge_power:
654653
register: 42020

custom_components/marstek_modbus/registers/e_v3.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ SENSOR_DEFINITIONS:
222222
battery_cycle_count:
223223
register: 34003
224224
scale: 1
225-
unit: cycles
226225
icon: "mdi:counter"
227226
state_class: total_increasing
228227
category: diagnostic
@@ -549,7 +548,7 @@ SENSOR_DEFINITIONS:
549548
category: diagnostic
550549
enabled_by_default: false
551550
scan_interval: medium
552-
551+
553552
BINARY_SENSOR_DEFINITIONS:
554553
wifi_status:
555554
register: 30300

custom_components/marstek_modbus/translations/de.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@
147147
"name": "Gesamte Entladeenergie"
148148
},
149149
"battery_cycle_count": {
150-
"name": "Zyklen"
150+
"name": "Vollzyklen (BMS)"
151151
},
152152
"battery_cycle_count_calc": {
153-
"name": "Zyklen (Calc)"
153+
"name": "Vollzyklen (berechnet)"
154154
},
155155
"total_daily_charging_energy": {
156156
"name": "Tägliche Ladeenergie"
@@ -730,4 +730,4 @@
730730
}
731731
}
732732
}
733-
}
733+
}

custom_components/marstek_modbus/translations/en.json

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@
150150
"name": "Total Discharging Energy"
151151
},
152152
"battery_cycle_count": {
153-
"name": "Cycle Count"
153+
"name": "Full Cycles (BMS)"
154154
},
155155
"battery_cycle_count_calc": {
156-
"name": "Cycle Count (Calc)"
156+
"name": "Full Cycles (calculated)"
157157
},
158158
"total_daily_charging_energy": {
159159
"name": "Daily Charging Energy"
@@ -494,7 +494,6 @@
494494
"mppt4_power": {
495495
"name": "MPPT4 Power"
496496
},
497-
498497
"bluetooth_status": {
499498
"name": "Bluetooth Status",
500499
"state": {
@@ -507,17 +506,16 @@
507506
}
508507
},
509508
"binary_sensor": {
510-
"wifi_status": {
511-
"name": "WiFi Status"
509+
"wifi_status": {
510+
"name": "WiFi Status"
512511
},
513-
"cloud_status": {
514-
"name": "Cloud Status"
512+
"cloud_status": {
513+
"name": "Cloud Status"
515514
},
516-
"discharge_limit_mode": {
517-
"name": "Discharge Limit"
515+
"discharge_limit_mode": {
516+
"name": "Discharge Limit"
518517
}
519518
},
520-
521519
"select": {
522520
"user_work_mode": {
523521
"name": "User Work Mode",
@@ -623,7 +621,6 @@
623621
}
624622
}
625623
},
626-
627624
"switch": {
628625
"backup_function": {
629626
"name": "Backup Function"
@@ -690,7 +687,6 @@
690687
"schedule_6_start": {
691688
"name": "Schedule 6 Start"
692689
},
693-
694690
"schedule_1_end": {
695691
"name": "Schedule 1 End"
696692
},
@@ -737,4 +733,4 @@
737733
}
738734
}
739735
}
740-
}
736+
}

custom_components/marstek_modbus/translations/nl.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@
156156
"name": "Totale Ontlaadenergie"
157157
},
158158
"battery_cycle_count": {
159-
"name": "Cycli"
159+
"name": "Volledige cycli (BMS)"
160160
},
161161
"battery_cycle_count_calc": {
162-
"name": "Cycli (Calc)"
162+
"name": "Volledige cycli (Calc)"
163163
},
164164
"total_daily_charging_energy": {
165165
"name": "Dagelijkse Oplaadenergie"
@@ -223,7 +223,7 @@
223223
},
224224
"battery_1_cell_13_voltage": {
225225
"name": "Batterij pack 1 Cel 13 Spanning"
226-
}
226+
},
227227
"battery_2_cell_1_voltage": {
228228
"name": "Batterij pack 2 Cel 1 Spanning"
229229
},
@@ -437,7 +437,6 @@
437437
"alarm_status": {
438438
"name": "Alarmstatus"
439439
},
440-
441440
"modbus_address": {
442441
"name": "Modbus-adres"
443442
},
@@ -453,7 +452,6 @@
453452
"wifi_signal_strength": {
454453
"name": "WiFi-signaalsterkte"
455454
},
456-
457455
"round_trip_efficiency_total": {
458456
"name": "Totaal rendement"
459457
},
@@ -484,7 +482,6 @@
484482
"mppt2_power": {
485483
"name": "MPPT2 Vermogen"
486484
},
487-
488485
"mppt3_voltage": {
489486
"name": "MPPT3 Spanning"
490487
},
@@ -503,7 +500,6 @@
503500
"mppt4_power": {
504501
"name": "MPPT4 Vermogen"
505502
},
506-
507503
"bluetooth_status": {
508504
"name": "Bluetooth-status",
509505
"state": {
@@ -515,7 +511,6 @@
515511
}
516512
}
517513
},
518-
519514
"binary_sensor": {
520515
"wifi_status": {
521516
"name": "WiFi-status"
@@ -527,7 +522,6 @@
527522
"name": "Ontlaadlimiet"
528523
}
529524
},
530-
531525
"select": {
532526
"user_work_mode": {
533527
"name": "Gebruikersmodus",
@@ -560,7 +554,6 @@
560554
"China": "China"
561555
}
562556
},
563-
564557
"schedule_1_days": {
565558
"name": "Schema 1 Dagen",
566559
"state": {
@@ -746,4 +739,4 @@
746739
}
747740
}
748741
}
749-
}
742+
}

0 commit comments

Comments
 (0)