diff --git a/templates/definition/meter/fox-ess-h1-ethernet.yaml b/templates/definition/meter/fox-ess-h1.yaml similarity index 54% rename from templates/definition/meter/fox-ess-h1-ethernet.yaml rename to templates/definition/meter/fox-ess-h1.yaml index bea9b5850..a8bd78c4d 100644 --- a/templates/definition/meter/fox-ess-h1-ethernet.yaml +++ b/templates/definition/meter/fox-ess-h1.yaml @@ -1,14 +1,15 @@ template: fox-ess-h1 -covers: ["fox-ess-ethernet"] +covers: ["fox-ess-rs485", "fox-ess-ethernet"] products: - brand: FoxESS description: - generic: H1 via Ethernet + generic: H1 Series Hybrid Inverter params: - name: usage choice: ["pv", "battery"] - name: modbus - choice: ["tcpip"] + choice: ["rs485", "tcpip"] + id: 247 render: | type: custom {{- if eq .usage "pv" }} @@ -17,34 +18,50 @@ render: | add: - source: modbus {{- include "modbus" . | indent 4 }} - # register details register: + {{- if or (eq .modbus "tcpip") .tcpip }} address: 31002 # PV1 type: holding + {{- else }} + address: 11002 # PV1 + type: input + {{- end }} decode: int16 - source: modbus {{- include "modbus" . | indent 4 }} - # register details register: + {{- if or (eq .modbus "tcpip") .tcpip }} address: 31005 # PV2 type: holding + {{- else }} + address: 11005 # PV2 + type: input + {{- end }} decode: int16 {{- end }} {{- if eq .usage "battery" }} power: source: modbus {{- include "modbus" . | indent 2 }} - # register details register: - address: 31022 # Battery Charge/Discharge + {{- if or (eq .modbus "tcpip") .tcpip }} + address: 31022 # Battery charge/discharge type: holding + {{- else }} + address: 11008 # Battery charge/discharge + type: input + {{- end }} decode: int16 soc: source: modbus {{- include "modbus" . | indent 2 }} - # register details register: + {{- if or (eq .modbus "tcpip") .tcpip }} address: 31024 # Soc type: holding + {{- else }} + address: 11036 # Soc + type: input + {{- end }} decode: int16 {{- end }} diff --git a/templates/definition/meter/fox-ess-h3-ethernet.yaml b/templates/definition/meter/fox-ess-h3.yaml similarity index 92% rename from templates/definition/meter/fox-ess-h3-ethernet.yaml rename to templates/definition/meter/fox-ess-h3.yaml index 5de8c4dd8..48a7313e9 100644 --- a/templates/definition/meter/fox-ess-h3-ethernet.yaml +++ b/templates/definition/meter/fox-ess-h3.yaml @@ -2,12 +2,13 @@ template: fox-ess-h3 products: - brand: FoxESS description: - generic: H3 via Ethernet + generic: H3 Series Hybrid Inverter params: - name: usage choice: ["grid", "pv", "battery"] - name: modbus - choice: ["tcpip"] + choice: ["rs485", "tcpip"] + id: 247 render: | type: custom {{- if eq .usage "grid" }} @@ -50,14 +51,12 @@ render: | add: - source: modbus {{- include "modbus" . | indent 4 }} - # register details register: address: 31002 # PV1 type: holding decode: int16 - source: modbus {{- include "modbus" . | indent 4 }} - # register details register: address: 31005 # PV2 type: holding @@ -67,7 +66,6 @@ render: | power: source: modbus {{- include "modbus" . | indent 2 }} - # register details register: address: 31036 # Battery Charge/Discharge type: holding @@ -75,7 +73,6 @@ render: | soc: source: modbus {{- include "modbus" . | indent 2 }} - # register details register: address: 31038 # Soc type: holding diff --git a/templates/definition/meter/fox-ess-rs485.yaml b/templates/definition/meter/fox-ess-rs485.yaml deleted file mode 100644 index e79414fde..000000000 --- a/templates/definition/meter/fox-ess-rs485.yaml +++ /dev/null @@ -1,59 +0,0 @@ -template: fox-ess-rs485 -products: - - brand: FoxESS - description: - generic: FoxESS via RS485 Modbus -params: - - name: usage - choice: ["grid", "pv", "battery"] - - name: modbus - choice: ["rs485"] -render: | - type: custom - {{- if eq .usage "grid" }} - power: - source: modbus - {{- include "modbus" . | indent 2 }} - # register details - register: - address: 11021 # Grid power - type: holding - decode: int16 - {{- end }} - {{- if eq .usage "pv" }} - power: - source: calc - add: - - source: modbus - {{- include "modbus" . | indent 4 }} - # register details - register: - address: 11002 # PV1 - type: holding - decode: int16 - - source: modbus - {{- include "modbus" . | indent 4 }} - # register details - register: - address: 11005 # PV2 - type: holding - decode: int16 - {{- end }} - {{- if eq .usage "battery" }} - power: - source: modbus - {{- include "modbus" . | indent 2 }} - # register details - register: - address: 11008 # Battery Charge/Discharge - type: holding - decode: int16 - soc: - source: modbus - {{- include "modbus" . | indent 2 }} - # register details - register: - address: 11036 # Soc - type: holding - decode: int16 - {{- end }}