Skip to content

Commit

Permalink
Enphase: fix multiphase currents (#18200)
Browse files Browse the repository at this point in the history
Co-authored-by: Ante Karamatić <[email protected]>
  • Loading branch information
ivoks and Ante Karamatić authored Jan 13, 2025
1 parent 59ddfd5 commit 4acb4cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions templates/definition/meter/enphase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
jq: if .consumption[] | select(.measurementType == "net-consumption").activeCount >= 1 then .consumption[] | select(.measurementType == "net-consumption").lines[0].rmsCurrent else 0 end
jq: if (( .consumption[] | select(.measurementType == "net-consumption").activeCount >= 1 ) and ( .consumption[] | select(.measurementType == "net-consumption").lines | length >= 1 )) then .consumption[] | select(.measurementType == "net-consumption").lines[0].rmsCurrent else 0 end
- source: http
uri: http://{{ .host }}/production.json?details=1
{{- if .token }}
Expand All @@ -48,7 +48,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
jq: if .consumption[] | select(.measurementType == "net-consumption").activeCount >= 1 then .consumption[] | select(.measurementType == "net-consumption").lines[1].rmsCurrent else 0 end
jq: if (( .consumption[] | select(.measurementType == "net-consumption").activeCount >= 1 ) and ( .consumption[] | select(.measurementType == "net-consumption").lines | length >= 2 )) then .consumption[] | select(.measurementType == "net-consumption").lines[1].rmsCurrent else 0 end
- source: http
uri: http://{{ .host }}/production.json?details=1
{{- if .token }}
Expand All @@ -57,7 +57,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
jq: if .consumption[] | select(.measurementType == "net-consumption").activeCount >= 1 then .consumption[] | select(.measurementType == "net-consumption").lines[2].rmsCurrent else 0 end
jq: if (( .consumption[] | select(.measurementType == "net-consumption").activeCount >= 1 ) and ( .consumption[] | select(.measurementType == "net-consumption").lines | length >= 3 )) then .consumption[] | select(.measurementType == "net-consumption").lines[2].rmsCurrent else 0 end
{{- end }}
{{- if eq .usage "pv" }}
power:
Expand Down Expand Up @@ -90,7 +90,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
jq: if .production[] | select(.measurementType == "production").activeCount >= 1 then .production[] | select(.measurementType == "production").lines[0].rmsCurrent else 0 end
jq: if (( .production[] | select(.measurementType == "production").activeCount >= 1 ) and ( .production[] | select(.measurementType == "production").lines | length >= 1 )) then .production[] | select(.measurementType == "production").lines[0].rmsCurrent else 0 end
- source: http
uri: http://{{ .host }}/production.json?details=1
{{- if .token }}
Expand All @@ -99,7 +99,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
jq: if .production[] | select(.measurementType == "production").activeCount >= 1 then .production[] | select(.measurementType == "production").lines[1].rmsCurrent else 0 end
jq: if (( .production[] | select(.measurementType == "production").activeCount >= 1 ) and ( .production[] | select(.measurementType == "production").lines | length >= 2 )) then .production[] | select(.measurementType == "production").lines[1].rmsCurrent else 0 end
- source: http
uri: http://{{ .host }}/production.json?details=1
{{- if .token }}
Expand All @@ -108,7 +108,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
jq: if .production[] | select(.measurementType == "production").activeCount >= 1 then .production[] | select(.measurementType == "production").lines[2].rmsCurrent else 0 end
jq: if (( .production[] | select(.measurementType == "production").activeCount >= 1 ) and ( .production[] | select(.measurementType == "production").lines | length >= 3 )) then .production[] | select(.measurementType == "production").lines[2].rmsCurrent else 0 end
{{- end }}
{{- if eq .usage "battery" }}
power:
Expand Down

0 comments on commit 4acb4cc

Please sign in to comment.