diff --git a/templates/definition/meter/senec-connect.yaml b/templates/definition/meter/senec-connect.yaml new file mode 100644 index 000000000..a1fda7799 --- /dev/null +++ b/templates/definition/meter/senec-connect.yaml @@ -0,0 +1,75 @@ +template: senec-connect +products: + - brand: SENEC + description: + generic: .Connect (Cloud) + - brand: SENEC + description: + generic: .Home P4 + - brand: SENEC + description: + generic: .Home E4 +requirements: + description: + de: >- + Cloud-Anbindung über die SENEC.Connect-API. Ein Subscription Key aus dem SENEC + Developer Portal wird benötigt. Der Zugriff ist read-only, eine Batteriesteuerung ist darüber + nicht möglich. + en: >- + Cloud connection via the SENEC.Connect API. A subscription key from the SENEC + developer portal is required. Access is read-only, battery control is not possible. +params: + - name: usage + choice: ["grid", "pv", "battery"] + - name: token + required: true + description: + de: Subscription Key + en: Subscription key + help: + de: Abonnement-Schlüssel aus dem SENEC Developer Portal (wird als Header `Ocp-Apim-Subscription-Key` gesendet). + en: Subscription key from the SENEC developer portal (sent as header `Ocp-Apim-Subscription-Key`). + type: string + - name: maxacpower + - preset: battery-minmaxsoc +render: | + {{ define "senec-connect-plugin" }} + source: http + uri: https://apim-eds-gwc-prod.azure-api.net/senec-connect/v1/systems/device-data/general + headers: + - accept: application/json + - Ocp-Apim-Subscription-Key: {{ .token }} + cache: 1s + {{- end }} + type: custom + power: + {{- include "senec-connect-plugin" . | indent 2 }} + {{- if eq .usage "grid" }} + jq: .[0].meter.grid_power # + from grid, - to grid + {{- end }} + {{- if eq .usage "pv" }} + jq: .[0].meter.production + {{- end }} + {{- if eq .usage "battery" }} + jq: .[0].battery.power # + charge, - discharge + scale: -1 + {{- end }} + {{- if eq .usage "pv" }} + maxacpower: {{ .maxacpower }} # W + {{- end }} + {{- if eq .usage "battery" }} + soc: + {{- include "senec-connect-plugin" . | indent 2 }} + jq: .[0].battery.state_of_charge + capacity: # nameplate rating + {{- include "senec-connect-plugin" . | indent 2 }} + jq: .[0].bessNameplate.design_capacity + scale: 0.001 # Wh -> kWh + maxchargepower: # nameplate rating + {{- include "senec-connect-plugin" . | indent 2 }} + jq: .[0].bessNameplate.active_charge_power + maxdischargepower: # nameplate rating + {{- include "senec-connect-plugin" . | indent 2 }} + jq: .[0].bessNameplate.active_discharge_power + {{- include "battery-minmaxsoc" . }} + {{- end }}