Skip to main content

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

Metadata

Release files for diesel-heater-ble 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diesel-heater-ble 0.3.6
File Size Uploaded
diesel_heater_ble-0.3.6.tar.gz 41.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for diesel-heater-ble 0.3.6
File Interpreter ABI Platform
diesel_heater_ble-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size: 68.4 kB

Release files / diesel_heater_ble-0.3.6.tar.gz

Download URL diesel_heater_ble-0.3.6.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f763a2cd7f338bf859682faf3d04c77cf112551373d161df9cda83d66e73357f
BLAKE2b-256 checksum
How to use checksums
8cbbf757d9071df47db714241d021145417dbdbb70684c7129d6e332d4bf0323
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

Release files / diesel_heater_ble-0.3.6-py3-none-any.whl

Download URL diesel_heater_ble-0.3.6-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
901358877527a96cbaf4584d4f7d2f584e7a0fc9c8eb016552cc2b78a8499ecd
BLAKE2b-256 checksum
How to use checksums
ebc4f94ae7f2a34dfce7823cf9b25f26b6f9f38b03ef9ea508fa607ffc2dc9fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

Release history Release notifications | RSS feed

0.3.8

2 release files

0.3.7

2 release files

This release

0.3.6 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page