Skip to main content

Async Python client to interact with internal OverKiz API (e.g. used by Somfy TaHoma).

Project description

Python client for OverKiz API

A fully asynchronous and user-friendly API client for the OverKiz platform. This client enables interaction with smart devices connected to OverKiz, supporting multiple vendors such as Somfy TaHoma and Atlantic Cozytouch.

This package is primarily used by Home Assistant Core to provide the Overkiz integration. If you wish to use this package in your own project, refer to the examples below or explore the Home Assistant source code for additional usage examples.

Supported hubs

  • Atlantic Cozytouch
  • Bouygues Flexom
  • Brandt Smart Control *
  • Hitachi Hi Kumo
  • Nexity Eugénie
  • Rexel Energeasy Connect *
  • Sauter Cozytouch
  • Simu (LiveIn2)
  • Somfy Connexoon IO
  • Somfy Connexoon RTS
  • Somfy TaHoma
  • Somfy TaHoma Switch
  • Thermor Cozytouch

[*] These servers utilize an authentication method that is currently not supported by this library. To use this library with these servers, you will need to obtain an access token (by sniffing the original app) and create a local user on the Overkiz API platform.

Installation

pip install pyoverkiz

Getting started

Cloud API

import asyncio
import time

from pyoverkiz.const import SUPPORTED_SERVERS
from pyoverkiz.client import OverkizClient
from pyoverkiz.enums import Server

USERNAME = ""
PASSWORD = ""


async def main() -> None:
    async with OverkizClient(
        USERNAME, PASSWORD, server=SUPPORTED_SERVERS[Server.SOMFY_EUROPE]
    ) as client:
        try:
            await client.login()
        except Exception as exception:  # pylint: disable=broad-except
            print(exception)
            return

        devices = await client.get_devices()

        for device in devices:
            print(f"{device.label} ({device.id}) - {device.controllable_name}")
            print(f"{device.widget} - {device.ui_class}")

        while True:
            events = await client.fetch_events()
            print(events)

            time.sleep(2)


asyncio.run(main())

Local API

import asyncio
import time
import aiohttp

from pyoverkiz.client import OverkizClient
from pyoverkiz.const import SUPPORTED_SERVERS, OverkizServer
from pyoverkiz.enums import Server

USERNAME = ""
PASSWORD = ""
LOCAL_GATEWAY = "gateway-xxxx-xxxx-xxxx.local"  # or use the IP address of your gateway
VERIFY_SSL = True  # set verify_ssl to False if you don't use the .local hostname


async def main() -> None:
    token = ""  # generate your token via the Somfy app and include it here

    # Local Connection
    session = aiohttp.ClientSession(
        connector=aiohttp.TCPConnector(verify_ssl=VERIFY_SSL)
    )

    async with OverkizClient(
        username="",
        password="",
        token=token,
        session=session,
        verify_ssl=VERIFY_SSL,
        server=OverkizServer(
            name="Somfy TaHoma (local)",
            endpoint=f"https://{LOCAL_GATEWAY}:8443/enduser-mobile-web/1/enduserAPI/",
            manufacturer="Somfy",
            configuration_url=None,
        ),
    ) as client:
        await client.login()

        print("Local API connection succesfull!")

        print(await client.get_api_version())

        setup = await client.get_setup()
        print(setup)

        devices = await client.get_devices()
        print(devices)

        for device in devices:
            print(f"{device.label} ({device.id}) - {device.controllable_name}")
            print(f"{device.widget} - {device.ui_class}")

        while True:
            events = await client.fetch_events()
            print(events)

            time.sleep(2)


asyncio.run(main())

Projects using pyOverkiz

This package powers the Overkiz integration in Home Assistant Core. Other open-source projects and custom automations also leverage pyOverkiz to interact with Overkiz-compatible hubs and devices, including:

  • overkiz2mqtt: Bridges Overkiz devices to MQTT for integration with various platforms.
  • mcp-overkiz: Implements an MCP server to enable communication between Overkiz devices and language models.
  • tahoma: Command Line Interface (CLI) to control Overkiz devices.

Contribute

We welcome contributions! To get started with setting up this project for development, follow the steps below.

Project setup

Dev Container (recommended)

If you use Visual Studio Code with Docker or GitHub Codespaces, you can take advantage of the included Dev Container. This environment comes pre-configured with all necessary dependencies and tools, including the correct Python version, making setup simple and straightforward.

Manual setup

  • Install uv.
  • Clone this repository and navigate to it: cd python-overkiz-api
  • Initialize the project with uv sync, then run uv run pre-commit install

Tests

uv run pytest

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

pyoverkiz-1.20.1.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

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

pyoverkiz-1.20.1-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

File details

Details for the file pyoverkiz-1.20.1.tar.gz.

File metadata

  • Download URL: pyoverkiz-1.20.1.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyoverkiz-1.20.1.tar.gz
Algorithm Hash digest
SHA256 e94a24c2090e4e3971d192e7aecf4f1b65a5980823dd18221f195cb1ae936a67
MD5 2b56067b7172ae715b3210560ba66058
BLAKE2b-256 5d21b79bfb77b0e65ad7a19e6c8a20b8c01a503dd393a79d328a7e1d7ea77600

See more details on using hashes here.

File details

Details for the file pyoverkiz-1.20.1-py3-none-any.whl.

File metadata

  • Download URL: pyoverkiz-1.20.1-py3-none-any.whl
  • Upload date:
  • Size: 51.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyoverkiz-1.20.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4150dce4c44732838e50af3cc4111db0e60c6996113f0de49a3f4accef2bc3b4
MD5 acb74c0c34abd724bbf18b71731d2a13
BLAKE2b-256 048e363d74ed7282d872fb430bc2662b4784a73a69a329d134f9ea75e49e41f0

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