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.2.3.tar.gz (31.0 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.2.3-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file diesel_heater_ble-0.2.3.tar.gz.

File metadata

  • Download URL: diesel_heater_ble-0.2.3.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.11

File hashes

Hashes for diesel_heater_ble-0.2.3.tar.gz
Algorithm Hash digest
SHA256 d9b671c3bb8472e1f106b3a11835e59ff10a5a2886e148db0f12008465d5bf44
MD5 58aa813ab4bcec11e63d80b913aa70ac
BLAKE2b-256 09a0a68dad9eb76d11906592e06d6cee1713e644442efd80f5512dd8f45851f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for diesel_heater_ble-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e93a25ea7951c43f4392be3bc8a20b3ab7c3a0bd17b71034180f533c90faf5e
MD5 43a08937ce7c2880077edb439d6912b0
BLAKE2b-256 8b735a7a04b4e14a357ff54e0a85bc25f06ade4dee5ce34fd9780c4f9432c3ba

See more details on using hashes here.

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