Smartfox: add cache (#19116)
This commit is contained in:
parent
9470ac786d
commit
84a89de974
1 changed files with 17 additions and 0 deletions
|
|
@ -13,6 +13,9 @@ params:
|
|||
- name: usage
|
||||
choice: ["grid", "pv", "aux"]
|
||||
- name: host
|
||||
- name: cache
|
||||
advanced: true
|
||||
default: 1s
|
||||
render: |
|
||||
{{- define "uri" -}}
|
||||
http://{{ .host }}/values.xml
|
||||
|
|
@ -22,40 +25,51 @@ render: |
|
|||
{{- if eq .usage "grid" }}
|
||||
power: # grid power in W
|
||||
source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="detailsPowerValue")."#content" | rtrimstr(" W")
|
||||
energy: # grid energy in kWh
|
||||
source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="energyValue")."#content" | rtrimstr(" kWh")
|
||||
voltages: # grid voltages in V
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="voltageL1Value")."#content" | rtrimstr(" V")
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="voltageL2Value")."#content" | rtrimstr(" V")
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="voltageL3Value")."#content" | rtrimstr(" V")
|
||||
currents: # grid currents in A
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="ampereL1Value")."#content" | rtrimstr(" A")
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="ampereL2Value")."#content" | rtrimstr(" A")
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="ampereL3Value")."#content" | rtrimstr(" A")
|
||||
powers: # grid powers in W
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="powerL1Value")."#content" | rtrimstr(" W")
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="powerL2Value")."#content" | rtrimstr(" W")
|
||||
- source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="powerL3Value")."#content" | rtrimstr(" W")
|
||||
{{- end }}
|
||||
|
|
@ -63,17 +77,20 @@ render: |
|
|||
# PV power and energy values are delivered for each inverter, we select them via regex and sum the values
|
||||
power: # PV power in W
|
||||
source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: '[.values.value[] | select(.attrid|test("wr\\d+PowerValue"))."#content" | rtrimstr(" kW") | tonumber] | add'
|
||||
scale: 1000 # wr1PowerValue, ..., wr5PowerValue are in kW
|
||||
energy: # PV energy in kWh
|
||||
source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: '[.values.value[] | select(.attrid|test("wr\\d+EnergyValue"))."#content" | rtrimstr(" kWh") | tonumber] | add'
|
||||
{{- end }}
|
||||
{{- if eq .usage "aux" }}
|
||||
power: # heating power in W
|
||||
source: http
|
||||
cache: {{ .cache }}
|
||||
uri: {{ include "uri" . }}
|
||||
jq: .values.value[] | select(.attrid=="htPowerMeasValue")."#content" | rtrimstr(" kW")
|
||||
scale: 1000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue