From 9e562fa28fca94075dbe18216eabd6b906bcd067 Mon Sep 17 00:00:00 2001 From: Ajinkya Gokhale <121028346+AjinkyaGokhale@users.noreply.github.com> Date: Thu, 9 Apr 2026 17:31:10 +0200 Subject: [PATCH] Add stromleser.one (#28976) --- templates/definition/meter/stromleser.yaml | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 templates/definition/meter/stromleser.yaml diff --git a/templates/definition/meter/stromleser.yaml b/templates/definition/meter/stromleser.yaml new file mode 100644 index 000000000..c1768bb91 --- /dev/null +++ b/templates/definition/meter/stromleser.yaml @@ -0,0 +1,35 @@ +template: stromleser +products: + - brand: stromleser.one + description: + generic: IR Reader +requirements: + description: + en: Requires a stromleser.one device accessible on the local network. + de: Erfordert ein stromleser.one-Gerät im lokalen Netzwerk. +params: + - name: usage + choice: ["grid", "pv"] + - name: host + - name: cache + default: 15s +render: | + type: custom + power: + source: http + uri: http://{{ .host }}/v1/data + cache: {{ .cache }} + {{- if eq .usage "pv" }} + jq: 'def toW: split(" ") | (.[0]|tonumber) * (if .[1]=="kW" then 1000 elif .[1]=="mW" then 0.001 else 1 end); try (.["2.7.0"]|toW) // (0 - (.["16.7.0"]|toW))' + {{- else }} + jq: 'def toW: split(" ") | (.[0]|tonumber) * (if .[1]=="kW" then 1000 elif .[1]=="mW" then 0.001 else 1 end); try (.["16.7.0"]|toW) // ((.["1.7.0"]|toW) - (.["2.7.0"]|toW))' + {{- end }} + energy: + source: http + uri: http://{{ .host }}/v1/data + cache: {{ .cache }} + {{- if eq .usage "pv" }} + jq: 'def tokWh: split(" ") | (.[0]|tonumber) * (if .[1]=="Wh" then 0.001 elif .[1]=="MWh" then 1000 else 1 end); (try (.["2.8.0"]|tokWh)) // 0' + {{- else }} + jq: 'def tokWh: split(" ") | (.[0]|tonumber) * (if .[1]=="Wh" then 0.001 elif .[1]=="MWh" then 1000 else 1 end); (try (.["1.8.0"]|tokWh)) // 0' + {{- end }}