Skip to main content

A Python library for controlling Sesame smart locks over Bluetooth Low Energy.

Project description

gomalock

PyPI - Version Python Version from PEP 621 TOML License Test

Sesame スマートロックを Bluetooth Low Energy で操作する Python ライブラリ。

主な機能

  • Sesame 5 / Sesame 5 Pro / Sesame 5 USA の施錠、解錠、トグル操作
  • Sesame 5 系の角度、バッテリー残量、オートロック設定の取得と変更
  • Sesame Touch / Sesame Touch Pro / Sesame Touch 2 / Sesame Touch 2 Pro のバッテリー残量と登録済みカード、指紋、パスワード数の取得
  • 周囲の Sesame デバイスのスキャン
  • 新規 Sesame デバイスの登録
  • 共有用 QR URL の作成
  • 予期しない切断後の自動再接続

インストール

pip install gomalock

最新のソースからインストールする場合:

pip install git+https://github.com/meronepy/gomalock.git

クイックスタート

import asyncio

import gomalock

ADDRESS = "XX:XX:XX:XX:XX:XX"
SECRET_KEY = "0123456789abcdef0123456789abcdef"


async def main():
    async with gomalock.Sesame5(ADDRESS, secret_key=SECRET_KEY) as sesame5:
        await sesame5.unlock("gomalock")


if __name__ == "__main__":
    asyncio.run(main())

注意事項

  • Raspberry Pi OS では Bluetooth がブロックされていることがあります。BleakBluetoothNotAvailableError が出る場合は、次を試してください。
sudo rfkill unblock bluetooth
  • Bluetooth は距離が近いほど安定します。スキャンできない、接続に失敗する、操作だけ失敗する場合は、デバイスとの距離を近づけて試してください。
  • Linux では BlueZ 5.82 (Raspberry Pi OS Trixie) 以降 が必要です。
  • 履歴機能は公式アプリとの連携が難しいため実装していません。
  • 非公式ライブラリです。動作保証はありません。自己責任で使用してください。

開発環境

  • Windows 11 24H2, Python 3.13.3
  • Raspberry Pi Zero 2W, Raspberry Pi OS Trixie (64bit), Python 3.13.3
  • Sesame 5, 3.0-5-ad26ee
  • Sesame 5 Pro, 3.0-7-ad26ee

対応機種

対応状況 機種
Sesame 5
Sesame 5 Pro
⚠️ Sesame 5 US (未検証)
Sesame 4以前
対応状況 機種
Sesame Touch
⚠️ Sesame Touch Pro (未検証)
⚠️ Sesame Touch 2 (未検証)
⚠️ Sesame Touch 2 Pro (未検証)
Sesame Face
Sesame Face Pro

対応環境

対応状況 OS
Windows 11 version 22000 以降
Linux with BlueZ 5.82 以降
⚠️ macOS 10.15 以降 (未検証)

Python 3.12 以降が必要です。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gomalock-2.0.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gomalock-2.0.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file gomalock-2.0.0.tar.gz.

File metadata

  • Download URL: gomalock-2.0.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gomalock-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d16d35bafd8e1ba8f115268a2444fdc1859c3d3637aef7f9474a18652bafc846
MD5 4cfe83a8f3fcd9a3a26e3c630706ec33
BLAKE2b-256 7d43c36921aeae474deea03ea57f9f0aad8175f8f240b9c848e85a36ab0600a6

See more details on using hashes here.

File details

Details for the file gomalock-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: gomalock-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gomalock-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3de7d03dcd32384527584601b9d375f62d9a0e94de417df192a527fc4d5d0ca
MD5 0a48569154b1eac50f80f0b5438138a5
BLAKE2b-256 9c1436a624e06e3c8973a99d2c1ae867698500268075a903a954bdec2c54652e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page