A simple Python client for interacting with the BL915/BL917 solar charge controller via its websocket API.
In order to use the client, you will need to:
- Register an account on the ZhiJinPower app:
- Pair your device with the app. Good luck, that app is terrible.
- Write down the MAC address of the device:
These models are sold under multiple names (including Y&H, BL915, BL917) on marketplaces. They all share the same electronics.
Only the wifi versions are compatible:
If your controller looks different but uses the ZhiJinPower app, then it might be compatible.
The API works via some server in China. It is somewhat finicky and unreliable. Somme commands sometimes won't be acknowledged, and might need to be run multiple times to be registered.
The API has no authentication whatsoever: only the device MAC address needs to be passed to run commands (Yes, it is... bad).
Supported commands that I found:
- get all info (voltage, temperature, settings, etc)
- set charge mode and voltage values
- toggle 12v output
- Get/set charge mode
- Get load state
- Get all device information
- Python 3.7+
- websockets library
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
⚠️ WarningUse these commands carefully: they will be executed immediately by the controller.
# Get the current charge mode
python client.py --mac XX:XX:XX:XX:XX --command get-charge-mode
# Set the charge mode to manual (0)
python client.py --mac XX:XX:XX:XX:XX --command set-charge-mode --value 0
# Get the load state
python client.py --mac XX:XX:XX:XX:XX --command get-load-state
# Get all available information
python client.py --mac XX:XX:XX:XX:XX --command get-infoExpected output:
2025-08-09 20:07:13,436 - SolarControllerClient - INFO - Connection attempt 1 of 3...
2025-08-09 20:07:19,096 - SolarControllerClient - ERROR - Connection timed out after 5 seconds
2025-08-09 20:07:19,419 - SolarControllerClient - INFO - Retrying in 2 seconds...
2025-08-09 20:07:21,421 - SolarControllerClient - INFO - Connection attempt 2 of 3...
2025-08-09 20:07:22,878 - SolarControllerClient - INFO - Connected successfully. Client ID: 7f00000111f80005c584
2025-08-09 20:07:24,194 - SolarControllerClient - INFO - Current charge mode: straight out (3)
2025-08-09 20:07:24,538 - SolarControllerClient - INFO - Disconnected from server


