macxq / foxess-ha

Home Assistant & FoxESS integration. Monitor you photovoltaic installation directly from HA ☀️ ⚡️
120 stars 37 forks source link
energy-monitor foxess hacktoberfest hacs home-assistant home-automation homeassistant photovoltaics pv smarthome

FoxESS and Home Assistant integration 🏡 ☀



⚙️ Installation & ♻️ Update

Use hacs.io to manage the installation and update process. Right now this integration is part of HACS by default - no more neeed to add it by custom repositories 🥳

⌨️ Manual installation

Create the folder called foxess in /homeassistant/custom_components

Copy the content of this integrations custom_components/foxess folder into your HA /homeassistant/custom_components/foxess folder

💾 Configuration

Edit your home-assistant /configuration.yaml and add:

sensor:
  - platform: foxess
    deviceID: enter_your_inverter_id
    deviceSN: enter_your_inverter_serial_number
    apiKey: enter_your_personal_api_key

Auxiliary notes:

📊 Provided entities

HA Entity Measurement
Inverter string on-line/off-line/in-alarm
Generation Power kW
Grid Consumption Power kW
FeedIn Power kW
Bat Discharge Power kW
Bat Charge Power kW
Solar Power kW
Load Power kW
Meter2 Power kW
PV1 Current A
PV1 Power kW
PV1 Volt V
PV2 Current A
PV2 Power kW
PV2 Volt V
PV3 Current A
PV3 Power kW
PV3 Volt V
PV4 Current A
PV4 Power kW
PV4 Volt V
PV Power kW
R Current A
R Freq Hz
R Power kW
R Volt V
S Current A
S Freq Hz
S Power kW
S Volt V
T Current A
T Freq Hz
T Power kW
T Volt V
Reactive Power kVar
Energy Generated kWh
Energy Generated Month kWh
Energy Throughput kWh
Grid Consumption kWh
FeedIn kWh
Solar kWh
Load kWh
Bat Charge kWh
Bat Discharge kWh
Bat SoC % (single battery systems)
Bat SoC1 % (dual battery systems)
Bat SoC2 % (dual battery systems)
Inverter Bat Power kW (negative=charging, positive=discharging)
Inverter Bat Power2 kW (dual battery systems
Bat Temperature °C
Bat Temperature2 °C (dual battery systems)
Ambient Temp °C
Boost Temp °C
Inv Temp °C
Residual Energy kWh
minSoC %
minSoC on Grid %
Power Factor %
API Response Time mS
Running State string 163: on-grid (see Table1)

Table1 Possible Running States Running State |---------| 160: self-test 161: waiting 162: checking 163: on-grid 164: off-grid 165: fault 166: permanent-fault 167: standby 168: upgrading 169: fct 170: illegal

💡 If you want to understand energy generation per string check out this wiki article

🤔 Troubleshooting

API Error summary:

Increase log level in your /configuration.yaml by adding:

logger:
  default: warning
  logs:
    custom_components.foxess: debug

FoxESS Open API Access and Limits

FoxESS provide an OpenAPI that allows registered users to make request to return datasets.

The OpenAPI access is limited and each user must have a personal_api_key to access it, this personal_api_key can be generated by logging into the FoxESS cloud wesbite - then click on the Profile Icon in the top right hand corner of the screen, select User Profile and then from the menu select API Management, click the button to 'Generate API Key' - this long string of numbers is your personal_api_key and must be used for access to your systems details.

The OpenAPI has a limit of 1,440 API calls per day, after which the OpenAPI will stop responding to requests and generate a "40400" error.

This sounds like a large number of calls, but bear in mind that multiple API calls have to be made on each scan to gain the complete dataset for a system.

The integration paces the number of API calls that are made, with the following frequency -

The integration is using approximately 22 API calls an hour (528 a day and well within the 1,440).

If you have multiple inverters in your account, you will receive 1,440 calls per inverter, so for 2 inverters you will have 2,880 api calls.

📚 Usefull wiki articles