CLI tool to poll data for an Anker SOLIX Solarbank E1600 Balcony Power Storage and publish it to an MQTT broker.
This is a thin bridge between the API used by the Anker App and MQTT. Although the project is currently read-only, adding support for updates should be relatively straightforward. Feel free to open a PR.
Before you begin, ensure you have met the following requirements:
git clone https://github.com/tomquist/solix2mqtt.git
.cd solix2mqtt
.npm install
to install all the project dependencies.With these steps, you will have set up the necessary environment to run and use solix2mqtt
.
npm install && npm run build
S2M_USER=*** \
S2M_PASSWORD=*** \
S2M_COUNTRY=DE \
S2M_MQTT_URI=mqtt://localhost:1883 \
npm run start
docker run -d \
-e S2M_USER=*** \
-e S2M_PASSWORD=*** \
-e S2M_COUNTRY=DE \
-e S2M_MQTT_URI=mqtt://localhost:1883 \
tomquist/solix2mqtt:latest
The app can be configured using the following environment variables:
S2M_USER
(required): Email address of your Anker accountS2M_PASSWORD
(required): Password of your Anker accountS2M_COUNTRY
(required): A two-letter country code (e.g. DE
)S2M_LOGIN_STORE
(optional): Path to a file where the auth tokens will be cached. (default auth.data
)S2M_POLL_INTERVAL
(optional): The polling interval in seconds (default 60
) S2M_MQTT_URI
(required): The MQTT broker URL, e.g. mqtt://host:1883
S2M_MQTT_USERNAME
(optional): Optional username for MQTT authenticationS2M_MQTT_PASSWORD
(optional): Optional password for MQTT authenticationS2M_MQTT_CLIENT_ID
(optional): MQTT client identifier (default: `solix2mqtt``)S2M_MQTT_TOPIC
(required): Topic prefix where data should be published (default: `solix``)S2M_VERBOSE
(optional): Set to true for more logs (default: `false``)The App utilizes an advanced version of the auth mechanism known from Eufy. The Anker App employs a two-step authentication scheme: first, keys are exchanged, and second, the full login payload is encrypted. However, it turns out the original Eufy mechanism still works, so we're using that in this project (credits to eufy-security-client for inspiration). This might break at some point!
For a "READ-ONLY" access to the data, an account with which the "System" has been shared can be used. By this the main account can still be used in the app to control everything and the shared account can be used for the API access.
Note: Anker currently permits only one simultaneous login at a time. When you log in from another device, all previously generated auth tokens become invalidated.
This project is the result of some work I did to integrate my Solix into my home automation. I no longer own an Anker Solix Solarbank due to disappointment with the product, so this project will not receive any updates. However, I'm happy to accept pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.