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.