Kostal Pico MP: add grid (#29077)

This commit is contained in:
andig 2026-04-13 13:55:07 +02:00 • committed by GitHub
parent db11f1d7c5
commit 4b9474481a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,14 +8,19 @@ products:
generic: coolcept fleX
params:
- name: usage
choice: ["pv"]
choice: ["grid", "pv"]
- name: host
render: |
type: custom
power:
{{- if eq .usage "pv" }}
# PV
source: http
uri: http://{{ .host }}/measurements.xml
jq: .root.Device.Measurements.Measurement[] | select(.attrType == "AC_Power") | if has ("attrValue") then .attrValue else "0" end | tonumber
{{- end }}
{{- if eq .usage "grid" }}
source: http
uri: http://{{ .host }}/measurements.xml
jq: .root.Device.Measurements.Measurement[] | select(.attrType == "GridPower") | if has ("attrValue") then .attrValue else "0" end | tonumber
scale: -1
{{- end }}