Kostal Piko: add battery to template (#3343)
This commit is contained in:
parent
edc078dc03
commit
1ea8528dc3
2 changed files with 17 additions and 1 deletions
|
|
@ -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 -}}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue