FoxESS Avocado: fix Modbus errors and add grid phase monitoring (#26408)

This commit is contained in:
Copilot 2026-01-05 17:00:13 +00:00 • committed by GitHub
parent 8ef3cce10f
commit 668125c51b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,9 +3,15 @@ products:
- brand: FoxESS
description:
generic: Avocado
- brand: FoxESS
description:
generic: MQ2200
- brand: Solakon
description:
generic: ONE
- brand: Tepto
description:
generic: Avocado Pro
capabilities: ["battery-control"]
params:
- name: usage
@ -32,18 +38,62 @@ render: |
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39168 # [Meter collection] Active power
type: input
address: 39168 # Active power
type: holding
decode: int32
scale: -1 #
scale: -1 # > 0: Feed power to the grid, < 0: Take power from the grid
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39617 # Total power taken (grid import)
type: input
address: 39625 # Enter total power
type: holding
decode: uint32
scale: 0.01 # Convert to kWh (raw / 100 = kWh)
scale: 0.01
voltages:
- source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39123
type: holding
decode: int16
scale: 0.1
- source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39124
type: holding
decode: int16
scale: 0.1
- source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39125
type: holding
decode: int16
scale: 0.1
currents:
- source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39126
type: holding
decode: int32
scale: 0.001
- source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39128
type: holding
decode: int32
scale: 0.001
- source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39130
type: holding
decode: int32
scale: 0.001
{{- end }}
{{- if eq .usage "pv" }}
power:
@ -51,16 +101,16 @@ render: |
{{- include "modbus" . | indent 2 }}
register:
address: 39118 # Total PV Power
type: input
type: holding
decode: int32
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39149 # Cumulative Generation
type: input
address: 39149 # Cumulative PV Generation
type: holding
decode: uint32
scale: 0.01 # Convert to kWh (raw / 100 = kWh)
scale: 0.01
maxacpower: {{ .maxacpower }}
{{- end }}
{{- if eq .usage "battery" }}
@ -69,26 +119,24 @@ render: |
{{- include "modbus" . | indent 2 }}
register:
address: 39237 # Battery Combined Power
type: input
type: holding
decode: int32
scale: -1 #
scale: -1
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39609 # Total discharge power
type: holding
decode: uint32
scale: 0.01
soc:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 39424 # Battery SOC (%)
type: input
address: 39424 # Battery SOC %
type: holding
decode: int16
limitsoc:
source: convert
convert: float2int
set:
source: modbus
{{- include "modbus" . | indent 4 }}
register:
address: 46609 # Minimum SOC
type: writesingle
encoding: uint16
batterymode:
source: watchdog
timeout: 30s
@ -163,7 +211,7 @@ render: |
source: sequence
set:
- source: const
value: 15 # INV Charge (AC First)
value: 7 # B01 1 1 //target:bat charging
set:
source: modbus
{{- include "modbus" . | indent 12 }}