From dbe0f2f5244909e1e0ca1ba9132c3646e96979e4 Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Fri, 11 Aug 2023 23:01:13 +0200 Subject: [PATCH] Enphase: fix soc and power (#9332) * fix soc and power readings * remove unspecified grid import energy * remove cache * wip --- templates/definition/meter/enphase.yaml | 29 +++++++++---------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/templates/definition/meter/enphase.yaml b/templates/definition/meter/enphase.yaml index 2ff2f0e56a..c830c5aa9f 100644 --- a/templates/definition/meter/enphase.yaml +++ b/templates/definition/meter/enphase.yaml @@ -19,18 +19,7 @@ render: | {{- if eq .usage "grid" }} power: source: http - uri: http://{{ .host }}/production.json - method: GET - {{- if .token }} - auth: - type: bearer - password: {{ .token }} - insecure: true - {{- end }} - jq: .consumption[] | select(.measurementType == "net-consumption").wNow - energy: - source: http - uri: http://{{ .host }}/production.json + uri: http://{{ .host }}/ivp/livedata/status method: GET {{- if .token }} auth: @@ -38,13 +27,13 @@ render: | password: {{ .token }} insecure: true {{- end }} - jq: .consumption[] | select(.measurementType == "net-consumption").whLifetime + jq: .meters.grid.agg_p_mw scale: 0.001 {{- end }} {{- if eq .usage "pv" }} power: source: http - uri: http://{{ .host }}/production.json + uri: http://{{ .host }}/ivp/livedata/status method: GET {{- if .token }} auth: @@ -52,7 +41,8 @@ render: | password: {{ .token }} insecure: true {{- end }} - jq: .production[] | select(.measurementType == "production").wNow + jq: .meters.pv.agg_p_mw + scale: 0.001 energy: source: http uri: http://{{ .host }}/production.json @@ -69,7 +59,7 @@ render: | {{- if eq .usage "battery" }} power: source: http - uri: http://{{ .host }}/production.json?details=1 + uri: http://{{ .host }}/ivp/livedata/status method: GET {{- if .token }} auth: @@ -77,10 +67,11 @@ render: | password: {{ .token }} insecure: true {{- end }} - jq: .storage[] | select(.type == "acb").wNow + jq: .meters.storage.agg_p_mw + scale: 0.001 soc: source: http - uri: http://{{ .host }}/ivp/ensemble/inventory + uri: http://{{ .host }}/ivp/livedata/status method: GET {{- if .token }} auth: @@ -88,7 +79,7 @@ render: | password: {{ .token }} insecure: true {{- end }} - jq: .[].devices | map(.percentFull) | add / length + jq: .meters.soc {{- if .capacity }} capacity: {{ .capacity }} # kWh {{- end }}