Overkiz API and Somfy API

Hello,

first of all, thank you for your support.

I am getting error not mentioned here yet. This is error logs after start:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/home/hass/homeassistant/lib/python3.6/site-packages/homeassistant/data_entry_flow.py", line 64, in async_init
    return await self._async_handle_step(flow, flow.init_step, data)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/homeassistant/data_entry_flow.py", line 98, in _async_handle_step
    result = await getattr(flow, method)(user_input)  # type: Dict
  File "/home/hass/.homeassistant/custom_components/somfy/config_flow.py", line 42, in async_step_import
    return await self.async_step_auth()
  File "/home/hass/.homeassistant/custom_components/somfy/config_flow.py", line 67, in async_step_auth
    return self.async_external_step(
AttributeError: 'SomfyFlowHandler' object has no attribute 'async_external_step'

And this error logs when I click configure button:

  File "/home/hass/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/data_entry_flow.py", line 74, in get
    result = await self._flow_mgr.async_configure(flow_id)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/homeassistant/data_entry_flow.py", line 74, in async_configure
    step_id, data_schema = flow.cur_step
TypeError: 'NoneType' object is not iterable

I guess this is related to configuration yaml. Here is what setup I have here:

http:
  base_url: http://192.168.1.2:8123
somfy:
  client_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  client_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Home Assistant version 0.93.1
I copied code from components/somfy folder of version Latest commit 5789425 (only 9 hours old version)

Oh! It’s seems my last modifications are not compatible with the latest HA version. It will with the next one (async_external_step)
Meanwhile, can you try to take the code few commits days ago?

Thanks a lot. :slight_smile: It works like a charm using commit ca39f4c 13 days ago

Thank you @tetienne for your awesome contribution. I am looking forward to control my awning via home assistant and have 2 questions:

  1. Is this API local and only the oath go through Somfy servers or is all communication via the api over the internet?
  2. which hub would you recommend I get Tahoma or conexcoon?

All the communication are done via Internet. So you are dependant of the Somfy’s server.

About Tahoma vs Connexoon, the last one is the little sister, only IO devices are compatible, so no RTS. But I’m not sure if all the devices are compatible, so double check before. Android application are also differents. With Tahoma you have only one, for Conexoon, there is three, each one limited to a set of devices.

For your future awning, I cannot guaranteed it will be discovered by the official API: https://developer.somfy.com/products-services-informations
If it’s not the case, I think the Tahoma component (works with Conexoon too) will detect it.

Can you come back once you have test the integration with HA? I’m curious, I want to install an awning too :smiley:

Hi tetienne. First of all, great work you have done. Many people got it working but unfortunately I am not one of them. For me the reason to move away from the Tahoma component is that the screens are often not responding (timing out). I have made several attempts to get your custom component working but when I want to configure the integration I get an empty box and nothing happens. The .translations folder and files are there so I am kind of stuck. Can you help me out or should I want for the official release of the component (timing?).

Count me in too! I’ve seen a small guide in this topic that explains all steps to do but Home Assistant says it doesn’t recognize the ‘somfy’ component.

Got it working for two screens with a Connexoon with commit ca39f4c (thanks @slesinger) on the latest HA version. I also have an awning which is not discovered by the official API (hopefully it will come?).

(The Tahoma component does not work as I’m not able to create a user in the Tahoma system with the Connexoon, which is already activated in the Connexoon system.)

Sorry guys for the delay, I’m currently on business trip. @EdwinH @tpx01 can you look this comment from @slesinger Somfy Tahoma Official API. My PR is compatible with the next HA release, so you have to take an older version.

The good news is @balloob approved my component. The sad news is I have to write some unit test to be merged in the main branch. I have to find free time to create them. We are really close from the final version :slight_smile:

@kbe Glad to see it works for you too. I hope Somfy will update their API to integrate more devices. Perhaps the more we use it, the more they will invest on it.

1 Like

Almost there (I hope). I got to the stage where I authorise Home Assistant to access my Somfy account. No errors wrt uri but it does time out as it is not getting a reponse in time from http://<LOCAL_HA_IP>:8123 (site cannot be reached). As the IP is a local one, this doesn’t surprise me. What am I doing wrong here?

It doesn’t matter if the address is local or remote. This is resolved by your browser and not by somfy server.
So here, you run HA on the same machine where your browser is opened? Can you try to set the callback address to an ip like http://192.168.1.12?

Good news! My component has been merged into the dev branch. Finally :tada:

7 Likes

Many congratulations to you. You made so hard work to be compliant with HA requirements !
I was tired to read answers from code reviewers :rofl:
This will be a very good news for Somfy, hope they will add more and more components soon.
:champagne: :champagne: :champagne: :champagne: :champagne:

I have HA running on a RP3. So the browser is not opened on the same machine as where HA is running. Is this a probleem? I have set the callback adress to http://192.168.178.99:8123 but without success.

Very good news. I saw a lot of error messages like:

Log Details (WARNING)

Wed Jun 12 2019 09:00:58 GMT+0200 (Mitteleuropäische Sommerzeit)   
Update of cover.rolllad15mini_zw is taking over 10 seconds

and:

Log Details (WARNING)

Wed Jun 12 2019 09:01:03 GMT+0200 (Mitteleuropäische Sommerzeit)
Updating somfy cover took longer than the scheduled update interval 0:00:15

Will it then be released with 0.95.0?

The callback URL must look like <YOUR_HOME_ASSISTANT_URL>/auth/somfy/callback

What’s you described can occur from time to time. This is not an error but a warning when Somfy is slow to answer.
I can’t confirm the release, but I think it will be the 0.95.0 yes.

My mistake, the full uri I have defined in the Somfy App is http://192.168.178.99:8123/auth/somfy/callback. the base_url in config is set to http://192.168.178.99:8123 but I have also tried with another base_url since my Home Assistant instance is also accessible from outside of my home network. Still no luck.:roll_eyes:

Ok, understood. But I saw these error messages really often (every day) but I will check how often the appear …

When you authorize Somfy, what’s the URL you are redirect to? Have you any error in the log?