Package: pyoverkiz
Python client for OverKiz APIA fully async and easy to use API client for the (internal) OverKiz API. You can use this client to interact with smart devices connected to the OverKiz platform, used by various vendors like Somfy TaHoma and Atlantic Cozytouch.This package is mainly used by Home Assistant Core, to offer the Overkiz integration. If you want to use this package in your own project, you can use thefollowing examplesto get started, or look at theHome Assistant Codefor more examples.Supported hubsAtlantic CozytouchBouygues FlexomHitachi Hi KumoNexity EugénieRexel Energeasy ConnectSimu (LiveIn2)Somfy Connexoon IOSomfy Connexoon RTSSomfy TaHomaSomfy TaHoma SwitchThermor CozytouchInstallationpipinstallpyoverkizGetting startedCloud APIimportasyncioimporttimefrompyoverkiz.constimportSUPPORTED_SERVERSfrompyoverkiz.clientimportOverkizClientUSERNAME=""PASSWORD=""asyncdefmain()->None:asyncwithOverkizClient(USERNAME,PASSWORD,server=SUPPORTED_SERVERS["somfy_europe"])asclient:try:awaitclient.login()exceptExceptionasexception:# pylint: disable=broad-exceptprint(exception)returndevices=awaitclient.get_devices()fordeviceindevices:print(f"{device.label}({device.id}) -{device.controllable_name}")print(f"{device.widget}-{device.ui_class}")whileTrue:events=awaitclient.fetch_events()print(events)time.sleep(2)asyncio.run(main())Local APIimportasyncioimporttimeimportaiohttpfrompyoverkiz.clientimportOverkizClientfrompyoverkiz.constimportSUPPORTED_SERVERS,OverkizServerUSERNAME=""PASSWORD=""LOCAL_GATEWAY="gateway-xxxx-xxxx-xxxx.local"# or use the IP address of your gatewayVERIFY_SSL=True# set verify_ssl to False if you don't use the .local hostnameasyncdefmain()->None:token=""# you can set the token here for testing purposes, to re-use an earlier generated tokenifnottoken:# Generate new token via Cloud APIasyncwithOverkizClient(username=USERNAME,password=PASSWORD,server=SUPPORTED_SERVERS["somfy_europe"])asclient:awaitclient.login()gateways=awaitclient.get_gateways()forgatewayingateways:token=awaitclient.generate_local_token(gateway.id)awaitclient.activate_local_token(gateway_id=gateway.id,token=token,label="Home Assistant/local-dev")print(f"Token for{gateway.label}({gateway.id}):")print(token)# save this token for future use# Local Connectionsession=aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=VERIFY_SSL))asyncwithOverkizClient(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,))asclient:awaitclient.login()print("Local API connection succesfull!")print(awaitclient.get_api_version())setup=awaitclient.get_setup()print(setup)devices=awaitclient.get_devices()print(devices)fordeviceindevices:print(f"{device.label}({device.id}) -{device.controllable_name}")print(f"{device.widget}-{device.ui_class}")whileTrue:events=awaitclient.fetch_events()print(events)time.sleep(2)asyncio.run(main())DevelopmentDevcontainerIf you use Visual Studio Code with Docker or GitHub CodeSpaces, you can leverage the available devcontainer. This will install all required dependencies and tools and has the right Python version available. Easy!ManualFor Linux, installpyenvusingpyenv-installerFor MacOS, runbrew install pyenvDon't forget to update your.bashrcfile (or similar):export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"Install the requireddependenciesInstallpoetry:curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | pythonClone this repositorycd python-overkiz-apiInstall the required Python version:pyenv installInit the project:poetry installRunpoetry run pre-commit install