diff --git a/templates/definition/meter/senec-home.yaml b/templates/definition/meter/senec-home.yaml index 4bcedc820..86ad6962b 100644 --- a/templates/definition/meter/senec-home.yaml +++ b/templates/definition/meter/senec-home.yaml @@ -8,6 +8,15 @@ params: choice: ["grid", "pv", "battery"] allinone: true - name: host + - name: schema + description: + de: Schema + en: Schema + type: choice + validvalues: + - http + - https + default: http - name: capacity advanced: true render: | @@ -16,7 +25,8 @@ render: | source: http unpack: hex decode: float32 - uri: http://{{ .host }}/lala.cgi + uri: {{ .schema }}://{{ .host }}/lala.cgi + insecure: true method: POST headers: - content-type: application/json @@ -32,9 +42,34 @@ render: | body: '{"ENERGY":{"GUI_BAT_DATA_POWER":""}}' jq: .ENERGY.GUI_BAT_DATA_POWER | sub("fl_"; "") scale: -1 + {{- end }} + energy: + source: http + unpack: hex + decode: float32 + uri: {{ .schema }}://{{ .host }}/lala.cgi + insecure: true + method: POST + headers: + - content-type: application/json + {{- if eq .usage "grid" }} + body: '{"STATISTIC":{"LIVE_GRID_IMPORT":""}}' + jq: .STATISTIC.LIVE_GRID_IMPORT | sub("fl_"; "") + {{- end }} + {{- if eq .usage "pv" }} + body: '{"STATISTIC":{"LIVE_PV_GEN":""}}' + jq: .STATISTIC.LIVE_PV_GEN | sub("fl_"; "") + {{- end }} + {{- if eq .usage "battery" }} + body: '{"STATISTIC":{"LIVE_BAT_DISCHARGE":""}}' + jq: .STATISTIC.LIVE_BAT_DISCHARGE | sub("fl_"; "") + {{- end }} + scale: 0.001 + {{- if eq .usage "battery" }} soc: source: http - uri: http://{{ .host }}/lala.cgi + uri: {{ .schema }}://{{ .host }}/lala.cgi + insecure: true method: POST headers: - content-type: application/json diff --git a/templates/docs/meter/senec-home_0.yaml b/templates/docs/meter/senec-home_0.yaml new file mode 100644 index 000000000..868b1e56d --- /dev/null +++ b/templates/docs/meter/senec-home_0.yaml @@ -0,0 +1,44 @@ +product: + brand: SENEC + description: .Home +render: + - usage: grid + default: | + type: template + template: senec-home + usage: grid + host: 192.0.2.2 # IP-Adresse oder Hostname + protocol: http # Optional + advanced: | + type: template + template: senec-home + usage: grid + host: 192.0.2.2 # IP-Adresse oder Hostname + protocol: http # Optional + - usage: pv + default: | + type: template + template: senec-home + usage: pv + host: 192.0.2.2 # IP-Adresse oder Hostname + protocol: http # Optional + advanced: | + type: template + template: senec-home + usage: pv + host: 192.0.2.2 # IP-Adresse oder Hostname + protocol: http # Optional + - usage: battery + default: | + type: template + template: senec-home + usage: battery + host: 192.0.2.2 # IP-Adresse oder Hostname + protocol: http # Optional + advanced: | + type: template + template: senec-home + usage: battery + host: 192.0.2.2 # IP-Adresse oder Hostname + protocol: http # Optional + capacity: 50 # Akkukapazität in kWh (Optional)