Fix Piko MP Plus template
The source XML has no `value` attribute when PV has no power. This adds a check for that
This commit is contained in:
parent
07c559b4c7
commit
e017ce0586
1 changed files with 1 additions and 1 deletions
|
|
@ -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 -}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue