Skip to content

Commit

Permalink
chore: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Feb 7, 2025
1 parent ddf27d5 commit 3516e7b
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions templates/definition/meter/enphase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ params:
de: "Ab Envoy Firmware D7.x.xxx notwendig. Token ist ein Jahr gültig. Anleitung (Obtaining a token via web UI): https://enphase.com/download/accessing-iq-gateway-local-apis-or-local-ui-token-based-authentication"
- name: capacity
advanced: true
- name: cache
advanced: true
default: 1s
render: |
type: custom
{{- if eq .usage "grid" }}
Expand All @@ -29,7 +32,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
jq: .consumption[] | select(.measurementType == "net-consumption").wNow
currents:
- source: http
Expand All @@ -40,7 +43,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
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
Expand All @@ -50,7 +53,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
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
Expand All @@ -60,7 +63,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
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" }}
Expand All @@ -73,7 +76,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
jq: if (.production | length) > 1 and (.production[] | select(.measurementType == "production").activeCount >= 1) then .production[] | select(.measurementType == "production").wNow else .production[] | select(.type == "inverters").wNow end
energy:
source: http
Expand All @@ -84,7 +87,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
jq: if (.production | length) > 1 and (.production[] | select(.measurementType == "production").activeCount >= 1) then .production[] | select(.measurementType == "production").whLifetime else .production[] | select(.type == "inverters").whLifetime end
scale: 0.001
currents:
Expand All @@ -96,7 +99,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
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
Expand All @@ -106,7 +109,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
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
Expand All @@ -116,7 +119,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
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" }}
Expand All @@ -129,7 +132,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
jq: .storage[] | .wNow
soc:
source: http
Expand All @@ -140,7 +143,7 @@ render: |
password: {{ .token }}
insecure: true
{{- end }}
cache: 5s
cache: {{ .cache }}
jq: '[.[].devices[] | select(.percentFull != null) | .percentFull] | add / length'
capacity: {{ .capacity }} # kWh
{{- end }}

0 comments on commit 3516e7b

Please sign in to comment.