Integrate Solix in Homeassistant
Integrate Solix in Homeassistant
This describes how I added a system with solar panels and smart meter into Homeassistant.
Goals
- achieve an accurate overview of the energy generated, stored and consumed
- use existing hardware as much as possible
Possible Result
Should look like this:

Possibilities
These are possibilities in my environment without buying new stuff.
- Use Tom Luther’s Integration1
- Use Smart Plugs
Drawbacks
ha-anker-solixuses anker cloud api, there is no local endpoint that can be used- needs a second anker account that gets invited to your
familyso that you do not get locked out of your main anker account
- needs a second anker account that gets invited to your
- smart plugs can only cover a subset, thus leading to incomplete measurements.
Decision
Use Tom Luther’s Integration
Installation
Requirements
- Homeassistant
- HACS
- all devices registered in the anker app using your
mainanker account - Second Anker Account (to be created)
Prepare Account
- goto Anker Solix Homepage2
- hover over the person icon in the upper right section and hit the
Join NowLink - create an anker account with an email not already used for another anker account (that is in use with an app)
- finish the creating with the link(s) you get via e-mail
- invite the new account to your
familyusing the account you manage your anker system with - accept the invitation to the
familyusing the new account
- hover over the person icon in the upper right section and hit the
Downloading Integration and Restart HA
The official Documentation is great, I’m just repeating the minimum steps to get it up and running.
You should read through it though to understand the implications and requirements i.e. a second anker account to use so that you do not lock yourself out of the app while creating a token to use for the Homeassistant integration.
In Homeassistant:
- goto HACS
- download
Anker Solix - wait for Homeassistant to install the integration and finish restarting
- you should now find the integration using the
settings->devices & servicessection- looks like this:

- hitting the
Devicesbutton on the integration you should see your:- account abbreviated with
* - Smart Meter if you have one
- Solarbank
<your name of the system as shown in the anker app
- account abbreviated with
If you are familiar with Homeassistant you can now build your dashboards using the existing sensors.
Integration Ideas
The anker sensors are not providing the correct units for the homeassistant energydashboard, so we need to create some integral sensors and if you also want to integrate the battery power flow we need some logic that splits positive and negative flows into different sensors.
In my case this looks like this:

For the integral sensors we are using the left riemann sum as discussed on github3.
For more comprehensive information about riemann sums, look at (german) heise+ articel about integrating smart plugs4
Sensor Overview
Integral Sensors
- battery-input-sum
- battery-output-sum
- solar-grid-import-sum
- solar-grid-export-sum
- solar-pv1-sum
- solar-pv2-sum
- solar-pv3-sum
- solar-pv4-sum
Template Sensors
- battery-input
- battery-output
Create Template Sensors

Important: You have to replace the part with the name of your own system in both lines.
# replace <system> with correct name so that this:
{% if states('sensor.system_<system>_sb_battery_power')|float <= 0 %}
{{ states('sensor.system_<system>_sb_battery_power') |float |abs }}
{% else %}
0.0
{% endif %}
# becomes this:
{% if states('sensor.system_myname_sb_battery_power')|float <= 0 %}
{{ states('sensor.system_myname_sb_battery_power') |float |abs }}
{% else %}
0.0
{% endif %}
Battery-input
State template*
{% if states('sensor.system_<system>_sb_battery_power')|float >= 0 %}
{{ states('sensor.system_<system>_sb_battery_power') |float |abs}}
{% else %}
0.0
{% endif %}
Battery-output
State template*
{% if states('sensor.system_<system>_sb_battery_power')|float <= 0 %}
{{ states('sensor.system_<system>_sb_battery_power') |float |abs }}
{% else %}
0.0
{% endif %}
Create Integral Sensors

If you have created all the integral sensors from the list above, you can continue to energy dashboard and add all the sensors there
Configure Energy Dashboard

