269 lines
7.4 KiB
YAML
269 lines
7.4 KiB
YAML
template: fox-ess-h3-smart
|
|
products:
|
|
- brand: FoxESS
|
|
description:
|
|
generic: H3-Pro/Smart Series Hybrid Inverter
|
|
capabilities: ["battery-control"]
|
|
params:
|
|
- name: usage
|
|
choice: ["grid", "pv", "battery"]
|
|
- name: modbus
|
|
choice: ["rs485", "tcpip"]
|
|
id: 247
|
|
- name: maxacpower
|
|
- preset: battery-params
|
|
- name: maxchargepower
|
|
required: true
|
|
render: |
|
|
type: custom
|
|
{{- if eq .usage "grid" }}
|
|
power:
|
|
source: calc
|
|
add:
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 38816 # Meter Power R
|
|
type: holding
|
|
decode: int32
|
|
scale: -0.1
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 38818 # Meter Power S
|
|
type: holding
|
|
decode: int32
|
|
scale: -0.1
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 38820 # Meter Power T
|
|
type: holding
|
|
decode: int32
|
|
scale: -0.1
|
|
energy:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 2 }}
|
|
register:
|
|
address: 39617 # Grid Consumption Total
|
|
type: holding
|
|
decode: uint32
|
|
scale: 0.01
|
|
{{- end }}
|
|
{{- if eq .usage "pv" }}
|
|
power:
|
|
source: calc
|
|
add:
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 39279 # PV1
|
|
type: holding
|
|
decode: int32
|
|
block: # 39279-39290
|
|
register: 39279
|
|
count: 12
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 39281 # PV2
|
|
type: holding
|
|
decode: int32
|
|
block: # 39279-39290
|
|
register: 39279
|
|
count: 12
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 39283 # PV3
|
|
type: holding
|
|
decode: int32
|
|
block: # 39279-39290
|
|
register: 39279
|
|
count: 12
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 39285 # PV4
|
|
type: holding
|
|
decode: int32
|
|
block: # 39279-39290
|
|
register: 39279
|
|
count: 12
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 39287 # PV5
|
|
type: holding
|
|
decode: int32
|
|
block: # 39279-39290
|
|
register: 39279
|
|
count: 12
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 39289 # PV6
|
|
type: holding
|
|
decode: int32
|
|
block: # 39279-39290
|
|
register: 39279
|
|
count: 12
|
|
maxacpower: {{ .maxacpower }}
|
|
{{- end }}
|
|
{{- if eq .usage "battery" }}
|
|
power:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 2 }}
|
|
register:
|
|
address: 39237 # Battery Charge/Discharge
|
|
type: holding
|
|
decode: int32
|
|
soc:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 2 }}
|
|
register:
|
|
address: 37612 # Soc
|
|
type: holding
|
|
decode: int16
|
|
limitsoc:
|
|
source: convert
|
|
convert: float2int
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 46611 # Minimum SoC OnGrid
|
|
type: writesingle
|
|
decode: uint16
|
|
batterymode:
|
|
source: watchdog
|
|
timeout: 30s
|
|
reset: 1 # reset to normal mode
|
|
set:
|
|
source: switch
|
|
switch:
|
|
- case: 1 # normal - disable remote control
|
|
set:
|
|
source: sequence
|
|
set:
|
|
- source: const
|
|
value: 0 # Disabled
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46001 # Remote Control
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: 1 # Self Use
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 49203 # Work Mode
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: {{ .minsoc }}
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46609 # Minimum SoC
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: {{ .maxsoc }}
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46610 # Maximum SoC
|
|
type: writesingle
|
|
encoding: uint16
|
|
- case: 2 # hold - stop battery discharge
|
|
set:
|
|
source: sequence
|
|
set:
|
|
- source: const
|
|
value: 2 # Feed-in First, fallback if the remote control watchdog expires
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 49203 # Work Mode
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: 60 # Remote timeout 60 seconds
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46002 # Remote Timeout Set
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: 1 # Enabled
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46001 # Remote Control
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: 0 # W
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46003 # Remote Active Power, int32 across 46003 (high word) and 46004 (low word)
|
|
type: writemultiple
|
|
encoding: int32
|
|
- case: 3 # charge - force battery charge
|
|
set:
|
|
source: sequence
|
|
set:
|
|
- source: const
|
|
value: 3 # Back-up, fallback if the remote control watchdog expires
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 49203 # Work Mode
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: 60 # Remote timeout 60 seconds
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46002 # Remote Timeout Set
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: 1 # Enabled
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46001 # Remote Control
|
|
type: writesingle
|
|
encoding: uint16
|
|
- source: const
|
|
value: {{ mul .maxchargepower -1 }} # negative power means charging
|
|
set:
|
|
source: modbus
|
|
{{- include "modbus" . | indent 12 }}
|
|
register:
|
|
address: 46003 # Remote Active Power, int32 across 46003 (high word) and 46004 (low word)
|
|
type: writemultiple
|
|
encoding: int32
|
|
default:
|
|
source: error
|
|
error: ErrNotAvailable
|
|
{{- include "battery-params" . }}
|
|
{{- end }}
|