A lightweight, local, Python integration to bridge the Anker SOLIX Solarbank 2 / Max AC Pro series directly into Domoticz using local Modbus TCP. No cloud login required, completely local, and fully compatible with the official Domoticz Energy Dashboard.
This script runs as a continuous background daemon (systemd service) and polls your solar battery every 10 seconds for real-time visualization.
- 🔋 Real-time SoC & SOH (State of Charge and State of Health percentages).
- ☀️ Solar PV Generation monitoring.
- 🏡 Net AC Output Tracking beautifully mapped to a single bi-directional sensor (positive for charging, negative for discharging into your home).
- ⚡ Grid AC Voltage monitoring (uncovers 230V/240V mains grid fluctuations).
- 🌡️ Internal Hardware Temperature logging.
- 📊 Calculated Cumulative Counters for total lifetime charge and discharge.
- Enable Modbus TCP: Open your official Anker SOLIX app, navigate to your Solarbank settings, find the Modbus TCP section, and turn it on. Note the IP address assigned to the battery.
- Python 3 Environment: Ensure you have Python 3 and
pipinstalled on your Domoticz server (Mini-PC/Raspberry Pi).
Go to Setup > Hardware in Domoticz, add a Dummy (Does nothing) hardware device named Anker SOLIX, and create the following virtual sensors using the Create Virtual Sensors button:
| Sensor Name | Sensor Type | Description |
|---|---|---|
Anker Battery SoC |
Percentage | Tracks battery level (0-100%) |
Anker PV Power |
Usage (Electric) | Tracks real-time Solar input in Watts |
Anker Battery Power |
Electric (Instant+Counter) | Crucial: Handles bi-directional energy flow into the Energy Dashboard |
Anker Grid Voltage |
Voltage | Monitors grid wisselspanning (~230V) |
Anker Battery SOH |
Percentage | Tracks battery cell health degradation over time |
Anker System Temp |
Temperature | Internal device temperature |
Anker Total Charged |
Incremental Counter | Crucial: Tracks cumulative charging in Wh without chart errors |
Anker Total Discharged |
Incremental Counter | Crucial: Tracks cumulative discharging in Wh without chart errors |
Note all the IDX numbers of these new sensors from the Setup > Devices list.
-
Clone this repository into your preferred folder and navigate into it:
git clone https://github.com cd Anker_Solix_AC_Pro-Domoticz -
Create a clean isolated virtual environment and install dependencies:
python3 -m venv Anker ./Anker/bin/pip install pymodbus requests
-
Configure your specific parameters. Open
config.pyand fill in your battery IP address and your Domoticz IDX numbers:nano config.py
To make sure Linux continuously runs this script in the background and restarts it automatically after a system reboot or power failure, set it up as a systemd service:
-
Create the service definition file:
sudo nano /etc/systemd/system/ankersolix.service
-
Paste the following configuration (verify your paths if you didn't install it in
/anker_script):[Unit] Description=Anker Solix Modbus to Domoticz Service After=network.target [Service] User=root Group=root WorkingDirectory=/anker_script ExecStart=/anker_script/Anker/bin/python3 -u /anker_script/anker_domoticz.py Restart=always RestartSec=5 [Install] WantedBy=multi-user.target
-
Reload systemd, enable the service to auto-start on boot, and start it right now:
sudo systemctl daemon-reload sudo systemctl enable ankersolix.service sudo systemctl start ankersolix.service -
Check if your logs are successfully streaming live without buffering:
journalctl -u ankersolix.service -f -n 10
- Open Domoticz, go to Setup > Settings > Energy Dashboard Setup.
- Assign
Anker Battery Powerto the Battery field. - Assign
Anker Battery SoCto the Battery SOC field. - Assign
Anker Grid Voltageto the Battery Voltage field. - Set
Battery Energy InandBattery Energy Outto Disabled (our script already feeds all unified calculations directly through the main Battery sensor). - Click Save. Your battery visual tracking is now fully active!
This project is open-source and available under the MIT License.