Metadata-Version: 2.4
Name: bluetti-bt-lib
Version: 0.0.11
Summary: Bluetti BT
Home-page: https://github.com/Patrick762/bluetti-bt-lib
Author: Patrick762
Author-email: <pip-bluetti-bt-lib@hosting-rt.de>
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: async_timeout
Requires-Dist: asyncio
Requires-Dist: bleak
Requires-Dist: bleak_retry_connector
Requires-Dist: crcmod
Requires-Dist: cryptography
Requires-Dist: logging
Requires-Dist: pyasn1
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary


# bluetti-bt-lib
Inofficial Library for basic communication to bluetti powerstations.
Core functions based on https://github.com/warhammerkid/bluetti_mqtt

## 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.

## Installation

```bash
pip install bluetti-bt-lib
```

## Commands for testing

### Scan for supported devices

```bash
usage: bluetti-scan [-h]

Detect bluetti devices by bluetooth name

options:
  -h, --help  show this help message and exit
```

### Detect device type by mac address

```bash
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:

```bash
bluetti-detect 00:00:00:00:00:00
```

### Read device data for supported devices

```bash
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:

```bash
bluetti-read -m 00:00:00:00:00:00 -t AC70
```

### Write to supported device

```bash
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:

```bash
bluetti-write -m 00:00:00:00:00:00 -t EB3A --on on ctrl_ac
```

## 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        |✅                   |✅            |✅            |✅             |✅             |
|AC60       |@mzpwr          |✅                   |✅            |✅            |✅             |✅             |
|AC60P      |@mzpwr          |✅                   |✅            |✅            |✅             |✅             |
|AC70P      |@matthewpucc    |✅                   |❌            |❌            |❌             |❌             |
|AC180P     |@Patrick762     |✅                   |✅            |✅            |✅             |✅             |
|AC200L     |bluetti-mqtt    |✅                   |✅            |✅            |✅             |✅             |
|AC200M     |bluetti-mqtt    |✅                   |✅            |✅            |✅             |✅             |
|AC200PL    |@0x4E4448       |✅                   |✅            |✅            |✅             |✅             |
|AC300      |bluetti-mqtt    |✅                   |✅            |✅            |✅             |✅             |
|AC500      |bluetti-mqtt    |✅                   |✅            |✅            |✅             |✅             |
|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
