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)
AA55enc 2 Encrypted, 48 bytes XOR (Vevor)
AA66 3 Unencrypted, 20 bytes (BYD variant)
AA66enc 4 Encrypted, 48 bytes XOR (Vevor)
ABBA 5 HeaterCC protocol, 21+ bytes, own command format
CBFF 6 Sunster v2.1, 47 bytes, optional double-XOR encryption
Hcalory 7 MVP1/MVP2 protocol, variable length with checksum

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
  • ProtocolHcalory - Hcalory MVP1/MVP2 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.3.3.tar.gz (34.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.3.3-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diesel_heater_ble-0.3.3.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for diesel_heater_ble-0.3.3.tar.gz
Algorithm Hash digest
SHA256 2a2f45db3de516002e145af5cdf36f2489eaa693b92da88159693fead70a2534
MD5 37fcbe372b75a8b9db8f8afd66c35da0
BLAKE2b-256 27dec0e74efd8dd481255d9e1515ceded442a8192af539d049c3264ccd22153c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for diesel_heater_ble-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e57843ee2c9bdc2402410b1278361d228fa813c0be27ad6b8af7f492f4acff5
MD5 c453e6778bec3bc9e192d07240bc9eaa
BLAKE2b-256 6fb00f84bd70f3efd92452709e365423839e424fc9cbbd22312c4b967d2b4b94

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