-
-
Notifications
You must be signed in to change notification settings - Fork 738
/
Copy pathenphase.yaml
79 lines (79 loc) · 2.23 KB
/
enphase.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
template: enphase
products:
- brand: Enphase
description:
generic: IQ Envoy
requirements:
description:
de: 'Als Batteriespeicher werden seitens der Enphase-API derzeit nur die Batterien vom Typ "AC Battery" unterstützt.'
en: 'Only batteries of type "AC Battery" are currently supported by Enphase-API.'
params:
- name: usage
choice: ["grid", "pv", "battery"]
- name: host
- 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"
- name: capacity
advanced: true
render: |
type: custom
{{- if eq .usage "grid" }}
power:
source: http
uri: http://{{ .host }}/production.json
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .consumption[] | select(.measurementType == "net-consumption").wNow
{{- end }}
{{- if eq .usage "pv" }}
power:
source: http
uri: http://{{ .host }}/production.json
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .production | max_by(.wNow).wNow
energy:
source: http
uri: http://{{ .host }}/production.json
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .production | max_by(.wNow).whLifetime
scale: 0.001
{{- end }}
{{- if eq .usage "battery" }}
power:
source: http
uri: http://{{ .host }}/production.json
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .storage[] | .wNow
soc:
source: http
uri: http://{{ .host }}/ivp/ensemble/inventory
{{- if .token }}
auth:
type: bearer
password: {{ .token }}
insecure: true
{{- end }}
jq: .[].devices | map(.percentFull) | add / length
capacity: {{ .capacity }} # kWh
{{- end }}