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

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.3
File Size Uploaded Provenance Actions
kubegate-0.1.3.tar.gz 18.0 kB With provenance Details for kubegate-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 37.4 kB

Release files / kubegate-0.1.3.tar.gz

Download URL kubegate-0.1.3.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e5c3d45b9204edcd95bc45d49b5f3690892357465b04e38deda54e55ab336d5d
BLAKE2b-256 checksum
How to use checksums
3ecacd626c5f45dbea9d629b6de20997a09d13df9b56e0251147de627d5ed424
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.3-py3-none-any.whl

Download URL kubegate-0.1.3-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8503bfbd9e11b7eed8ab0430ee2af3be1e95457e6554b51551896747212918c8
BLAKE2b-256 checksum
How to use checksums
d1eb499d4d6439db03789ab8b3c6a426837e1e93efc41b033040655c878fc3cf
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.3

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