{"id":51202341,"url":"https://github.com/mayerwin/ha-switchbot-lock-quick-key-support","last_synced_at":"2026-06-28T01:03:58.537Z","repository":{"id":363724267,"uuid":"1264631845","full_name":"mayerwin/ha-switchbot-lock-quick-key-support","owner":"mayerwin","description":"Interim Home Assistant integration exposing SwitchBot Lock Ultra 'Quick Key' settings over BLE — until sblibs/pySwitchbot#515 merges.","archived":false,"fork":false,"pushed_at":"2026-06-10T04:07:24.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-10T06:09:52.605Z","etag":null,"topics":["ble","bluetooth","custom-integration","hacs","home-assistant","lock-ultra","switchbot","switchbot-lock"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mayerwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-10T03:48:21.000Z","updated_at":"2026-06-10T04:07:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mayerwin/ha-switchbot-lock-quick-key-support","commit_stats":null,"previous_names":["mayerwin/ha-switchbot-lock-quick-key-support"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mayerwin/ha-switchbot-lock-quick-key-support","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Fha-switchbot-lock-quick-key-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Fha-switchbot-lock-quick-key-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Fha-switchbot-lock-quick-key-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Fha-switchbot-lock-quick-key-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mayerwin","download_url":"https://codeload.github.com/mayerwin/ha-switchbot-lock-quick-key-support/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Fha-switchbot-lock-quick-key-support/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34873667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ble","bluetooth","custom-integration","hacs","home-assistant","lock-ultra","switchbot","switchbot-lock"],"created_at":"2026-06-28T01:03:57.574Z","updated_at":"2026-06-28T01:03:58.529Z","avatar_url":"https://github.com/mayerwin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwitchBot Lock Quick Key — Home Assistant integration (interim)\n\n[![hacs_badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg)](https://github.com/hacs/integration)\n\nA small Home Assistant custom integration that exposes the **\"Quick Key\"** settings of\nthe **SwitchBot Lock Ultra** as native\nHA entities, over Bluetooth LE.\n\nThe stock SwitchBot integration (and the underlying [`pySwitchbot`](https://github.com/sblibs/pySwitchbot)\nlibrary) don't expose these settings yet. This integration reverse-engineers the single\nBLE config byte that holds them and surfaces it as entities, so you can read and change\nthe Quick Key from automations and dashboards.\n\n\u003e **Interim / temporary.** This is a stop-gap until native support lands upstream.\n\u003e Tracking PR: **[sblibs/pySwitchbot#515](https://github.com/sblibs/pySwitchbot/pull/515)**.\n\u003e When that merges, switch to the stock SwitchBot integration and remove this.\n\n## What it exposes\n\nOn your existing Lock Ultra device, this adds:\n\n| Entity | Type | Values |\n|---|---|---|\n| Quick Key function | `select` | `Lock \u0026 Unlock` · `Lock Only` · `Unlock Only` |\n| Quick Key trigger | `select` | `Single Press` · `Double Press` |\n| Quick Key | `switch` | enable / disable the Quick Key |\n| Quick Key config byte | `sensor` (diagnostic) | raw `0xNN` |\n| Quick Key refresh | `button` | re-read the byte over BLE on demand |\n\n## Requirements\n\n- The **core SwitchBot integration** already set up with your Lock Ultra (this provides\n  `pySwitchbot` / `switchbot-ble` **and** the per-lock encryption keys — this integration\n  *reuses the core integration's live BLE connection and keys*, it never opens its own\n  second connection or stores secrets).\n- Home Assistant **2024.1** or newer.\n- Bluetooth working in HA (a Bluetooth adapter or an ESPHome Bluetooth proxy in range).\n\nNo extra Python requirements: `switchbot-ble` is already pulled in by the core integration.\n\n## Installation\n\n### HACS (recommended)\n\n1. HACS → **⋮** → **Custom repositories**.\n2. Repository: `https://github.com/mayerwin/ha-switchbot-lock-quick-key-support`, Category: **Integration**.\n3. Install **SwitchBot Lock Quick Key (interim)**, then **restart Home Assistant**.\n4. **Settings → Devices \u0026 Services → Add Integration → SwitchBot Lock Quick Key**, and pick your lock.\n\n### Manual\n\nCopy `custom_components/switchbot_quickkey/` into your HA `config/custom_components/`,\nrestart, then add the integration as above.\n\n## How it works\n\nThe Quick Key feature and its sub-settings live in a **single config byte** on the lock,\nread/written over BLE:\n\n```\nREAD : 57 0f 4f 04 01            -\u003e reply: \u003cstatus\u003e \u003cCFG\u003e 00 00 00 80\nWRITE: 57 0f 4e 04 01 00 \u003cmask\u003e \u003cval\u003e ff   (masked write of the low nibble)\n```\n\nCFG byte (low nibble; high bits `0xC0` are constant status flags):\n\n- bit 3 (`0x08`) = Quick Key **enabled**\n- bit 2 (`0x04`) = trigger: 1 = **double** press, 0 = **single**\n- bits 1-0 (`0x03`) = function: `0b10` Lock \u0026 Unlock · `0b01` Unlock Only · `0b00` Lock Only\n\nTo avoid the `org.bluez.Error.InProgress` contention that two connections to one lock\nradio cause, this integration borrows the **live `SwitchbotLock` object** owned by the\ncore integration (`entry.runtime_data.device`) and serialises on its operation lock.\nThere is **no periodic polling** — it reads once at startup, on the Refresh button, and\nafter each write, to spare the lock's battery.\n\n## Tested on\n\n- **SwitchBot Lock Ultra**, firmware **V2.6**, via HA Bluetooth. All function/trigger/enable\n  combinations write + read-back cleanly (verified end-to-end).\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayerwin%2Fha-switchbot-lock-quick-key-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayerwin%2Fha-switchbot-lock-quick-key-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayerwin%2Fha-switchbot-lock-quick-key-support/lists"}