From 3516e7bb9005e10a3db93b51ddc93136f3445173 Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 7 Feb 2025 14:34:04 +0100 Subject: [PATCH] chore: minor --- templates/definition/meter/enphase.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/templates/definition/meter/enphase.yaml b/templates/definition/meter/enphase.yaml index 59f310f85c..440f8db9eb 100644 --- a/templates/definition/meter/enphase.yaml +++ b/templates/definition/meter/enphase.yaml @@ -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" }} @@ -29,7 +32,7 @@ render: | password: {{ .token }} insecure: true {{- end }} - cache: 5s + cache: {{ .cache }} jq: .consumption[] | select(.measurementType == "net-consumption").wNow currents: - source: http @@ -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 @@ -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 @@ -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" }} @@ -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 @@ -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: @@ -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 @@ -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 @@ -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" }} @@ -129,7 +132,7 @@ render: | password: {{ .token }} insecure: true {{- end }} - cache: 5s + cache: {{ .cache }} jq: .storage[] | .wNow soc: source: http @@ -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 }}