yenoiwesa / homebridge-connexoon

A homebridge plugin to integrate Somfy blinds with the Connexoon RTS hub
Apache License 2.0
26 stars 2 forks source link

Failed to get device list / Resource_Access_Denied #52

Closed Kositch closed 2 years ago

Kositch commented 2 years ago

Hello,

since today I get these errors:

52F2EE02-32CC-4DC7-AE9D-D21D4B72A4B5

EE81FC2A-7163-4D20-B533-047274FE2E93

I use platform/service: Connexoon. EU based.

vandinter commented 2 years ago

same here

jdebardi commented 2 years ago

Same here. I opened a ticket with Somfy as I also cannot login to Somfy-connect or Tahoma-link web portals so appears they have a server issue. Am awaiting their response.

serifs0k commented 2 years ago

Same here also - though was able to login to manage my account at https://www.somfy.com.au/login

vandinter commented 2 years ago

looks like somfy fixed the issue, logging in automagically worked again at around 3:30am

yenoiwesa commented 2 years ago

That's great to hear @vandinter. Can somebody else confirm so that I close this issue?

Thanks!

JulianLiu commented 2 years ago

Still experiecing same issue (Resource_Access_Denied) here, will report back once it recoverd

serifs0k commented 2 years ago

Still getting same error.

Kositch commented 2 years ago

Still getting error, not sure if they banned my account for retries and if so, how long is the wait period for unbanning :-)

[04/05/2022, 10:26:49] [Connexoon] Failed to get device list {
  errorCode: 'RESOURCE_ACCESS_DENIED',
  error: 'Too many attempts with an invalid token, temporarily banned.'
}
Kositch commented 2 years ago

Is there a way to stop plugin trying to log in without need to disable the plugin and loose all the corresponding devices in Homekit?

yenoiwesa commented 2 years ago

Nope currently there is no way to prevent the plugin from trying to login every 5 minutes if it hasn't managed to initialise.

Kositch commented 2 years ago

OK, lets see, if they will unban the account and it will resolve the issue or if the issue is somewhere else. I have changed the email address for login to something x@xxx so it will not try to login to my account.

yenoiwesa commented 2 years ago

Yeah I think that might be a good option @Kositch. I never implemented that flow thinking the server would be down and the server banning excessive requests that end up in login failures. Might be worth having a mechanism that just stops sending request for a while if it receives 'Too many attempts with an invalid token, temporarily banned.' but then what would be the logic for that? We don't know how long these bans are set for.

Kositch commented 2 years ago

Yes, now we do not know if the issue is resolved on server side and there is only "temporary ban" issue or if they changed something as before on server side and plugin needs to be changed :/

yenoiwesa commented 2 years ago

Maybe you could test if https://github.com/dubocr/homebridge-tahoma gives you the same error?

Kositch commented 2 years ago

Yes, also not possible to login...

At least we know how long is the ban :)

[04/05/2022, 11:06:00] [TaHoma] API client will be locked for 60 hours because of bad credentials or temporary service outage. You can restart plugin to force login retry.
[04/05/2022, 11:06:00] [TaHoma] API client will be locked for 60 hours because of bad credentials or temporary service outage. You can restart plugin to force login retry.
[04/05/2022, 11:06:00] [TaHoma] Bad credentials
[04/05/2022, 11:06:00] [TaHoma] Retry in 60 sec...
[04/05/2022, 11:06:00] UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Bad credentials".
yenoiwesa commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

Kositch commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

OK, so now I will wait and leave plugin trying to login to x@xxx.xx and after 2.5 days I will put back my email account login and will try. It would be good to know how many retries is allowed, than the logic can be set in plugin.

serifs0k commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

OK, so now I will wait and leave plugin trying to login to x@xxx.xx and after 2.5 days I will put back my email account login and will try. It would be good to know how many retries is allowed, than the logic can be set in plugin.

Along the same lines I just updated my Homebridge Connexoon config to remove my “banned” email account and it’s broken all functionality - blinds show up as “No response” in Homekit. Assume the same happened to you?

