Skip to main content

kubegate — control your KUBE gate from Python / Home Assistant

Local BLE and (soon) cloud control for gate automations built on the Key Automation KUBE WiFi/BLE module — sold under several brands:

AVO · Easy · Key Automation · Levada

Many owners don't realise their "AVO" or "Levada" gate app is the same KUBE platform underneath. If your gate uses one of these apps, this library talks to it.

This repo hosts the reusable protocol library (kubegate). The Home Assistant integration lives in ha-kube and builds on it.

Status

  • ✅ Local BLE: handshake, encrypted commands (open / close / pedestrian / light), live status — reverse-engineered and verified against real devices.
  • ✅ Cloud (remote): encrypt to the gate's public key + sign with your key, written to the RTDB relay — verified on real hardware.
  • ✅ Account discovery: log in with your brand account to auto-import gates, passkeys and keys.

Install

pip install -e .

Quick start (BLE)

python -m kubegate.cli scan
python -m kubegate.cli status --addr <ADDR> --passkey 0000000000012345
python -m kubegate.cli open   --addr <ADDR> --passkey 0000000000012345
import asyncio
from kubegate.ble import KubeBleDevice

async def main():
    async with KubeBleDevice("<ADDR>", "0000000000012345") as gate:
        await gate.action("open")
        print(gate.status)

asyncio.run(main())

Protocol (short)

enckey1 = AES128_ECB(passkey, serial)             # constant per device
enckey2 = AES128_ECB(passkey, nonce XOR enckey1)  # per-connection XOR pad
token   = (nonce XOR enckey1) XOR enckey2          # auth, written to f1170005
frames: @LLLL<body># , body = name or name={json}; whole frame XOR enckey2
action: cact={"cmd":"C30B","val":N}  (N: 8 open · 4 close · 128 pedestrian · 256 light)

The passkey is a 16-digit, zero-padded number from your account/installation.

License

Apache-2.0. Not affiliated with Key Automation or any brand listed above.

Metadata

Release files for kubegate 0.1.7

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

Source distribution (sdist)

Source distribution for kubegate 0.1.7
File Size Uploaded Provenance Actions
kubegate-0.1.7.tar.gz 20.1 kB With provenance Details for kubegate-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kubegate 0.1.7
File Interpreter ABI Platform Actions
kubegate-0.1.7-py3-none-any.whl Python 3 none any Details for kubegate-0.1.7-py3-none-any.whl

Total release size: 41.8 kB

Release files / kubegate-0.1.7.tar.gz

Download URL kubegate-0.1.7.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5b7c0e63f26642f6e0e3a21e7a0eb72b865b04ef38025c1dd0204fcad58d9160
BLAKE2b-256 checksum
How to use checksums
4f31628c8c12532c269138d94157664819dc76a62d534fcb2a08d710c3e2f5bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / kubegate-0.1.7-py3-none-any.whl

Download URL kubegate-0.1.7-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
036ee8e97c1e1e1d52d8487a0b229f05f6f6001b85f168cd35860df7c4fcfc35
BLAKE2b-256 checksum
How to use checksums
60aa4ee0962a8df7d48825e90c2929f26a540a81333b4bbe4095512afea0dce4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Security for kubegate 0.1.7

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kubegate-0.1.7.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 Nov 28, 2026.

Transparency log

A 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.

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