From 1ea8528dc39f083cdfdd95fc51bb50f19b18ea34 Mon Sep 17 00:00:00 2001 From: Markus Thierolf <77847348+thierolm@users.noreply.github.com> Date: Sat, 7 May 2022 16:30:46 +0200 Subject: [PATCH] Kostal Piko: add battery to template (#3343) --- templates/definition/meter/kostal-piko.yaml | 12 +++++++++++- templates/docs/meter/kostal-piko_0.yaml | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/templates/definition/meter/kostal-piko.yaml b/templates/definition/meter/kostal-piko.yaml index 4c902a2f8..ada8276e6 100644 --- a/templates/definition/meter/kostal-piko.yaml +++ b/templates/definition/meter/kostal-piko.yaml @@ -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 -}} diff --git a/templates/docs/meter/kostal-piko_0.yaml b/templates/docs/meter/kostal-piko_0.yaml index eb07a0f97..51fdd4e11 100644 --- a/templates/docs/meter/kostal-piko_0.yaml +++ b/templates/docs/meter/kostal-piko_0.yaml @@ -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