Skip to content

Commit 0d76c12

Browse files
authored
Indevolt: add battery control (#31741)
1 parent 5120c8d commit 0d76c12

1 file changed

Lines changed: 72 additions & 3 deletions

File tree

templates/definition/meter/indevolt-battery.yaml

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ products:
1212
- brand: Indevolt
1313
description:
1414
generic: PowerFlex 3000 AC
15+
capabilities: ["battery-control"]
1516
requirements:
1617
description:
1718
de: |
@@ -41,6 +42,11 @@ params:
4142
- name: cache
4243
default: 5s
4344
- preset: battery-params
45+
- name: maxchargepower
46+
default: 2400
47+
help:
48+
en: Maximum charge power (W). Valid range 50-3000, depending on your device.
49+
de: Maximale Ladeleistung (W). Gültiger Bereich 50-3000, abhängig von Ihrem Gerät.
4450
render: |
4551
{{- define "auth" }}
4652
{{- if .user }}
@@ -69,25 +75,88 @@ render: |
6975
{{- end }}
7076
{{- if eq .usage "battery" }}
7177
power:
78+
# cJSON Point 6000 — Battery Power (W, Float)
79+
# Positive = charging, negative = discharging (matches evcc convention).
7280
source: http
7381
uri: http://{{ .host }}:8080/rpc/Indevolt.GetData?config={{ urlEncode `{"t":[6000]}` }}
7482
method: POST
7583
{{- include "auth" . | indent 2 }}
76-
jq: ."6000" # Battery Power (W); ggf. scale: -1 falls Vorzeichen invertiert
84+
jq: ."6000"
7785
cache: {{ .cache }}
7886
soc:
87+
# cJSON Point 6002 = Battery SOC Total (%, Float)
7988
source: http
8089
uri: http://{{ .host }}:8080/rpc/Indevolt.GetData?config={{ urlEncode `{"t":[6002]}` }}
8190
method: POST
8291
{{- include "auth" . | indent 2 }}
83-
jq: ."6002" # Battery SOC (%)
92+
jq: ."6002"
8493
cache: {{ .cache }}
8594
energy:
95+
# cJSON Point 6007 — Battery Total Discharging Energy (kWh, Num)
8696
source: http
8797
uri: http://{{ .host }}:8080/rpc/Indevolt.GetData?config={{ urlEncode `{"t":[6007]}` }}
8898
method: POST
8999
{{- include "auth" . | indent 2 }}
90-
jq: ."6007" # Battery Total Discharging Energy (kWh)
100+
jq: ."6007"
91101
cache: {{ .cache }}
102+
batterymode:
103+
source: switch
104+
switch:
105+
- case: 1 # normal
106+
set:
107+
source: sequence
108+
set:
109+
# Step 1: Set Mode to Self-consumed Prioritized (47005=1), which is the default for this battery
110+
- source: http
111+
uri: "http://{{ .host }}:8080/rpc/Indevolt.SetData?config={\"f\":16,\"t\":47005,\"v\":[1]}"
112+
method: POST
113+
{{- include "auth" . | indent 14 }}
114+
jq: .result
115+
# Step 2: Also Set Grid Charging Setting to Disable (1143=0) to enable normal operation
116+
- source: http
117+
uri: "http://{{ .host }}:8080/rpc/Indevolt.SetData?config={\"f\":16,\"t\":1143,\"v\":[0]}"
118+
method: POST
119+
{{- include "auth" . | indent 14 }}
120+
jq: .result
121+
- case: 2 # hold power
122+
set:
123+
source: sequence
124+
set:
125+
# Step 1: Set Mode to Real-time control (47005=4), which is necessary to write State Setting (Step 2)
126+
- source: http
127+
uri: "http://{{ .host }}:8080/rpc/Indevolt.SetData?config={\"f\":16,\"t\":47005,\"v\":[4]}"
128+
method: POST
129+
{{- include "auth" . | indent 14 }}
130+
jq: .result
131+
# Step 2: Set State Setting to Standby (47015=0), additionally adjusting power and SOC to valid values to avoid API rejections
132+
# API validity: documented ranges are power 50 to 2400 W (47016)
133+
- source: http
134+
uri: "http://{{ .host }}:8080/rpc/Indevolt.SetData?config={\"f\":16,\"t\":47015,\"v\":[0,50,{{ .minsoc }}]}"
135+
method: POST
136+
{{- include "auth" . | indent 14 }}
137+
jq: .result
138+
- case: 3 # charge
139+
set:
140+
source: sequence
141+
set:
142+
# Step 1: Set Mode to Real-time control (47005=4), which is necessary to write State Setting (Step 3)
143+
- source: http
144+
uri: "http://{{ .host }}:8080/rpc/Indevolt.SetData?config={\"f\":16,\"t\":47005,\"v\":[4]}"
145+
method: POST
146+
{{- include "auth" . | indent 14 }}
147+
jq: .result
148+
# Step 2: Set Grid Charging Setting to Charging (1143=1)
149+
- source: http
150+
uri: "http://{{ .host }}:8080/rpc/Indevolt.SetData?config={\"f\":16,\"t\":1143,\"v\":[1]}"
151+
method: POST
152+
{{- include "auth" . | indent 14 }}
153+
jq: .result
154+
# Step 3: Set State Setting to Charging (47015=1), additionally adjusting power and SOC to valid values, which is required by the API
155+
- source: http
156+
uri: "http://{{ .host }}:8080/rpc/Indevolt.SetData?config={\"f\":16,\"t\":47015,\"v\":[1,{{ .maxchargepower }},{{ .maxsoc }}]}"
157+
method: POST
158+
{{- include "auth" . | indent 14 }}
159+
jq: .result
160+
92161
{{- include "battery-params" . }}
93162
{{- end }}

0 commit comments

Comments
 (0)