FoxESS: cleanup templates (#9561)

This commit is contained in:
premultiply 2023-09-14 21:06:32 +02:00 • committed by GitHub
parent c92017d8a5
commit a29c509904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 73 deletions

View file

@ -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 }}

View file

@ -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

View file

@ -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 }}