From 2f4f06fe88ab8969179d461f03e98e7b212e46e3 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 15 Jun 2023 21:45:57 +0200 Subject: [PATCH] FoxESS H3: add grid (#8403) --- .../definition/meter/fox-ess-h3-ethernet.yaml | 36 ++++++++++++++++++- templates/docs/meter/fox-ess-h3_0.yaml | 11 ++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/templates/definition/meter/fox-ess-h3-ethernet.yaml b/templates/definition/meter/fox-ess-h3-ethernet.yaml index bf86968ba..88ad92b87 100644 --- a/templates/definition/meter/fox-ess-h3-ethernet.yaml +++ b/templates/definition/meter/fox-ess-h3-ethernet.yaml @@ -5,11 +5,45 @@ products: generic: H3 via Ethernet params: - name: usage - choice: ["pv", "battery"] + choice: ["grid", "pv", "battery"] - name: modbus choice: ["tcpip"] render: | type: custom + {{- if eq .usage "grid" }} + power: + source: calc + add: + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 31026 # Meter Power R + type: holding + decode: int16 + scale: -1 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 31027 # Meter Power S + type: holding + decode: int16 + scale: -1 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 31028 # Meter Power T + type: holding + decode: int16 + scale: -1 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 31012 # Grid Consumption Total + type: holding + decode: uint32 + scale: 0.1 + {{- end }} {{- if eq .usage "pv" }} power: source: calc diff --git a/templates/docs/meter/fox-ess-h3_0.yaml b/templates/docs/meter/fox-ess-h3_0.yaml index 0489a9ef4..1fb69220c 100644 --- a/templates/docs/meter/fox-ess-h3_0.yaml +++ b/templates/docs/meter/fox-ess-h3_0.yaml @@ -2,6 +2,17 @@ product: brand: FoxESS description: H3 via Ethernet render: + - usage: grid + default: | + type: template + template: fox-ess-h3 + usage: grid + + # Modbus TCP + modbus: tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port - usage: pv default: | type: template