diff --git a/templates/definition/meter/plexlog.yaml b/templates/definition/meter/plexlog.yaml index d10e336b5..d17f93dd1 100644 --- a/templates/definition/meter/plexlog.yaml +++ b/templates/definition/meter/plexlog.yaml @@ -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 }}