From e017ce058600d8367dab2ac2c7382fd997f02bc2 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Thu, 30 Dec 2021 10:00:28 +0100 Subject: [PATCH] Fix Piko MP Plus template The source XML has no `value` attribute when PV has no power. This adds a check for that --- templates/definition/meter/kostal-piko-mp-plus.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/definition/meter/kostal-piko-mp-plus.yaml b/templates/definition/meter/kostal-piko-mp-plus.yaml index 2ae6988b0..5c6cff60c 100644 --- a/templates/definition/meter/kostal-piko-mp-plus.yaml +++ b/templates/definition/meter/kostal-piko-mp-plus.yaml @@ -21,5 +21,5 @@ render: | # PV source: http uri: http://{{ .host }}/measurements.xml - jq: .root.Device.Measurements.Measurement[] | select(.attrType == "AC_Power") | .attrValue | tonumber + jq: .root.Device.Measurements.Measurement[] | select(.attrType == "AC_Power") | if has ("attrValue") then .attrValue else "0" end | tonumber {{- end -}}