Skip to content

Commit

Permalink
Enphase: fix soc and power (#9332)
Browse files Browse the repository at this point in the history
* fix soc and power readings

* remove unspecified grid import energy

* remove cache

* wip
  • Loading branch information
premultiply authored Aug 11, 2023
1 parent f096716 commit dbe0f2f
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions templates/definition/meter/enphase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,30 @@ 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:
type: bearer
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:
type: bearer
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
Expand All @@ -69,26 +59,27 @@ 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:
type: bearer
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:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .[].devices | map(.percentFull) | add / length
jq: .meters.soc
{{- if .capacity }}
capacity: {{ .capacity }} # kWh
{{- end }}
Expand Down

0 comments on commit dbe0f2f

Please sign in to comment.