Skip to main content

py-ctek-battery-sense: CTEK Battery Sense for Python

ctek-battery-sense is an unofficial, fully asynchronous, typed Python library for reading CTEK Battery Sense Bluetooth Low Energy monitors. It supports live voltage and temperature values, the sender's circular voltage history, and the State of Charge calculation and battery-status thresholds similar to the CTEK app.

This is an independent, unofficial project. It is not affiliated with, endorsed by, or supported by CTEK Sweden AB. CTEK and Battery Sense are trademarks of their respective owner.

Supported hardware

The library has been developed and tested with CTEK Battery Sense 40-149 (hardware platform CTEK1088). Other CTEK products are not currently supported.

Installation

python -m pip install ctek-battery-sense

Usage

The monitor advertises as CTEK with service UUID 812ca8ed-a177-4d74-aefa-70098c5416af. A caller discovers the device with Bleak, supplies the 11-character Sender ID printed on the unit, and retains the CTEKHistory instance between reads so subsequent synchronizations are incremental.

from bleak import BleakScanner

from ctek_battery_sense import (
    CTEKBatterySense,
    CTEKHistory,
    SERVICE_UUID,
    battery_status,
    calculate_soc,
)


async def read_monitor(sender_id: str) -> None:
    device = await BleakScanner.find_device_by_filter(
        lambda _device, advertisement: SERVICE_UUID in advertisement.service_uuids
    )
    if device is None:
        raise RuntimeError("CTEK Battery Sense monitor not found")

    history = CTEKHistory()
    result = await CTEKBatterySense(device, sender_id).async_read(history)
    soc = calculate_soc(
        history.voltages or [result.voltage],
        capacity_ah=75,
        sample_minutes=result.sample_interval,
    )

    print(f"Voltage: {result.voltage:.2f} V")
    print(f"Temperature: {result.temperature:.1f} °C")
    print(f"State of charge: {soc:.0f}%")
    print(f"Battery status: {battery_status(soc)}")

The library performs Bluetooth I/O but does not schedule polling, persist history, or select a Bluetooth adapter. Those responsibilities remain with the calling application.

Development

python -m venv .venv
source .venv/bin/activate
python -m pip install --editable '.[dev]'
ruff check .
ruff format --check .
mypy
pytest
python -m build
twine check dist/*

See CONTRIBUTING.md for contribution guidance and CHANGELOG.md for release notes.

License

Copyright © 2026 Daniel Wilson (@Danw33)

Licensed under the Apache License, Version 2.0. See LICENSE.

Release files for ctek-battery-sense 0.1.0

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

Source distribution (sdist)

Source distribution for ctek-battery-sense 0.1.0
File Size Uploaded
ctek_battery_sense-0.1.0.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ctek-battery-sense 0.1.0
File Interpreter ABI Platform
ctek_battery_sense-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.2 kB

Release files / ctek_battery_sense-0.1.0.tar.gz

Download URL ctek_battery_sense-0.1.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c696fcae1e3108939926c6a9fbc1f537ed6152314e5e9fe3c07520881a7392b5
BLAKE2b-256 checksum
How to use checksums
b076bbe39c25de4732ca66f4004e9c8b7954e1547e0f752e3c6c5d6f87531387
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / ctek_battery_sense-0.1.0-py3-none-any.whl

Download URL ctek_battery_sense-0.1.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa9269500a9046c8b2efe959d621fec1b9b933dbaf181610688fd652318ef36d
BLAKE2b-256 checksum
How to use checksums
09fcfbecdbec256c3aa97e3d35c8022b9944f56cbfcb67adea2789199bac421f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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