Skip to content

Commit 18294af

Browse files
Add holdcharge battery mode option (#289)
Add holdcharge as a new battery mode option to the select entity. This mode prevents battery charging while still allowing discharge. Also update hold/holdcharge translations to use clearer terminology: discharge lock (Entladesperre) and charge lock (Ladesperre). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 66fdc91 commit 18294af

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

custom_components/evcc_intg/pyevcc_ha/const.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ class EVCCCONF_DEVICE_TYPES(Enum):
146146
"batterymode": {
147147
"unknown": "Unbekannt",
148148
"normal": "normal",
149-
"hold": "angehalten/gesperrt",
149+
"hold": "entladen sperren",
150150
"charge": "laden...",
151+
"holdcharge": "laden sperren",
151152
},
152153
"phaseaction":{
153154
"scale1p": "Reduziere auf einphasig",
@@ -173,8 +174,9 @@ class EVCCCONF_DEVICE_TYPES(Enum):
173174
"batterymode": {
174175
"unknown": "unknown",
175176
"normal": "normal",
176-
"hold": "on-hold",
177+
"hold": "lock discharge",
177178
"charge": "charging...",
179+
"holdcharge": "lock charge",
178180
},
179181
"phaseaction":{
180182
"scale1p": "Reducing to 1-phase charging",

custom_components/evcc_intg/pyevcc_ha/keys.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ def __str__(self):
8585
# "auxPower": 1116.8,
8686
AUXPOWER = ApiKey(json_key="auxPower", type=EP_TYPE.SITE)
8787

88-
# "batteryMode": unknown|normal|hold|charge
89-
# POST /api/batterymode/<mode>: set battery mode (unknown/normal/hold/charge)
88+
# "batteryMode": unknown|normal|hold|charge|holdcharge
89+
# POST /api/batterymode/<mode>: set battery mode (unknown/normal/hold/charge/holdcharge)
9090
# Directly controls the mode of all controllable batteries. evcc behavior like 'price limit' or 'prevent discharge while fast charging' is overruled. External mode resets after 60s. The external system has to call this endpoint regularly.
91-
BATTERYMODE = ApiKey(json_key="batteryMode", type=EP_TYPE.SITE, writeable=True, write_key="batterymode", options=["null", "unknown", "normal", "hold", "charge"])
91+
BATTERYMODE = ApiKey(json_key="batteryMode", type=EP_TYPE.SITE, writeable=True, write_key="batterymode", options=["null", "unknown", "normal", "hold", "charge", "holdcharge"])
9292

9393
# "battery":[{"power":0,"capacity":12,"soc":81,"controllable":false}], -> we must access this attribute via json_idx
9494
BATTERY = ApiKey(json_key="battery", type=EP_TYPE.SITE)

custom_components/evcc_intg/translations/de.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@
117117
"null": "löschen",
118118
"unknown": "unbekannt",
119119
"normal": "normal",
120-
"hold": "halten",
121-
"charge": "laden"
120+
"hold": "entladen sperren",
121+
"charge": "laden",
122+
"holdcharge": "laden sperren"
122123
}
123124
},
124125
"prioritysoc": {

custom_components/evcc_intg/translations/en.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@
119119
"null": "delete",
120120
"unknown": "unknown",
121121
"normal": "normal",
122-
"hold": "hold",
123-
"charge": "charge"
122+
"hold": "lock discharge",
123+
"charge": "charge",
124+
"holdcharge": "lock charge"
124125
}
125126
},
126127
"prioritysoc": {

0 commit comments

Comments
 (0)