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