FoxESS FoxESS Avocado (battery) Modbus TCP template

FoxESS Avocado (battery)

The FoxESS Avocado is a compact all-in-one battery storage system combining a LiFePO4 battery pack, a bidirectional inverter, and four MPPT inputs, designed for balcony PV installations and small residential systems. This Modbus TCP template reads battery power flow, cumulative energy throughput, and state of charge, and exposes a set of remote-control write registers that govern operating mode, timeout, and active power command. Connecting the FoxESS Avocado to the ModbusCloud Gateway gives installers continuous visibility of charge and discharge cycles alongside the ability to trigger remote power setpoints from a single portal.

Protocol
Modbus TCP
Connection
Ethernet, Modbus TCP
Registers
8, read and write
Brand
FoxESS
Compatible models
Avocado · MQ2200 · ONE · Avocado Pro
Last updated

Registers (8)

3 read, 5 write

NameUnitAccessAddress (Hidden until you enter your email)Function (hidden)Type (hidden)
powerWRead
energyWhRead
soc%Read
batterymode_aWrite
batterymode_bWrite
batterymode_cWrite
batterymode_esWrite
batterymode_fWWrite

Loading registers…

Send your device list

If a device is not in the library yet, we build the template for free as soon as we have the register data.

Number of installations (optional)

Use cases

  • Monitor real-time battery power flow to verify the Avocado is charging during solar production peaks.
  • Track state of charge over time to detect capacity degradation across seasonal cycles.
  • Alert on state of charge falling below a threshold to prevent deep discharge during extended cloudy periods.
  • Report cumulative energy throughput to calculate battery round-trip efficiency over a quarter.
  • Write a remote power command via batterymode_f to shift discharge to high-tariff evening hours automatically.

Installation

  1. Enable Modbus TCP on the Avocado by connecting it to your local network via LAN or WLAN and confirming the device is reachable on port 502; verify connectivity with a telnet or TCP probe to port 502 before proceeding.

  2. Connect the ModbusCloud Gateway to the same LAN segment as the Avocado, ensuring no firewall or VLAN blocks port 502 between the Gateway and the storage unit.

  3. In the ModbusCloud portal, add a new device, import the FoxESS Avocado (battery) template, and assign Unit ID 1 (the factory default for this device).

  4. Spot-check the soc register at address 39424 in the live register view to confirm a plausible 0 to 100 value is being returned before enabling any write registers.

Things to watch for

Why do the power or energy registers return zero or garbage?

The power register at address 39237 is typed as int32 and spans two consecutive 16-bit holding registers. If your polling tool requests only one register or decodes it as int16, the result will be zero or nonsense. Ensure the template uses a two-register int32 read for that address. Firmware version also affects register availability, so update to the latest Master and Manager firmware before troubleshooting further.

The Gateway connects on port 502 but no values appear. What now?

The Avocado obtains its IP address via DHCP, so the address may have changed after a router restart. Confirm the current IP in your router's DHCP lease table, update the device address in the ModbusCloud portal, and retry. If the TCP connection is refused, check that no other Modbus master (such as a home-automation controller) is holding an exclusive connection to port 502, as the device may reject additional clients.

Register 46001 was written but the battery mode did not change.

Register 46001 is a bitfield where bit 0 must be set to 1 to enable remote control, bit 1 sets the power direction, and bit 2 selects the controlled target. Writing only a partial value without asserting the enable bit has no effect. Also confirm that register 46002 (timeout) is set to a nonzero value, otherwise the command expires immediately.

Is it safe to write power setpoints via batterymode_f during normal operation?

Use write registers with caution. Sending an active power command via batterymode_f (address 46003, int32, watts) overrides the device's built-in charge and discharge logic. Commands outside the battery's rated power range may trigger protection responses or thermal limits. Always test with small incremental values, ensure the timeout in batterymode_e is set appropriately so the device reverts automatically, and review your warranty terms before enabling continuous remote control.

Want to see how it works?

Electrician working in an open distribution board