Kositch commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

OK, so now I will wait and leave plugin trying to login to x@xxx.xx and after 2.5 days I will put back my email account login and will try. It would be good to know how many retries is allowed, than the logic can be set in plugin.

Along the same lines I just updated my Homebridge Connexoon config to remove my “banned” email account and it’s broken all functionality - blinds show up as “No response” in Homekit. Assume the same happened to you?

Blinds show No response in HK from the beginning since the plugin was not able to log in - it is normal. When it will login, it should be "Online" in HK.

serifs0k commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

OK, so now I will wait and leave plugin trying to login to x@xxx.xx and after 2.5 days I will put back my email account login and will try. It would be good to know how many retries is allowed, than the logic can be set in plugin.

Along the same lines I just updated my Homebridge Connexoon config to remove my “banned” email account and it’s broken all functionality - blinds show up as “No response” in Homekit. Assume the same happened to you?

Blinds show No response in HK from the beginning since the plugin was not able to log in - it is normal. When it will login, it should be "Online" in HK.

Oh right interestingly I didn’t lose any functionality until I changed my username config in the Connexoon plugin.

Kositch commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

OK, so now I will wait and leave plugin trying to login to x@xxx.xx and after 2.5 days I will put back my email account login and will try. It would be good to know how many retries is allowed, than the logic can be set in plugin.

Along the same lines I just updated my Homebridge Connexoon config to remove my “banned” email account and it’s broken all functionality - blinds show up as “No response” in Homekit. Assume the same happened to you?

Blinds show No response in HK from the beginning since the plugin was not able to log in - it is normal. When it will login, it should be "Online" in HK.

Oh right interestingly I didn’t lose any functionality until I changed my username config in the Connexoon plugin.

So mayby your account was working and has not been banned, try to put your email back if plugin logs you in.

vandinter commented 2 years ago

This is quite interesting/ strange. I had the same issue as originally posted yesterday with exactly the same error. After a while (can’t tell right now, not at home) I also received the “banned” error. Did nothing other than checking here and posting my initial “same” response. This morning, my blinds opened again and I could see that the plugin was able to authenticate at around 3:30am although in the logs i could see the last “banned” error ten minutes before…

jdebardi commented 2 years ago

I'm still getting the banned error and I still can't log into the web portal.

Somfy support got back to me earlier saying they had an outage but all should be good again now, but clearly it's not all 100% yet.

serifs0k commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

OK, so now I will wait and leave plugin trying to login to x@xxx.xx and after 2.5 days I will put back my email account login and will try. It would be good to know how many retries is allowed, than the logic can be set in plugin.

Along the same lines I just updated my Homebridge Connexoon config to remove my “banned” email account and it’s broken all functionality - blinds show up as “No response” in Homekit. Assume the same happened to you?

Blinds show No response in HK from the beginning since the plugin was not able to log in - it is normal. When it will login, it should be "Online" in HK.

Oh right interestingly I didn’t lose any functionality until I changed my username config in the Connexoon plugin.

So mayby your account was working and has not been banned, try to put your email back if plugin logs you in.

Nope I received the same banned message in the logs - but everything still functioned. I only broke things when I removed credentials from the plug-in and restarted HB. If you want to get get everything back online quickly then renew or change your internet facing IP address as that’s obviously what they ban - worked for me and everything functions again with no more errors.

jdebardi commented 2 years ago

Oh god 60 hours... Well I guess this plugin should have the same waiting mechanism. I doubt I will get to implement this any time soon though.

OK, so now I will wait and leave plugin trying to login to x@xxx.xx and after 2.5 days I will put back my email account login and will try. It would be good to know how many retries is allowed, than the logic can be set in plugin.

Along the same lines I just updated my Homebridge Connexoon config to remove my “banned” email account and it’s broken all functionality - blinds show up as “No response” in Homekit. Assume the same happened to you?

