Skip to main content

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 class
  • ProtocolAA55 - AA55 unencrypted
  • ProtocolAA55Encrypted - AA55 with XOR encryption
  • ProtocolAA66 - AA66 unencrypted (BYD variant)
  • ProtocolAA66Encrypted - AA66 with XOR encryption
  • ProtocolABBA - ABBA/HeaterCC protocol
  • ProtocolCBFF - CBFF/Sunster v2.1 protocol

Methods

  • parse(data: bytearray) -> dict | None - Parse BLE notification data
  • build_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diesel_heater_ble-0.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diesel_heater_ble-0.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

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

Hashes for diesel_heater_ble-0.1.0.tar.gz
Algorithm Hash digest
SHA256 68a495b08f1489bb82bfbb30e3500775fa0c8fc5dff16b51967c34b2cd254d12
MD5 385c6f9864ea4f8dcf6c81e83d8975d1
BLAKE2b-256 1f06af94d17e2f37581ff7ac1d77f9115114a980e6c74574c4409a3ec30b542a

See more details on using hashes here.

Provenance

The following attestation bundles were made for diesel_heater_ble-0.1.0.tar.gz:

Publisher: ci.yml on Spettacolo83/diesel-heater-ble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diesel_heater_ble-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for diesel_heater_ble-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 126190e620f13daa1cccc6b5c2a87b3c5f85d648dd83e7ff721cb1b8bd1960b2
MD5 081a8b4ec3194e9c755e37de9f81fc88
BLAKE2b-256 a04df880a42094d32fe11f6eff6549bd388714689a7af1d6df471d03ae0303ad

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page