Enphase: add token auth (firmware D7.x.xxx) and grid (#8247)

This commit is contained in:
salz3n 2023-06-06 11:45:38 +02:00 • committed by GitHub
parent c48b566558
commit 31aa841a4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 3 deletions

View file

@ -5,19 +5,64 @@ products:
generic: IQ Envoy
params:
- name: usage
choice: ["pv"]
choice: ["grid", "pv"]
- name: host
required: true
- name: token
help:
en: "Required if Envoy Firmware D7.x.xxx. Token is valid for one year. Instructions for obtaining a token via web UI: https://enphase.com/download/accessing-iq-gateway-local-apis-or-local-ui-token-based-authentication"
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"
render: |
type: custom
{{- if eq .usage "grid" }}
power:
source: http
uri: http://{{ .host }}/production.json
method: GET
jq: .production[0].wNow
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .consumption[] | select(.measurementType == "net-consumption").wNow
scale: 1
energy:
source: http
uri: http://{{ .host }}/production.json
method: GET
jq: .production[0].whLifetime
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .consumption[] | select(.measurementType == "net-consumption").whLifetime
scale: 0.001
{{- end }}
{{- if eq .usage "pv" }}
power:
source: http
uri: http://{{ .host }}/production.json
method: GET
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .production[] | select(.measurementType == "production").wNow
scale: 1
energy:
source: http
uri: http://{{ .host }}/production.json
method: GET
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .production[] | select(.measurementType == "production").whLifetime
scale: 0.001
{{- end }}

View file

@ -2,9 +2,17 @@ product:
brand: Enphase
description: IQ Envoy
render:
- usage: grid
default: |
type: template
template: enphase
usage: grid
host: 192.0.2.2 # IP-Adresse oder Hostname
token: # 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 (Optional)
- usage: pv
default: |
type: template
template: enphase
usage: pv
host: 192.0.2.2 # IP-Adresse oder Hostname
token: # 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 (Optional)

View file

@ -84,6 +84,7 @@
"DZG",
"E3/DC",
"Eastron",
"Enphase",
"FENECON",
"FoxESS",
"Fronius",