Bluetti BT
Project description
bluetti-bt-lib
Inofficial Library for basic communication to bluetti powerstations. Core functions based on https://github.com/warhammerkid/bluetti_mqtt
The current Roadmap for this project and repositories using this library can be found here
Disclaimer
This library is provided without any warranty or support by Bluetti. I do not take responsibility for any problems it may cause in all cases. Use it at your own risk.
Projects using this library
- Home Assistant Integration
- MQTT Server (planned)
- UPS Server (NUT compatible) (planned)
Supported Powerstations and data
Validated
| Device Name | total_battery_percent | dc_input_power | ac_input_power | dc_output_power | ac_output_power |
|---|---|---|---|---|---|
| AC70 | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC180 | ✅ | ✅ | ✅ | ✅ | ✅ |
| EB3A | ✅ | ✅ | ✅ | ✅ | ✅ |
| EP600 | ✅ | PV | Grid | ❌ | AC Phases |
| Handsfree 1 | ✅ | ✅ | ✅ | ✅ | ✅ |
Added and mostly validated by contributors (some are moved here from the HA Integration https://github.com/Patrick762/hassio-bluetti-bt):
| Device Name | Contributor | total_battery_percent | dc_input_power | ac_input_power | dc_output_power | ac_output_power |
|---|---|---|---|---|---|---|
| AC2A | @ruanmed | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC50B | @goetzc | ✅ | ❌ | ✅ | ✅ | ✅ |
| AC60 | @mzpwr | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC60P | @mzpwr | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC70P | @matthewpucc | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC180P | @Patrick762 | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC200L | bluetti-mqtt | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC200M | bluetti-mqtt | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC200PL | @0x4E4448 | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC300 | bluetti-mqtt | ✅ | ✅ | ✅ | ✅ | ✅ |
| AC500 | bluetti-mqtt | ✅ | ✅ | ✅ | ✅ | ✅ |
| AP300 | @seaburger | ✅ | ✅ | ✅ | ❌ | ✅ |
| EL30V2 | @dgudim | ✅ | ✅ | ✅ | ✅ | ✅ |
| EL100V2 | @seaburger | ✅ | ✅ | ✅ | ✅ | ✅ |
| EP500 | bluetti-mqtt | ✅ | ✅ | ✅ | ✅ | ✅ |
| EP500P | bluetti-mqtt | ✅ | ✅ | ✅ | ✅ | ✅ |
| EP760 | @Apfuntimes | ✅ | PV | Grid | ❌ | AC Phases |
| EP800 | @jhagenk | ✅ | ❌ | ❌ | ❌ | ❌ |
Controls
Currently only "switches" are supported
Validated
| Device Name | ctrl_ac | ctrl_dc |
|---|---|---|
| EB3A | ✅ | ✅ |
Battery pack data
Data for battery packs will no longer be available in this library
Installation
pip install bluetti-bt-lib
Commands for testing
Commands included in this library should only be used for testing.
Scan for supported devices
usage: bluetti-scan [-h]
Detect bluetti devices by bluetooth name
options:
-h, --help show this help message and exit
Example output: ['EB3A', '00:00:00:00:00:00']
Detect device type by mac address
usage: bluetti-detect [-h] mac
Detect bluetti devices
positional arguments:
mac Mac-address of the powerstation
options:
-h, --help show this help message and exit
Example:
bluetti-detect 00:00:00:00:00:00
Example output: Device type is 'EB3A' with iot version 1 and serial 0000000000000. Full name: EB3A0000000000000
Read device data for supported devices
usage: bluetti-read [-h] [-m MAC] [-t TYPE] [-e ENCRYPTION]
Detect bluetti devices
options:
-h, --help show this help message and exit
-m MAC, --mac MAC Mac-address of the powerstation
-t TYPE, --type TYPE Type of the powerstation (AC70 f.ex.)
-e ENCRYPTION, --encryption ENCRYPTION
Add this if encryption is needed
Example:
bluetti-read -m 00:00:00:00:00:00 -t EB3A
Example output:
FieldName.DEVICE_TYPE: EB3A
FieldName.DEVICE_SN: 0000000000000
FieldName.BATTERY_SOC: 92%
FieldName.DC_INPUT_POWER: 0W
FieldName.AC_INPUT_POWER: 0W
FieldName.AC_OUTPUT_POWER: 0W
FieldName.DC_OUTPUT_POWER: 0W
FieldName.CTRL_AC: False
FieldName.CTRL_DC: True
FieldName.CTRL_LED_MODE: LedMode.OFF
FieldName.CTRL_POWER_OFF: False
FieldName.CTRL_ECO: False
FieldName.CTRL_ECO_TIME_MODE: EcoMode.HOURS1
FieldName.CTRL_CHARGING_MODE: ChargingMode.STANDARD
FieldName.CTRL_POWER_LIFTING: False
Write to supported device
INFO: Devices with encryption are currently not supported!
usage: bluetti-write [-h] [-m MAC] [-t TYPE] [--on ON] [--off OFF] [-v VALUE] [-e ENCRYPTION] field
Write to bluetti device
positional arguments:
field Field name (ctrl_dc f.ex.)
options:
-h, --help show this help message and exit
-m MAC, --mac MAC Mac-address of the powerstation
-t TYPE, --type TYPE Type of the powerstation (AC70 f.ex.)
--on ON Value to write
--off OFF Value to write
-v VALUE, --value VALUE
Value to write (integer, see enum for value)
-e ENCRYPTION, --encryption ENCRYPTION
Add this if encryption is needed
Example:
bluetti-write -m 00:00:00:00:00:00 -t EB3A --on on ctrl_ac
Adding fields
To add new fields, you can use the bluetti-detect command to first find out which version of iot protocol is used and if it uses encryption.
After you got this information, you can use the bluetti-readall command to read every registry and save the data to a json file. You should also note all values you see in the app to later compare the data.
Here's how to use the bluetti-readall command:
usage: bluetti-readall [-h] [-m MAC] [-v VERSION] [-e ENCRYPTION]
Detect bluetti devices
options:
-h, --help show this help message and exit
-m MAC, --mac MAC Mac-address of the powerstation
-v VERSION, --version VERSION
IoT protocol version
-e ENCRYPTION, --encryption ENCRYPTION
Add this if encryption is needed
With the separate tool at bluetti-bt-raw-reader you can view those values in a more understandable way.
You can also share the output with me using this form
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bluetti_bt_lib-0.1.4b6.tar.gz.
File metadata
- Download URL: bluetti_bt_lib-0.1.4b6.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26c0ab67603856e31194f065d416fef35531a629e25e6177bda1d1b6f47024bb
|
|
| MD5 |
426fa8cdf0d17b02b1b13bdbe7b16ba9
|
|
| BLAKE2b-256 |
220d6e9dc986943931e7909ccdd946431ff5de6efaa072b552e5b3e63e88ec44
|
File details
Details for the file bluetti_bt_lib-0.1.4b6-py3-none-any.whl.
File metadata
- Download URL: bluetti_bt_lib-0.1.4b6-py3-none-any.whl
- Upload date:
- Size: 42.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13e47b6134f901e9c82aed7015179680564d60e5e874792e95fd4ef13fb6c29c
|
|
| MD5 |
3b232a286211986bfc1328b12875c550
|
|
| BLAKE2b-256 |
0481cff4b0d2b33781cdcf737b4b1e1bcf6049df8da4c1075da06d1b142cc242
|