Skip to main content

A fully asynchronous API client for interaction with smart devices connected to OverKiz, supporting multiple vendors such as Somfy TaHoma and Atlantic Cozytouch.

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

from pyoverkiz.auth.credentials import UsernamePasswordCredentials
from pyoverkiz.client import OverkizClient
from pyoverkiz.models import Action, Command
from pyoverkiz.enums import Server, OverkizCommand

USERNAME = ""
PASSWORD = ""


async def main() -> None:
    async with OverkizClient(
        server=Server.SOMFY_EUROPE,
        credentials=UsernamePasswordCredentials(USERNAME, PASSWORD),
    ) as client:
        await client.login()

        devices = await client.get_devices()

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

        await client.execute_action_group(
            actions=[
                Action(
                    device_url="io://1234-5678-1234/12345678",
                    commands=[
                        Command(name=OverkizCommand.SET_CLOSURE, parameters=[100])
                    ]
                )
            ],
            label="Execution via Python",
            # mode=ExecutionMode.HIGH_PRIORITY
        )

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

            await asyncio.sleep(2)


asyncio.run(main())

Local API

import asyncio

from pyoverkiz.auth.credentials import LocalTokenCredentials
from pyoverkiz.client import OverkizClient
from pyoverkiz.utils import create_local_server_config

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

    async with OverkizClient(
        server=create_local_server_config(host=LOCAL_GATEWAY),
        credentials=LocalTokenCredentials(token),
        verify_ssl=VERIFY_SSL,
    ) as client:
        await client.login()

        print("Local API connection successful!")

        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.device_url}) - {device.controllable_name}")
            print(f"{device.widget} - {device.ui_class}")

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

            await asyncio.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 prek 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-2.0.0rc1.tar.gz (101.3 kB view details)

Uploaded Source

Built Distribution

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

pyoverkiz-2.0.0rc1-py3-none-any.whl (110.7 kB view details)

Uploaded Python 3

File details

Details for the file pyoverkiz-2.0.0rc1.tar.gz.

File metadata

  • Download URL: pyoverkiz-2.0.0rc1.tar.gz
  • Upload date:
  • Size: 101.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyoverkiz-2.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 e0d1995ad47696853fd8d1c6aae0666fcf05ba9c2e1a7f906cb08c70b7c69eec
MD5 11fe8b0d11ec2c04beb1a8be8839ae69
BLAKE2b-256 6b4b4c47f05b069d0fa76efc45bcb33dd0c2743daa997a7d29e182c91a9bddc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyoverkiz-2.0.0rc1.tar.gz:

Publisher: release.yml on iMicknl/python-overkiz-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyoverkiz-2.0.0rc1-py3-none-any.whl.

File metadata

  • Download URL: pyoverkiz-2.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 110.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyoverkiz-2.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 4bd5f51c6b9a3d9831b6a7d9d06850146b59d8aa11b223d7e904655c109e93e9
MD5 9af839bcb812c38b3452bdb22b0017cc
BLAKE2b-256 f0eda6eaa19d77e5426902f711ee18021222df2291d1effedbab3cf8fbdbebd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyoverkiz-2.0.0rc1-py3-none-any.whl:

Publisher: release.yml on iMicknl/python-overkiz-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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