govee-ble-local
Local Bluetooth LE control of Govee devices — no cloud, no LAN API.
A standalone Python library implementing Govee's BLE control protocol (AES-ECB+RC4
handshake, 20-byte command framing, multi-packet scene upload, and status read-back),
derived from the decompiled Govee Home app and verified against real hardware. It's the
protocol engine behind the
hass-govee-ble-local
Home Assistant integration, but has no Home Assistant dependency and can be used on its own.
⚠️ Unofficial. Not affiliated with or endorsed by Govee. Reverse-engineered from the app + hardware; behavior may change with device firmware. Live-verified on the H60A6 (Ceiling Light Pro); the other curated SKUs are modelled from the app and are not all hardware-verified (see the profile notes).
Install
pip install govee-ble-local
# optional Govee cloud-account helpers (pulls in aiohttp):
pip install 'govee-ble-local[cloud]'
# or, from a clone (editable, for development):
git clone https://github.com/Brady-Woods/govee-ble-local.git
cd govee-ble-local && pip install -e '.[dev]'
Requires Python 3.11+. Runtime dependencies are deliberately minimal and Home-Assistant-friendly:
bleak, bleak-retry-connector, cryptography (all shipped with HA), plus kaitaistruct (a
pure-Python, stdlib-only wire-parser runtime). Dev extras: .[dev] (everything a contributor needs), or individually .[test], .[typing],
.[lint], .[audit], .[docs].
Quick start
import asyncio
from govee_ble_local import create_device, discover
async def main():
# Active-scan for supported Govee devices (strongest advertisement per address).
devices = await discover(timeout=8.0)
found = next(d for d in devices if d.sku == "H60A6")
dev = create_device(found.ble_device, found.sku)
await dev.turn_on()
await dev.set_brightness(60) # percent
await dev.set_rgb((255, 0, 0))
await dev.set_zone_power("background", False)
state = await dev.update() # read-back into dev.state
print(state.is_on, state.brightness, state.rgb_color, state.segments)
await dev.stop()
asyncio.run(main())
API
The library follows Home-Assistant BLE-library conventions: identify a device from its
advertisement, build a capability-driven Device, then drive it.
discover(timeout=10.0, *, supported_only=True)— active-scan →list[DiscoveredDevice](.ble_device,.advertisement,.sku,.rssi,.supported).supported(name, mfg)andmatch(ble_device, adv)are the passive-matcher hooks for a HA-style scanner.create_device(ble_device, sku, advertisement_data=None, *, secret=None, frame_log=None)— construct aDevicefor the SKU (raisesGoveeBleNotSupportedif uncurated).is_supported_sku(sku)/supported_skus()/device_profile_for(sku)query the table.Device— one capability-gated class (behaviour comes from itsDeviceProfile, not subclasses). Commands are ACK-confirmed on the wire:turn_on/turn_off/set_power,set_brightness,set_rgb,set_color_temp,set_segment_rgb/set_segment_brightness/set_segment_color_temp,set_zone_power/set_zone_rgb/set_zone_color_temp,set_scene/set_scene_by_name, andupdate()(read-back). Introspection:capabilities,zones,min_kelvin/max_kelvin,scene_names,state,register_callback. Methods for unsupported capabilities raiseGoveeBleNotSupported.DeviceState— parsed state:is_on,brightness(0–100),rgb_color,color_temp_kelvin,segments(list[Segment]),zone_power,scene_code, plus device-info (serial_number,wifi_mac,hardware_version,firmware_version,ble_mac).Capability—POWER,BRIGHTNESS,RGB,COLOR_TEMP,SEGMENTS,SCENES.
Curated SKUs: H60A6, H6047, H61A8, H6006/H6008, H6052, H6641, and the plug family (H5080/H5082/H5083/H5085/H5089/H5160/H5161). Segment-colour read-back and some scene dialects on the non-H60A6 SKUs are source-modelled and not yet hardware-verified.
The full API reference is generated from the docstrings with pdoc
(pip install '.[docs]' && bash tools/gen_docs.sh → docs/api/); govee_ble_local.__all__ is the
public contract.
Security notes
The Govee BLE protocol itself has well-known limits that this library cannot fix:
- Its encryption uses a public pre-shared key, AES-ECB for the handshake and an RC4 stream for traffic, and integrity is only an XOR checksum. Anyone within radio range can drive an encrypted device.
- Captures made with
GOVEE_FRAME_LOGcontain wire frames from which the session key can be derived. Treat them as sensitive and do not post them publicly. Frame-log files are created with owner-only permissions.
Diagnostics & session capture
The library logs under the govee_ble_local.* hierarchy and can capture a full protocol
session (over a local adapter or a Home Assistant Bluetooth proxy) for analysis. Enable the
flow trace, or the per-frame firehose, and decode a capture with the bundled
govee-ble-analyze CLI. See docs/DIAGNOSTICS.md.
Protocol
The wire protocol is specified as Kaitai Struct definitions — spec/govee_ble.ksy
(command/reply frames) and spec/govee_adv.ksy (advertisements) — with the
per-device table in spec/devices.yaml. The runtime readers under
govee_ble_local/_generated/ are generated from those (source of truth: the decompiled Govee app).
Contributing & versioning
See CONTRIBUTING.md for development setup, branching, commit, and release
conventions. Changes are tracked in CHANGELOG.md; the project follows
Semantic Versioning. Live hardware tests run against the curated SKUs above.
License
MIT © Brady Woods
Metadata
Release files for govee-ble-local 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| govee_ble_local-1.2.1.tar.gz | 134.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| govee_ble_local-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 269.8 kB
Release files / govee_ble_local-1.2.1.tar.gz
| Download URL | govee_ble_local-1.2.1.tar.gz |
|---|---|
| Size | 134.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56a72de44549c8f7b475fab621716612983d42d3ad7439651886ee151114c685
|
|
BLAKE2b-256 checksum How to use checksums |
22a467c4a0f8e9f0b353866a5b101bcddde0e3db1021cf8b42f8833fa69b28fb
|
| 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 Oct 13, 2026.
Transparency logRelease files / govee_ble_local-1.2.1-py3-none-any.whl
| Download URL | govee_ble_local-1.2.1-py3-none-any.whl |
|---|---|
| Size | 135.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70d6b13fc0144e6c91bbc4dec86d75a2c427b02e708bf637c66ad20cf7c2fc6d
|
|
BLAKE2b-256 checksum How to use checksums |
d8a46fdf4a3cb2f9e0021ad8f6d0c3f40a8798aa33a63c2e1f90c81a055aee5e
|
| 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 Oct 13, 2026.
Transparency logSecurity for govee-ble-local 1.2.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for govee_ble_local-1.2.1.tar.gz
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 Oct 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.