Overkiz API and Somfy API

Somfy has released its official API to manipulate their devices: Somfy Open API Developer Portal | APIs & Docs

Edit: Since HA 0.95, their is now a component using this API: https://www.home-assistant.io/components/somfy/ :partying_face: Many thanks guy for all your support :smiley:

:warning: Not all the devices are supported yet by the official Somfy API (and so by the Somfy component). To be sure your devices are (not) supported please follow these steps:

Edit 2: Iā€™ve renamed this topic as the discussion now move around the custom component Overkiz (by Somfy). This component supports the following hubs:

  • Somfy TaHoma
  • Somfy TaHoma Switch
  • Somfy Connexoon IO
  • Somfy Connexoon RTS
  • Atlantic Cozytouch
  • Hitachi Hi Kumo
  • Rexel Energeasy Connect
  • Nexity EugĆ©nie

:heart: If you want to show your appreciation, consider buying me a coffee or a pizza by clicking on the ā€œBy me a coffeeā€ image below!

Buy Me A Coffee

This API can also be used for the more affordable connexoon. It would be awesome if HA can use this API

2 Likes

This would allow me to finaly control my somfy sunscreens with the Connexxoon via Home assistant. Would love to see the API implemented!

1 Like

@nelbs @darkpainy donā€™t forget to vote :wink:

What are our chances to introduce this API in HomeAssistant? :slight_smile:

After some research, the Somfy API look like the Wink API. So inspired by the python-wink library, Iā€™ve started to develop the Somfy one: https://github.com/tetienne/somfy-open-api/
Iā€™ve 10 years of experience in Java, Python is kind of new for me. So I will use this project to learn the basics.

4 Likes

Iā€™ve updated my python library to request successfully the Somfy API. An example in the README describe how list for instance all the covers.

For the moment, Somfy does not return the light like Hue, or the sensors like the Solar sensor. Iā€™ve been able to test only with the covers.

1 Like

Iā€™ve finished to developed the client to manipulate the covers from the Somfy API. The documentation does not provide enough information to implement other devices. I need some volunteers to discover what Somfy exposes. The list of available devices are here: https://developer.somfy.com/products-services-informations.

On my repository, I explain how to help me to enhance the client: https://github.com/tetienne/somfy-open-api. Itā€™s really easy.

Meanwhile, Iā€™ve contacted Somfy Support to have more details. They are also working on a fix about the GET /device/<device_id> not returning the correct state. Thatā€™s a bug I found during my tests.

Once the client mature enough, I will start to integrate it in Home Assistant. Iā€™ve read the documentation, it seems not so obvious but will be feasible.

2 Likes

My somfy covers are categorized as interior_blind and support the following exec commans:

  • identify
  • open
  • close
  • stop

Created issue

Thank you for your issue. It should be quick to add support for this device. Monday I will have a look.
Iā€™m curious, you cannot control the position of your blinds?

Well the blinds donā€™t support it. So that makes sense. However, the blinds do support a predefined position called the My Position. I raised the issue with somfy to support it in the API.

Tahoma component works with connexoon too.

@robertpe We never said the opposite. Currently the Tahoma component use the unofficial API, scraped from the Tahoma website.
Purpose here is to use the official API which has been created to be exposed to the world. Perhaps, the set of features is limited but it should evolve in the future if Somfy play well the game.

@pbavinck Indeed that makes sense. You are right, for the covers, I havenā€™t too the My position command. Iā€™ve solved your issue on the repository. There is one question waiting for you :wink:
By the way, if you can only open and close your blinds, whatā€™s the purpose of the stop command?

You can stop them mid-way. E.g.
Open: not covering the window
Closed: curtains/covers are all the way down
Stop: While the curtain/covers is going up or down, you can tell it to stop, only covering top part of the window.

@pbavinck So thatā€™s weird Somfy does not return the position command like the roller shutter. Thatā€™s make no sense. By the way, can you have look on your issue please?

Iā€™ve uploaded my library to pypi. It means now an home assistant component can use it.

@tetienne I do not seems to manage to install your pymfy module using PyPIā€¦

I set up a python3 virtual environment using python3 -m venv . . Then I started python application with your example code. It gives me:

(test) Bert-MBP:test bertouttier$ python3 main.py
Traceback (most recent call last):
File "main.py", line 8, in &lt;module&gt;
from pymfy.api.somfy_api import SomfyApi
ModuleNotFoundError: No module named 'pymfy'

What am I doing wrong? Could you indicate how to install your module from source?

Can you show me your main.py file please ? Maybe Iā€™ve badly upload my package.

it is just a copy/paste of your example code:

import json
import re

client_id = r'test'
redir_url = 'https://hassio.com'
secret = r'7test'

from pymfy.api.somfy_api import SomfyApi

api = SomfyApi(client_id, redir_url)
authorization_url, state = api.get_authorization_url()
print('Please go to {} and authorize access.'.format(authorization_url))
authorization_response = input('Enter the full callback URL')
api.request_token(authorization_response, secret)
api.automatic_refresh()

devices = api.get_devices()
# Remove personal information
dumps = json.dumps(devices, sort_keys=True, indent=4, separators=(',', ': '))
dumps = re.sub('".*id.*": ".*",\n', '', dumps)

print(dumps)

When I try to install pymfy

pi@raspberry:~ $ pip install pymfy
Collecting pymfy
  Could not find a version that satisfies the requirement pymfy (from versions: )
No matching distribution found for pymfy