Skip to main content

Rubetek API Library

Python Version License HACS

Асинхронная Python-библиотека для работы с облачной платформой умного дома Rubetek.

📋 Описание

Библиотека предоставляет удобный асинхронный интерфейс для подключения к облачной платформе Rubetek: управление сессией, получение данных об устройствах, камерах и домофонах, а также мониторинг состояния всей экосистемы. Основана на RubetekSocketApi.

Внимание: проект является сторонней, неофициальной библиотекой и не имеет отношения к компании Rubetek — это независимая реализация под клиентский API.

✨ Возможности

  • 🔐 Авторизация и управление сессией подключения к Rubetek Cloud
  • 🏠 Получение списка домов (homes) и устройств с текущим состоянием
  • 🎥 Работа с камерами: статус, live-снимок, RTSP-поток
  • 🏢 Домофоны (intercoms): статус и поддержка WebRTC
  • 📺 Просмотр видеопотока домофона через WebRTC (WebRTCViewer)
  • 📼 HLS/TS-мост для отдачи потока домофона по HTTP (HlsStream)
  • 🔔 Подписка на события в реальном времени (WebSocket)
  • 🔄 Автоматическое переподключение и обновление токенов при обрыве связи
  • 🪵 Логирование с маскированием чувствительных данных и настраиваемым уровнем детализации

🚀 Установка

Базовый пакет

pip install saarubetek-api

Установка из исходников:

pip install git+https://github.com/RuFiHome/RubetekAPI.git

Дополнительные зависимости (по функционалу)

WebRTC-видео требует aiortc и websockets, HLS-мост — av (PyAV):

# Только WebRTC
pip install "saarubetek-api[webrtc]"

# Только HLS
pip install "saarubetek-api[hls]"

# Всё сразу
pip install "saarubetek-api[webrtc,hls]"

🧑‍💻 Быстрый старт

import asyncio
from SAARubetekAPI import SAARubetekAPI
from SAARubetekAPI.exceptions import AuthorizationRequiredRubetekAPIError

async def main():
    api = SAARubetekAPI()
    try:
        try:
            await api.refresh_tokens()
        except AuthorizationRequiredRubetekAPIError as error:
            print(error)
            phone = input("Введите номер телефона (c +7): ")
            await api.authentication(phone=phone)
            code = input("Введите последние 4 цифры номера звонившего телефона: ")
            await api.authorization(phone=phone, code=code)

        user = await api.get_user()
        print("User:", user)

        houses = await api.get_homes()
        api.house_id = houses[0].id if houses else None
        print("Homes:", houses)

        devices = await api.get_devices()
        print("Devices:", devices)

        cameras = await api.get_cameras()
        print("Cameras:", cameras)

        intercoms = await api.get_intercoms()
        print("Intercoms:", intercoms)
    finally:
        await api.close()

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

Полный пример с просмотром WebRTC-потока домофона — в Examples/run.py.

📁 Структура проекта

  • SAARubetekAPI/ — исходный код библиотеки
    • wrapper.py — основной клиент SAARubetekAPI
    • models.py — Pydantic-модели (User, House, Device, Camera, Intercom)
    • webrtc.py — просмотр WebRTC-видео домофона (WebRTCViewer)
    • hls_bridge.py — HLS/TS-мост (HlsStream)
    • exceptions.py — иерархия ошибок библиотеки
    • logger.py — логирование с маскированием токенов/телефонов
  • Examples/run.py — пример использования

⚖️ Лицензия

MIT

Metadata

Release files for saarubetek-api 0.0.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 saarubetek-api 0.0.3
File Size Uploaded Provenance
saarubetek_api-0.0.3.tar.gz 30.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for saarubetek-api 0.0.3
File Interpreter ABI Platform
saarubetek_api-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 52.5 kB

Release files / saarubetek_api-0.0.3.tar.gz

Download URL saarubetek_api-0.0.3.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4a1d654d6ada1abeda1b8522cdb8827276d5298641d14dd26b246d3a96e07166
BLAKE2b-256 checksum
How to use checksums
3ce377ad6033fe2cb622aa222ac35620a285a20069de91944b57a844241ca073
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 Oct 21, 2026.

Transparency log

Release files / saarubetek_api-0.0.3-py3-none-any.whl

Download URL saarubetek_api-0.0.3-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6bba0cd1928f6ac6ff6e82990034caf0d8eeb9cc14fdd4511fc5c3a426985b8
BLAKE2b-256 checksum
How to use checksums
cd5fe73d672bad2c64f565fe961ae3d98ec7ddf4c7a137699e64fa468890a49c
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 Oct 21, 2026.

Transparency log

Security for saarubetek-api 0.0.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for saarubetek_api-0.0.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 Oct 21, 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.

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