BLE protocol library for diesel heaters (Vevor, Hcalory, Sunster, HeaterCC)
Project description
diesel-heater-ble
Pure Python library for parsing and controlling BLE diesel heaters.
Supports Vevor, Hcalory, Sunster, and HeaterCC diesel heater protocols over Bluetooth Low Energy (BLE). No dependency on Home Assistant.
Supported Protocols
| Protocol | Mode | Description |
|---|---|---|
| AA55 | 1 | Unencrypted, 18-20 bytes (Vevor/Hcalory) |
| AA55enc | 2 | Encrypted, 48 bytes XOR (Vevor/Hcalory) |
| AA66 | 3 | Unencrypted, 20 bytes (BYD variant) |
| AA66enc | 4 | Encrypted, 48 bytes XOR (Vevor/Hcalory) |
| ABBA | 5 | HeaterCC protocol, 21+ bytes, own command format |
| CBFF | 6 | Sunster v2.1, 47 bytes, optional double-XOR encryption |
Installation
pip install diesel-heater-ble
Usage
from diesel_heater_ble import ProtocolAA55, ProtocolCBFF
# Parse a BLE notification
protocol = ProtocolAA55()
data = bytearray(...) # raw BLE notification bytes
result = protocol.parse(data)
print(result["running_state"]) # 0=off, 1=on
print(result["cab_temperature"]) # interior temperature
print(result["supply_voltage"]) # battery voltage
# Build a command
cmd = protocol.build_command(command=3, argument=0, passkey=1234)
# Send cmd to BLE characteristic...
API
Protocol Classes
All protocol classes implement the HeaterProtocol interface:
HeaterProtocol- Abstract base classProtocolAA55- AA55 unencryptedProtocolAA55Encrypted- AA55 with XOR encryptionProtocolAA66- AA66 unencrypted (BYD variant)ProtocolAA66Encrypted- AA66 with XOR encryptionProtocolABBA- ABBA/HeaterCC protocolProtocolCBFF- CBFF/Sunster v2.1 protocol
Methods
parse(data: bytearray) -> dict | None- Parse BLE notification databuild_command(command: int, argument: int, passkey: int) -> bytearray- Build command packet
Helper Functions
_decrypt_data(data)/_encrypt_data(data)- XOR encryption/decryption_u8_to_number(value)- Convert unsigned 8-bit value_unsign_to_sign(value)- Convert unsigned to signed value
License
MIT
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 diesel_heater_ble-0.1.0.tar.gz.
File metadata
- Download URL: diesel_heater_ble-0.1.0.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68a495b08f1489bb82bfbb30e3500775fa0c8fc5dff16b51967c34b2cd254d12
|
|
| MD5 |
385c6f9864ea4f8dcf6c81e83d8975d1
|
|
| BLAKE2b-256 |
1f06af94d17e2f37581ff7ac1d77f9115114a980e6c74574c4409a3ec30b542a
|
Provenance
The following attestation bundles were made for diesel_heater_ble-0.1.0.tar.gz:
Publisher:
ci.yml on Spettacolo83/diesel-heater-ble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diesel_heater_ble-0.1.0.tar.gz -
Subject digest:
68a495b08f1489bb82bfbb30e3500775fa0c8fc5dff16b51967c34b2cd254d12 - Sigstore transparency entry: 907859725
- Sigstore integration time:
-
Permalink:
Spettacolo83/diesel-heater-ble@4496fb9aeca1ece68974eb2fbddd561aa1b1f7e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Spettacolo83
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4496fb9aeca1ece68974eb2fbddd561aa1b1f7e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file diesel_heater_ble-0.1.0-py3-none-any.whl.
File metadata
- Download URL: diesel_heater_ble-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
126190e620f13daa1cccc6b5c2a87b3c5f85d648dd83e7ff721cb1b8bd1960b2
|
|
| MD5 |
081a8b4ec3194e9c755e37de9f81fc88
|
|
| BLAKE2b-256 |
a04df880a42094d32fe11f6eff6549bd388714689a7af1d6df471d03ae0303ad
|
Provenance
The following attestation bundles were made for diesel_heater_ble-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on Spettacolo83/diesel-heater-ble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diesel_heater_ble-0.1.0-py3-none-any.whl -
Subject digest:
126190e620f13daa1cccc6b5c2a87b3c5f85d648dd83e7ff721cb1b8bd1960b2 - Sigstore transparency entry: 907859730
- Sigstore integration time:
-
Permalink:
Spettacolo83/diesel-heater-ble@4496fb9aeca1ece68974eb2fbddd561aa1b1f7e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Spettacolo83
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4496fb9aeca1ece68974eb2fbddd561aa1b1f7e1 -
Trigger Event:
push
-
Statement type: