Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication #9

Closed
Palcooky opened this issue Dec 5, 2018 · 4 comments
Closed

Authentication #9

Palcooky opened this issue Dec 5, 2018 · 4 comments
Assignees
Labels

Comments

@Palcooky
Copy link

Palcooky commented Dec 5, 2018

I seem to be having an issue since yesterday. I believe its related to authentication.

The module only works every now and then. It seems to no longer authenticate my requests.

For example this morning i opened the blinds and now a few mins later i am unable do open or close anything else. When i check the config no devices are listed in the drop down.

I checked the JavaScript used and created a python script (i don't really know JavaScript) to authenticate.

I found that the first run of the code i get a 200 response, if i run it again i get 401 responses. I am curious if tahome have changed something, or if we should be using some kind of authentication tokens or such.

@taucher4000
Copy link

any update?

@nikkow
Copy link
Owner

nikkow commented Dec 13, 2018

It seems indeed that Somfy changed the API a bit. It is unfortunately a major risk when using undocumented APIs. I am currently investigating and trying to find a workaround.

OK, this is confirmed. Somfy implemented a request limit to its login API. The logic of the module must be reviewed so it doesn't trigger a new login before every call. I will work on that.

@nikkow nikkow self-assigned this Dec 13, 2018
@nikkow nikkow added the bug label Dec 13, 2018
@nikkow nikkow closed this as completed in 69a78c2 Dec 13, 2018
@nikkow
Copy link
Owner

nikkow commented Dec 13, 2018

I have pushed a fix for that "Too many requests" error. This is also published on NPM. Please update the plugin.

@FrodoVDR
Copy link

FrodoVDR commented Apr 28, 2019

I still get this error (Too many requests, try again later : login with) after the update.
In particular, the problem occurs when you want to query the light sensors regularly. In my case every 10 minutes.

I think the login of a node like this must now be done as follows (Somfy API Docs):

AUTHENTICATION

This section will detail how to authenticate to the Somfy API in order to get an access token that will allow you to perform actions through the Somfy API.

First step is to create your own client application of the Somfy API providing a name and valid Redirect URIs.

Then, you can use the following section to generate a valid access token using the Consumer key and Consumer secret generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants