Plexlog: fix grid power (BC) (#21061)

This commit is contained in:
VolkerK62 2025-05-06 00:04:59 +02:00 • committed by GitHub
parent 629da507a4
commit bfd6fcf790
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,9 +12,16 @@ params:
- name: usage
choice: ["grid", "pv", "battery"]
allinone: true
- name: modbus
choice: ["tcpip"]
id: 1
port: 503
- name: capacity
advanced: true
- name: host
deprecated: true
- name: port
default: 503
deprecated: true
render: |
type: custom
{{- if eq .usage "grid" }}
@ -22,8 +29,7 @@ render: |
source: calc
add:
- source: modbus
uri: {{ .host }}:{{ .port }}
id: 1
{{- include "modbus" . | indent 4 }}
register:
address: 0 # Erzeugung
type: input
@ -31,19 +37,25 @@ render: |
scale: -1
timeout: 30s
- source: modbus
uri: {{ .host }}:{{ .port }}
id: 1
{{- include "modbus" . | indent 4 }}
register:
address: 2 # Verbrauch
type: input
decode: int32
timeout: 30s
- source: modbus
{{- include "modbus" . | indent 4 }}
register:
address: 37 # Batterie Leistung
type: input
decode: int32
scale: -1
timeout: 30s
{{- end }}
{{- if eq .usage "pv" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
id: 1
{{- include "modbus" . | indent 2 }}
register:
address: 0 # Erzeugung
type: input
@ -53,8 +65,7 @@ render: |
{{- if eq .usage "battery" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
id: 1
{{- include "modbus" . | indent 2 }}
register:
address: 37 # Batterie Leistung
type: input
@ -62,11 +73,11 @@ render: |
timeout: 30s
soc:
source: modbus
uri: {{ .host }}:{{ .port }}
id: 1
{{- include "modbus" . | indent 2 }}
register:
address: 36 # Batterie SOC
type: input
decode: uint16
timeout: 30s
capacity: {{ .capacity }} # kWh
{{- end }}