Hi there,
I'm using Redmatic (specialized node-red version for Homematic CCU3). My latest project is, to automate my Somfy RTS windows shutters via Somfy Tahoma.
But at the moment I'm failing to get an initial API-Token from Somfy's open API which is using OAuth2 Authorization Code Grant methode. Somfy Open API Developer Portal | APIs & Docs
I tried node-red-contrib-tahoma. But I'm unable to Link it's configuration node to my created App on API-Side. There only appears an error message in browser window after logging into API with my user. I contaced node-red-contrib-tahoma's devs via Git-Hub some weeks ago (without any response) and Somfy Support which wasn't able to help me.
2nd trial I used node-red-contrib-oauth2. Which also seems to be incompatible to Somfy's API Auth Method.
3rd: I tried it on my own flows.
I think the big problem is, that initial login to get the first token wants an interactive login prompt via browser windows (IMHO absolutely silly for automation purposes).
I tried to login first via HTTP-PUT-Request and headers "Content-Type": "application/x-www-form-urlencoded"
and payload: {
"_username": "my-Email",
"_password": "my-Passwordd",
"_remember_me": "on"
}
to get a Cookie which I can reuse for next Token-Requests. That's working so far. I can save the cookie to flow variable. But allthough I reuse this generated cookie Somfy redirects me to login page once more and here I'm stucking.
Are there any suggestions or best practices?