Overkiz API and Somfy API

ok, and delete login from conf.yaml? And what domain in const.py?

it works, I left the config.yaml somfy settings, deleted the original files, and now it works.

I am trying to get this integration working, but I am stuck at the step where I authenticate HAss to Somfy.

When I click the link in the “Authenticate Somfy” I am getting the following error:

{"error":"redirect_uri_mismatch","error_description":"The redirect URI provided does not match registered URI(s)."}

The URI I set up in my Somfy Dev account is
http://xxx.xxx.x.xx:8123/auth/somfy/callback
Where xxx.xxx.x.xx is the local IP of my Hass.io installation.

My Hass.io installation is not accessible via the internet, only locally. Some help and guidance would be great!

The log displays this error, by the way:
Error doing job: Exception in callback <function EventBus.async_listen_once..onetime_listener at 0x70264858>
Traceback (most recent call last):
File “uvloop/cbhandles.pyx”, line 64, in uvloop.loop.Handle._run
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 626, in onetime_listener
self._hass.async_run_job(listener, event)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 333, in async_run_job
target(*args)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/person/init.py”, line 342, in person_start_hass
self.person_updated()
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/person/init.py”, line 363, in person_updated
self._update_state()
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/person/init.py”, line 374, in _update_state
for entity_id in self._config.get(CONF_DEVICE_TRACKERS, []):
TypeError: ‘NoneType’ object is not iterable

When you click on Configure, can you copy the link (right click>copy link address), and extract the value of the parameter redirect_uri ? It must look like http%3A%2F%2F192.168.1.79%3A8123%2Fauth%2Fsomfy%2Fcallback. You can decode this string using https://meyerweb.com/eric/tools/dencoder/. If the value you get and the value you set within Somfy dev app are the same, it can be a temporary issue. I got the same few days ago. The day after it was ok.

About the log error, it’s not related to this component, but to the person one.

Hi @tetiene . Thanks for your reply. I double checked and the links are the same.

Decoded link:
http://192.168.2.25:8123/auth/somfy/callback

Somfy dev app callback link:
http://192.168.2.25:8123/auth/somfy/callback

I’d be happy to share my screen with teamviewer or something for more insight… :slight_smile:

I will continue with you by PM.

Hello, first thanks for working on this project @tetienne, I look forward to seeing what cool things I can do with it.

I’ve installed on HA and have got the message “New devices discovered”
image
But when I click on “check it out” I get the following
image
and clicking configure just gives me a submit button image

I’ve tried in Firefox and Chrome, and turned off my plugins but I seem to be missing something. Any ideas would be welcome.

Justin

Are you sure it’s related to this Somfy component? Can you see Somfy in the list of the available integrations? If you click on the associated configure link, do you have the same behavior? Did you copy all the files of the somfy folder?

Thanks for the reply, I’m assuming this is related to the Somfy component because that’s what I’m trying to set up at the moment, however as nothing says Somfy I can’t be 100% sure. Somfy is not in the list of available integrations, I assumed that would happen once I’d clicked on configure. I’ve got 4 files in my /config/custom_components/somfy folder:
init.py (with the underscores)
config_flow.py
const.py
cover.py

I followed @koomik’s guide.
I’m using HomeAssistant 88.2 in Docker

It seems you forgot the translation folder. So it can explain why you have no text :wink:

That would explain it! I can’t see a guide to adding a translations folder, I’m guessing I add .translations to the somfy folder but what files do I put inside? Sorry if I’ve missed something obvious :exploding_head:

As indicated by @koomik, you just have to copy the whome somfy folder from my repo. The translations are already present.

Oh yes, the answer was there all along! I don’t think I got enough sleep last night.

Thanks very much for your help!

Hello Tetienne,

thanks a lot for all your efforts to develop and support this API. I think I had to overcome every single obstacle that was mentioned here in this thread before I got the somfy api to work. But now I am happy that I can see the 12 covers.

I also have 5 RTS power sockets (switches), one i/o power switch, two light sensors, one temperature sensor, one movement sensor and several opening sensors for the windows (my friend owns a somfy shop :wink: )

So I am very anxious for somfy to extend their API and very exited to see how your API module develops.

Thanks again

R

1 Like

Hopefully you said your friend owns a Somfy shop otherwise I would say you are crazy to buy so many devices :open_mouth: Glad to see it works for you too, and you don’t discover new issue :slight_smile: Once my component include in HA, I will relaunch their support to know their next move. Apparently, they seems to work on it, I got no more 500 or 401 error.

Today I received error as below, token expired?
Wed Mar 06 2019 10:14:37 GMT+0100 (CET)

Error setting up entry for somfy
Traceback (most recent call last):
File “/Users/robertp/.homeassistant/deps/lib/python/site-packages/requests_oauthlib/oauth2_session.py”, line 395, in request
http_method=method, body=data, headers=headers)
File “/Users/robertp/.homeassistant/deps/lib/python/site-packages/oauthlib/oauth2/rfc6749/clients/base.py”, line 198, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

And you can not use the component anymore?

Yes, component is disabled.

I have the same problem, it looks like API key just dropped out from account perspective.

Please check under your account (https://accounts.somfy.com/) in API client menu whether you have the same information as in your development page (https://developer.somfy.com/user/me/apps).

Second part of the exception:

oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

For me it looks like they have some database related issue. I have seen this issue one month ago, that time the only solution was to create a complete new API key … now I am waiting whether they can restore it or not.

Indeed, it seems Somfy has trouble. I’ve tried to redo the integration, but I got an exception on their side. So, we have to wait they fix it :frowning: This is not the first time.

OK, so we are waiting.
They have many other problems too.
For example I have a switch light withmy gate opener which is wrongly represented in Somfy app. I was informed by Somfy Helpdesk that app has an error and it might be fixed in the future.