Kostal Piko: add battery to template (#3343)

This commit is contained in:
Markus Thierolf 2022-05-07 16:30:46 +02:00 • committed by GitHub
parent edc078dc03
commit 1ea8528dc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -7,7 +7,7 @@ guidedsetup:
enable: true
params:
- name: usage
choice: ["grid", "pv"]
choice: ["grid", "pv", "battery"]
- name: host
render: |
type: custom
@ -33,3 +33,13 @@ render: |
uri: http://{{ .host }}/api/dxs.json?dxsEntries=67109120 # PV AC Ausgang
jq: .dxsEntries[0].value | if . == null then 0 else . end
{{- end -}}
{{- if eq .usage "battery" }}
# Battery
source: http
uri: http://{{ .host }}/api/dxs.json?dxsEntries=33556226,33556238 # Battery Voltage * Energy
jq: (.dxsEntries[] | select(.dxsId==33556226) | .value) * (.dxsEntries[] | select(.dxsId==33556238) | .value) | if . == null then 0 else . end
soc:
source: http
uri: http://{{ .host }}/api/dxs.json?dxsEntries=33556229 # Battery SOC
jq: .dxsEntries[0].value | if . == null then 0 else . end
{{- end -}}

View file

@ -14,3 +14,9 @@ render:
template: kostal-piko
usage: pv
host: 192.0.2.2 # IP-Adresse oder Hostname
- usage: battery
default: |
type: template
template: kostal-piko
usage: battery
host: 192.0.2.2 # IP-Adresse oder Hostname