Blinds show No response in HK from the beginning since the plugin was not able to log in - it is normal. When it will login, it should be "Online" in HK.

Oh right interestingly I didn’t lose any functionality until I changed my username config in the Connexoon plugin.

So mayby your account was working and has not been banned, try to put your email back if plugin logs you in.

Nope I received the same banned message in the logs - but everything still functioned. I only broke things when I removed credentials from the plug-in and restarted HB. If you want to get get everything back online quickly then renew or change your internet facing IP address as that’s obviously what they ban - worked for me and everything functions again with no more errors.

I have a static IP so that's not ideal for me! I guess I'll have to fully remove the plugin for 60 hours and re-add it and then re-add all the devices to HomeKit. Unless someone can tell me the URL it sends the request to so I can override it to point at 127.0.0.1 for 60 hours?

serifs0k commented 2 years ago

Yes sounds like you’ll just need to wait - I’m using a VPN client on my automation box so was easy to change IP.

vandinter commented 2 years ago

Ah! Thats a good point re/ the IP. My router is set to renew IP every night at about 03am… So probably Somfy had problems, fixed the error yesterday/ this night, I was banned but became unbanned with new IP. ThAt at least seems to explain why it automatically recovered at my end.

jdebardi commented 2 years ago

Well I've stuck and entry in /etc/hosts to point accounts.somfy.com at 127.0.0.1 which seems to be doing the trick according to the homebridge logs. I'll set a reminder for 3 days time to remove it and hopefully I'll be back in business!

yenoiwesa commented 2 years ago

I am going to close this issue as the outage is over and on the Somfy side.

I also don't intend to improve the behaviour for outage handling as I do not know the rules that Somfy is applying for IP bans.

I have myself stopped relying on the Connexoon service due to its poor reliability and long latency.

vandinter commented 2 years ago

Hi @yenoiwesa , I know this topic is closed but I am curious on how you manage your blinds now as you said “upu stoppes relyin on connexoon…”.

I love your plugin but am also not totally happy with the somfy service and for something as security related as my blinds would prefer some non cloud dependend solution.

yenoiwesa commented 2 years ago

Hey @vandinter I'm with you on these, I wanted a solution that ran locally. Here is an older issue response where I detail what I use: https://github.com/yenoiwesa/homebridge-connexoon/issues/39#issuecomment-1022600833

It's been ridiculously stable, with zero down time in more than 6 months so far.

vandinter commented 2 years ago

That’s a nice hack and I have to check it out. Tried something similar before going the “official” connexoon way wit a esp and serial transceiver but was unhappy with the signal strength - depending on where I positioned the device one blind was “deaf” and no I don’t have that big of a house ;-).

But wile looking into your solution I discovered developer.somft.com which seems to offer a way of enabling a local api on the connexoon box. Will definitely look into this as well. :-)

Thanks @yenoiwesa

yenoiwesa commented 2 years ago

@vandinter if you find a way to use the Somfy Connexoon as a local network server then I am all hears! Happy to even make a homebridge plugin for it!

vandinter commented 2 years ago

Well seems somebody found a way alteady. For the connexoon box it requires a little bit of hacking first - you need to root the device by extracting and patching the firmware. Nothing too wild and I will try it myself. Afterwards you end up with a fully local api!

https://blog.unauthorizedaccess.nl/2021/04/07/no-clouds-just-sunshine.html

yenoiwesa commented 2 years ago

That's super interesting @vandinter thanks for sharing! This does look quite involved though, more than the soldering I had to do for my custom remote hehe.

Kositch commented 2 years ago

So after 3 days I have put back correct email address to plugin config and still getting the temporary ban message, which is stranget, because ban should be for 60 hours 🤔

Kositch commented 2 years ago

Disabled plugin for 24 hours, enabled afterwards and now it works 🤷‍♂️

yenoiwesa commented 2 years ago

@Kositch I'm glad the problem is finally fixed for you. The Somfy API is very frustrating. Their rate limiting is triggered way too easily for a home automation service.