From 7b01721ff37c4ae893d26122e30bd670b686624f Mon Sep 17 00:00:00 2001 From: StefanSchoof <4662023+StefanSchoof@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:13:27 +0200 Subject: [PATCH] Vzlogger: add phase values (#15935) --- templates/definition/meter/vzlogger.yaml | 81 ++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/templates/definition/meter/vzlogger.yaml b/templates/definition/meter/vzlogger.yaml index 31e82cc0d..e7148baef 100644 --- a/templates/definition/meter/vzlogger.yaml +++ b/templates/definition/meter/vzlogger.yaml @@ -20,6 +20,51 @@ params: help: de: Multipliziere Rohwert mit diesem Faktor en: Multiply by this value + - name: l1currentuuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Strom in Phase 1 (OBIS Code 31.7.0) + en: The vzlogger channel uuid for current on phase 1 (OBIS Code 31.7.0) + - name: l2currentuuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Strom in Phase 2 (OBIS Code 51.7.0) + en: The vzlogger channel uuid for current on phase 2 (OBIS Code 51.7.0) + - name: l3currentuuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Strom in Phase 3 (OBIS Code 71.7.0) + en: The vzlogger channel uuid for current on phase 3 (OBIS Code 71.7.0) + - name: l1poweruuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Leistung in Phase 1 (OBIS Code 16.7.0) + en: The vzlogger channel uuid for power on phase 1 (OBIS Code 16.7.0) + - name: l2poweruuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Leistung in Phase 2 (OBIS Code 36.7.0) + en: The vzlogger channel uuid for power on phase 2 (OBIS Code 36.7.0) + - name: l3poweruuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Leistung in Phase 3 (OBIS Code 56.7.0) + en: The vzlogger channel uuid for power on phase 3 (OBIS Code 56.7.0) + - name: l1voltageuuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Spannung in Phase 1 (OBIS Code 32.7.0) + en: The vzlogger channel uuid for voltage on phase 1 (OBIS Code 32.7.0) + - name: l2voltageuuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Spannung in Phase 2 (OBIS Code 52.7.0) + en: The vzlogger channel uuid for voltage on phase 2 (OBIS Code 52.7.0) + - name: l3voltageuuid + advanced: true + description: + de: Die vzlogger Kanal uuid für Spannung in Phase 3 (OBIS Code 72.7.0) + en: The vzlogger channel uuid for voltage on phase 3 (OBIS Code 72.7.0) render: | type: custom power: # power reading @@ -29,3 +74,39 @@ render: | {{- if .scale }} scale: {{ .scale }} {{- end }} + {{ if and .l1currentuuid .l2currentuuid .l3currentuuid -}} + currents: + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l1currentuuid) }}) | .tuples[0][1] + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l2currentuuid) }}) | .tuples[0][1] + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l3currentuuid) }}) | .tuples[0][1] + {{ end -}} + {{ if and .l1poweruuid .l2poweruuid .l3poweruuid -}} + powers: + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l1poweruuid) }}) | .tuples[0][1] + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l2poweruuid) }}) | .tuples[0][1] + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l3poweruuid) }}) | .tuples[0][1] + {{ end -}} + {{ if and .l1voltageuuid .l2voltageuuid .l3voltageuuid -}} + voltages: + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l1voltageuuid) }}) | .tuples[0][1] + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l2voltageuuid) }}) | .tuples[0][1] + - source: http + uri: http://{{ .host }}:{{ .port }}/ + jq: .data[] | select(.uuid=={{ quote (trimAll "'" .l3voltageuuid) }}) | .tuples[0][1] + {{ end -}}