Kostal Piko/ Piko BA: less grid http requests and calculation corrections (#3655)
Some checks failed
Release / call-build-workflow (push) Has been cancelled
Release / Publish Docker :release (push) Has been cancelled
Release / Publish Github & APT release (push) Has been cancelled

This commit is contained in:
Markus Thierolf 2022-06-18 11:42:41 +02:00 • committed by GitHub
parent 19ab477500
commit 0f5a72bb02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,32 +14,27 @@ render: |
power: power:
{{- if eq .usage "grid" }} {{- if eq .usage "grid" }}
# Grid # Grid
source: calc source: http
add: uri: http://{{ .host }}/api/dxs.json?dxsEntries=83886336&dxsEntries=83886848&dxsEntries=83886592&dxsEntries=67109120 # Home PV Power + Home Grid Power + Home Bat Power - PV/Bat Inverter Power
- source: http # | ----------------------------- Home PV W -------- | + | --------------------------- Home Grid W -------- | + | --------------------------- Home Bat W --------- | - | --------------------------- PV/BAT Inv W ------- |
uri: http://{{ .host }}/api/dxs.json?dxsEntries=67109120 # PV AC Ausgang jq: (.dxsEntries[] | select(.dxsId==83886336) | .value ) + (.dxsEntries[] | select(.dxsId==83886848) | .value ) + (.dxsEntries[] | select(.dxsId==83886592) | .value ) - (.dxsEntries[] | select(.dxsId==67109120) | .value )
jq: .dxsEntries[0].value | if . == null then 0 else . end
scale: -1
- source: http
uri: http://{{ .host }}/api/dxs.json?dxsEntries=83886848 # Netzbezug
jq: .dxsEntries[0].value | if . == null then 0 else . end
- source: http
uri: http://{{ .host }}/api/dxs.json?dxsEntries=83886336 # PV Eigenverbrauch
jq: .dxsEntries[0].value | if . == null then 0 else . end
{{- end -}} {{- end -}}
{{- if eq .usage "pv" }} {{- if eq .usage "pv" }}
# PV # PV
source: http source: http
uri: http://{{ .host }}/api/dxs.json?dxsEntries=67109120 # PV AC Ausgang uri: http://{{ .host }}/api/dxs.json?dxsEntries=33555203&dxsEntries=33555459 # PV1 Power + PV2 Power
jq: .dxsEntries[0].value | if . == null then 0 else . end # | ----------------------------- PV1 W ------------ | + | ----------------------------- PV2 W ------------ |
jq: (.dxsEntries[] | select(.dxsId==33555203) | .value ) + (.dxsEntries[] | select(.dxsId==33555459) | .value )
{{- end -}} {{- end -}}
{{- if eq .usage "battery" }} {{- if eq .usage "battery" }}
# Battery # Battery
source: http source: http
uri: http://{{ .host }}/api/dxs.json?dxsEntries=33556226&dxsEntries=33556238&dxsEntries=33556230 # Battery Voltage * Energy * Charging Indicator uri: http://{{ .host }}/api/dxs.json?dxsEntries=33556225&dxsEntries=33556226 # Battery Current A * Battery Voltage
jq: (.dxsEntries[] | select(.dxsId==33556226) | .value) * (.dxsEntries[] | select(.dxsId==33556238) | .value) * (if (.dxsEntries[] | select(.dxsId==33556230) | .value) == 0 then -1 else 1 end) | if . == null then 0 else . end # -1 * | ----------------------------- Bat A ------------ | * | ----------------------------- Bat V ------------ |
jq: -1 * (.dxsEntries[] | select(.dxsId==33556225) | .value ) * (.dxsEntries[] | select(.dxsId==33556226) | .value )
soc: soc:
source: http source: http
uri: http://{{ .host }}/api/dxs.json?dxsEntries=33556229 # Battery SOC uri: http://{{ .host }}/api/dxs.json?dxsEntries=33556229 # Battery SOC
jq: .dxsEntries[0].value | if . == null then 0 else . end # | ----------------------------- Bat SOC% --------- |
jq: (.dxsEntries[] | select(.dxsId==33556229) | .value )
{{- end -}} {{- end -}}