nikkow / node-red-contrib-tahoma

Node-RED module to control a Somfy Tahoma box (Roller shutters...). Used for home automation flows.
Apache License 2.0
19 stars 11 forks source link

no connection. #46

Open Gerard-Oedzes opened 3 years ago

Gerard-Oedzes commented 3 years ago

Would love to use this!

Create an app: no problem. Enter the API key and secret: no problem. hit the button: link node-red to tahoma:

An error has occurred Please try again. If the problem persists, please contact our technical support team.

n300home commented 3 years ago

I've absolutely the same issue here. :(

n300home commented 3 years ago

I tested a little bit around and compared differences between this Node and other Web-Apps using somfy open API. The only obvious difference for me is, that the other App escapes special characters like / to HTML-kompatible string.

e.g.: This node-red Node generates the redirect_URL like this ->

redirect_uri=http://ccu3-webui/addons/red/somfy/callback

whereas in the other App it looks like that ->

redirect_uri=https%3A%2F%2Fapi.enterprise.apigee.com%2Fv1%2Fo%2Fsomfy%2Fapimodels%2Fsomfy-open-api%2Ftemplateauths%2Foauth_scope_or_internal%2Fcallback

panjazzon commented 3 years ago

I have the same issue. Tahoma node linked to old somfy app shows "no devices". New created app doesn't link and says:

An error has occurred Please try again. If the problem persists, please contact our technical support team.

Any solution? Is it problem on somfy side or my config?

pinkfloydFR commented 3 years ago

I have the same issue here, like Gerard-Oedzes :

Create an app: no problem. Enter the API key and secret: no problem. hit the button: link node-red to tahoma:

An error has occurred Please try again. If the problem persists, please contact our technical support team.

Error code in node js :

Cannot GET /somfy/callback&state=setup&grant_type=authorization_code

  TypeError: Cannot read property 'context' of null
    at /config/node-red/node_modules/node-red-contrib-tahoma/dist/nodes/tahoma-config.js:23:71
    at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
    at next (/opt/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/opt/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
    at /opt/node_modules/express/lib/router/index.js:281:22
    at param (/opt/node_modules/express/lib/router/index.js:354:14)
    at param (/opt/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/opt/node_modules/express/lib/router/index.js:410:3)
    at next (/opt/node_modules/express/lib/router/index.js:275:10)
frankis78 commented 3 years ago

When i think about it, i Wonder if i had simular issue befor on older nodejs . What nodejs are you running?

pinkfloydFR commented 3 years ago

node --version v14.16.0

I am running home assistant VM : OS Version: Home Assistant OS 5.12 Home Assistant Core: 2021.3.4

Node red 1.2.9 ghcr.io/hassio-addons/node-red/amd64:8.2.0

frankis78 commented 3 years ago

Try to make a callback url by using webhook.site , and copy the url to your somfy app, to see if that works instead of your local. You still need to login to your somfy account in node red, when you authorize.

pinkfloydFR commented 3 years ago

Hummm..if my domain is "https://pinkfloyd.com", i enter "https://webhook.pinkfloyd.com" as callback url is this correct ?

frankis78 commented 3 years ago

Hmm, as said im not an expert, but i have a server admin as a college that helped me at the point when i had similar issue. Then i used that a callback url i found in webhook.site, and after that i authorized. Maybe it authorized due to https? But after that , i changed it back to my local url, and it has worked ever since.

pinkfloydFR commented 3 years ago

oh ok i have misderstanding...

Testing with webhook.site, no answer at all !

frankis78 commented 3 years ago

Did you use "your unique url"? image

pinkfloydFR commented 3 years ago

yes exactly !

and now i am trying with info found here : https://developer.somfy.com/apis-docs

and for now, all my test failed with the same error as node red

ie, this NOT WORK :

https://accounts.somfy.com/oauth/oauth/v2/auth?response_type=code&client_id=**YOUR_CONSUMER_KEY**&redirect_uri=**CALLBACKURL**&state=**YOUR_UNIQUE_VALUE**&grant_type=authorization_code

i begin to believe the problem is on somfy server

EDIT : just find another people in the official somfy french support forum with exactly the same problem, post date 4 month ago, and no answer :(

Subscribed and answered at the topic, wait & see...

n300home commented 3 years ago

Some weeks ago I contacted Somfy support regarding that issue. It seems they also have issues on their site. ->


Hello,

Thank you for contacting us. It looks like the App you created from our Developer Portal is not fully synchronized in the different elements of our SI. This is a bug that we randomly face and we cannot find any fix for now. The only remaining solutions would be to make other tries: either deleting the exiting apps of your account and creating a new one or creating a new one from a different account.

Best regards

I've created a new app on Somfy Dev-Portal. But received the same error. I haven't tried to create a new login (no I don't like to reconfiger my whole Somfy environment).

kwithus commented 3 years ago

Still same issue here, anyone has a solution on hand?

pinkfloydFR commented 3 years ago

Just received answer from developper today :

============== Hello Denis,

Indeed, there is an issue with App creation on our side. Unfortunately, we cannot do much at this time and you have no other option but to wait for a fix to be released on this issue.

================

So nice from them to not apologize about a 5 month problem -_-

kwithus commented 3 years ago

Sounds like they don’t really want anyone to use this api, however thanks for your update. I contacted them today as well, maybe they need more pressure

krasnyt commented 3 years ago

Also suffering from this...

ozdeadmeat commented 2 years ago

Has this been fixed yet? I am considering buying Somfy equipment but if their Developer Portal is always offline I will take a look at other options.

pinkfloydFR commented 2 years ago

No, you can without hesitate look for another option...

kwithus commented 2 years ago

I would recommend Homematic IP, with CCU3 it works totally offline and you also can set up/down-times directly in the device, which will operate even if HA or the CCU3 breaks down