Skip to content

Home Assistant integration code for Fox ESS H1, H1-G2, H3 and KH inverters

Notifications You must be signed in to change notification settings

Ndrinta/HA-FoxESS-Modbus-Tony

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Buy Me A Coffee This website, code and contents are not supported by or endorsed by Fox ESS. Anyone using the information provided here does so of their own volition and risk.

Fox ESS and Home Assistant integration


This site contains code and information for integrating Fox ESS inverters with Home Assistant. It is a refactored and evolved version, derived from https://github.com/StealthChesnut/HA-FoxESS-Modbus.

The changes from the main branch include:

  • Simplified configuration: fewer lines are required in your configuration.yaml with 'modbus', 'sensors', 'templates' and 'utility_meter' integrations split into separate include files
  • Support for single phase inverters (including H1, AC1 AIO and KH series) and three phase inverter (H3 and AC3 series)
  • Parameterization and grouping of sensor scan_interval so they are more uniform and easier to change consistently when required
  • Revised calculation for inverter power in, power out and system losses
  • Added HA templates for calculating inverter efficiency, cell imbalance, grid dependency and grid balance
  • Added RPower and EPS RVolt, EPS RCurrent and EPS RPower sensors for LAN and RS485 connections
  • Added BMS Cycle Count and rename / rescale of BMS Watt-hours Total to BMS kWh Total for consistency when working with energy values
  • Added inverter energy meter total / today register values for PV Energy, Charge Energy, Discharge Energy, Grid Consumption Energy, Feed In Energy, Output Energy and Input Energy. These replace the Riemann sum values for RS485, giving greater accuracy and alignment with Fox cloud data. There is a code variant for these values to be used for the utility meters that feed the energy dashboard.
  • Added unique_id for all entities to allow management in the HA UI and aid migration to other integrations
  • Added HA templates for Battery Specification, Capacity, Cell Imbalance, Temperature Imbalance, Duration and Production, State of Discharge (SoD), State of Health (SoH), Energy, Energy per Cycle and Life Remaining. These are dynamic if BMS data is available.
  • Added template for PV Voltage (sum of PV1 - PV4 voltage) for monitoring max DC input voltage
  • Added entities for inverter model and firmware versions and BMS / battery firmware versions
  • Corrected InvBatCurrent and InvBatPower sensors for LAN and RS-485 connections
  • Corrected Temp to BatCurrent sensor for RS485
  • Corrected unique_id for BMS Cell mV low
  • Added automation to upload generation and consumption data to pvoutput.org

Access to your inverter data can be achieved by connecting the inverter's RS485 Modbus to an RS485 to USB adapter or RS485 to WiFi/LAN adapter. Note: this requires basic electronics competencies to connect 2 wires to the inverter's CT / COM connector.


** Please note: April 2023, @nathanmarlor has mirrored and extended functionality in this alternative https://github.com/nathanmarlor/foxess_modbus - you may wish to look at that as well!


RS485 connection to H1, AC, AIO, H1-G2, AC-G2 and KH series inverters (recommended)

  • Hardware configuration instructions can be found on Nathan's wiki
  • Connect RS485A to pin 4 and RS485B to pin 3 of the Meter/CT/RS485 connector using a suitable length of UTP cable (e.g. network cable)
  • Go to the inverter front panel Settings, Communication, RS485, Device ID and check the slave ID for the inverter is set to 247
  • Use 'modbusXX_RS485.yaml' when using an RS485 to USB adapter
  • Use 'modbusXX_RS485_LAN.yaml' when using an RS485 to Wifi/LAN adapter
  • where XX is replaced by: 'H1' for H1, AC1 or AIO series, 'H1G2' for H1-G2 or AC-G2 series or 'KH' for K series

RS485 connection to H3 or AC3 series inverter

  • Hardware configuration instructions for connection to RS485 can be found on the wiki
  • Connect RS485A to pin 1 and RS485B to pin 2 of the Meter/RS485 connector using a suitable length of UTP cable (e.g. network cable)
  • Go to inverter front panel, Settings, Communication, RS485, Device ID and set the slave ID for the inverter to 247 (the default is 000)
  • Use 'modbusH3_RS485.yaml' when using an RS485 to USB adapter
  • Use 'modbusH3_RS485_LAN.yaml' when using an RS485 to Wifi/LAN adapter

Home Assistant Installation Steps

Change Log

v1.5.3:
Added 'modbusH1G1_RS485.yaml' for testing. This uses holding registers, where available, instead of input registers.

v1.5.2:
Add Language Code / Language Settings at 40007 for various models. TBC, may only update on inverter start-up?

v1.5.0:
Fix input_type for EPS RCurrent, RPower and RFrequency.

v1.4.9:
Update H3 registers by cross-reference to other inverter models. Addresses to be confirmed are marked tbc in 'modbusH3_RS485_LAN.yaml'

v1.4.8:
Fix errors in 'template.yaml' and 'templateH1G2.yaml' affecting Battery Warranty Remaining and Battery Life Remaining.
Improve handling of unknown values in 'template.yaml' and 'templateH1G2.yaml'.
Setting for the number of days to keep moved to 'secrets.yaml'. See note for info on configuring this.

v1.4.6:
Updates to 'modbusH1G2_RS485.yaml', 'templateH1G2.yaml' and 'viewsH1G2_sensor.yaml'.

v1.4.5:
Added 'templateH1G2.yaml' to support H1-G2 and AC-G2 inverters.

v1.4.4:
Moved preset values to input helpers to avoid overwriting values during HACS update. This requires some additional settings to be added to configuration.yaml. See 'template_configuration.yaml'.
See note for info on configuring this.

v1.4.3:
Moved database settings to recorder_ha.yaml and recorder_maria.yaml so the database being used for history does not change during HACS update.
See note if you get a configuration error after updating.

v1.4.2:
Added 'modbusH1G2_RS485.yaml' and 'modbusH1G2_RS485_LAN.yaml' to support H1-G2 and AC-G2 series inverters.

About

Home Assistant integration code for Fox ESS H1, H1-G2, H3 and KH inverters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published