homebridge-tahoma icon indicating copy to clipboard operation
homebridge-tahoma copied to clipboard

API Client locked

Open seven3five opened this issue 3 years ago • 27 comments

Hello. My apologies if this isn't the right forum for this or if the solution has been posted elsewhere but I received the following error.

API client locked. Please check your credentials then restart. If your credentials are valid, please wait some hours to be unbanned

I am able to log in using the Tahoma North America app but I also receive the invalid login credentials message if I attempt to log into tahomalink.com

Any suggestions would be greatly appreciated.

seven3five avatar Oct 27 '21 03:10 seven3five

Thank you for using Homebridge TaHoma plugin.

Please follow these step to obtain better support :

  1. Execute available commands (on,off,T°,mode,etc...) from official app (TaHoma/Cozytouch/etc.)
  2. Report your config by browsing https://dev.duboc.pro/tahoma
  3. Search issues with title corresponding to your device widget name (see picture below). If no opened issue, rename your issue with this widget name.
  4. Provide your bridge last 4 digits (number visible as SETUP-XXXX-XXXX-XXXX at step 2.) Widget

Thank you.

github-actions[bot] avatar Oct 27 '21 04:10 github-actions[bot]

Thank you for using Homebridge TaHoma plugin.

Please follow these step to obtain better support :

  1. Execute available commands (on,off,T°,mode,etc...) from official app (TaHoma/Cozytouch/etc.)
  2. Report your config by browsing https://dev.duboc.pro/tahoma
  3. Search issues with title corresponding to your device widget name (see picture below). If no opened issue, rename your issue with this widget name.
  4. Provide your bridge last 4 digits (number visible as SETUP-XXXX-XXXX-XXXX at step 2.) Widget

Thank you.

I've also tried this but when I enter my credentials I receive the message Bad Credentials

seven3five avatar Oct 27 '21 19:10 seven3five

Hello. For long time, your plugin worked perfectly for me and thanks for providing it. Since two weeks I am facing the already reported "API blocked" messages. So I am thinking of using IFTTT for the future - which is not perfect - but the problem is, that I don't get the actual positions of my blinds.

When I go to https://dev.duboc.pro/tahoma, I can log in with no issues and get all needed details - so my question is, is there a way to use that in a way to fetch the details programmatically ? Having that I could using webhooks to report the current status back to HomeKit.

Thanks Björn

bjdhn avatar Nov 17 '21 10:11 bjdhn

Any news ? Project seems discontinued... it seems that the client doesn't keep the token and asks for one at each call

davidXire avatar Dec 13 '21 17:12 davidXire

Bonjour Romain & team ! ;-) Same issue here, this plugin is key and worked quite fine on both TaHoma classic and TaHoma switch but for a few days this message come up on multiple installs (different homes with different internet providers, no changes on the home networks themselves): [TaHoma] API client will be locked for 6 hours because of bad credentials or temporary service outage. You can restart plugin to force login retry. When restarting, all is back to normal so could write a script triggering this error and forcing a restart but better to find out if we could have a fix on the plugin side ?

The main issue being having an inactive plugin for at least 6 hours so blinds and other stuff in the dark for this period of time: [TaHoma] API client locked. Please check your credentials then restart. [TaHoma] [Salon Sud Gauche] setClosureAndLinearSpeed API client locked. Please check your credentials then restart.

Cheeeeeeeers ! -- Patrice.

PatriceRobert avatar Dec 18 '21 08:12 PatriceRobert

I‘m having the same issue and as others like @PatriceRobert everything worked until a couple of weeks ago (and with no change in my setup). I‘m running this plugin within a child bridge and as soon as I notice the error again, I restart the child bridge and everything works again for the next couple of hours. Hoping for a fix real soon as this plugin is crucial to my setup. :-(

MirkoKas avatar Dec 26 '21 22:12 MirkoKas

Unfortunately this issue is on Somfy's side and we face the same issue with the Home Assistant integration.

https://github.com/iMicknl/ha-tahoma/issues/599#issuecomment-995825550

iMicknl avatar Dec 26 '21 23:12 iMicknl

@iMicknl thx for the heads up on the discussion for the HA integration. I was expecting a Somfy „issue“ and I just read your explanation on the problem. Hope you can figure something out with Somfy!

One thing I don’t understand though is, that the „problem“ with the HA integration is that you catch Bad credentials errors to not get blocked and require to re-enter the credentials. As far as I know from the homebridge plugin, something like this is not implemented, so I would expect that the plugin keeps retrying to login until it succeeds. But in fact it never does succeed, which I find strange.

MirkoKas avatar Dec 26 '21 23:12 MirkoKas

Is this fixed by Somfy? - at least for my setup I noticed no errors for the last 24hours+

MirkoKas avatar Dec 28 '21 23:12 MirkoKas

Looks like, I did not see any issue for the past two days or so (lazy to double check on the logs ;-) ).

PatriceRobert avatar Dec 29 '21 07:12 PatriceRobert

This issue unfortunately reappeared on my side after couple good days. Any ideas how to solve this? The Tahoma app is really bad - tried to make a shortcut with an action but to no avail.

Plexitar avatar Jan 04 '22 18:01 Plexitar

… and the issue is back for me aswell 👎

MirkoKas avatar Jan 04 '22 18:01 MirkoKas

Same here but.....always a 'but' ;-) The way I'm using homebridge on rpi is to launch as many homebridge instances as I have homebridge services so I do have a dedicated instance for TaHoma and I can easily restart the instance. Due to this, I can run a simple script tailing for logs and launching an automatic restart in case of specific regex in the logs and this is the script I now have running.

tahoma-restart.bash.txt

Of course, homebridge-tahoma is a service on the rpi running under a specific tahoma user.

-- Patrice.

PatriceRobert avatar Jan 05 '22 21:01 PatriceRobert

Same here but.....always a 'but' ;-) The way I'm using homebridge on rpi is to launch as many homebridge instances as I have homebridge services so I do have a dedicated instance for TaHoma and I can easily restart the instance. Due to this, I can run a simple script tailing for logs and launching an automatic restart in case of specific regex in the logs and this is the script I now have running.

tahoma-restart.bash.txt

Of course, homebridge-tahoma is a service on the rpi running under a specific tahoma user.

-- Patrice.

Thx for your script. i was thinking about something like that as I’m also running the TaHoma plugin within a child bridge of homebridge on my Pi .

As I’m a Linux newbie, can you give my some instructions on how to run this script regularly? Or do you have some links so I can read it through there?

I‘m running homebridge (and the child bridge) with no separate „TaHoma“ user. Is this a problem for your script?

MirkoKas avatar Jan 05 '22 22:01 MirkoKas

Here's the situation as far as I understand:

  • Somfy's API has an intermittent issue that prevents you from logging in. This has been going on for years.
  • The previous version of the plugin would try to connect over and over again, which would make Somfy's API block the IP address. The IP address would remain blocked until you didn't try to connect for multiple hours.
  • The latest version of the plugin stops reconnecting as soon as it detects the problem. It waits for 6 hours before it connects again. This is done to avoid the blocking on Somfy's side.

The main problem with the latest version is that it is just a bit too eager. Sometimes when the API gives this error, the next attempt (e.g. a few minutes later) would already work. However, the plugin no longer tries this - as soon as the error occurs even once, the plugin stops working for 6 hours to play it safe.

I believe the solution would be to find a middle ground. If we get this error, let's wait e.g. 10 minutes and try again. If we still get the error, let's wait 60 minutes. If it still fails, we can wait the whole 6 hours.

@dubocr how does that sound to you?

Edit: I just read https://github.com/iMicknl/ha-tahoma/issues/599#issuecomment-995825550 posted earlier, which seems to confirm my understanding. I'll leave my comment here with the suggested fix, though.

mhalttu avatar Jan 06 '22 06:01 mhalttu

Sorry for the delayed answer, went for a refreshing night away from home automation ;-) "Homebridge child bridge" is a good step and you will just need to find the right command to restart this specific child bridge process.

PatriceRobert avatar Jan 06 '22 06:01 PatriceRobert

Well deserved, @PatriceRobert :-)

I already got the right command for restarting child bridges here: https://github.com/homebridge/homebridge/issues/2852

But I’m not to familiar with running scripts regularly. Do you use crontab for this? If not, how do you run the script automatically? I already read that I have to make the bash file executable when downloaded. Is there anything else I have to be aware of?

MirkoKas avatar Jan 06 '22 07:01 MirkoKas

@dubocr Are you still maintaining the project? If not, do you think it would be possible to revert to the previous version? It had its issues but when it comes to this specific bug, it actually feels like the cure is worse than the disease.

mhalttu avatar Jan 07 '22 17:01 mhalttu

Well deserved, @PatriceRobert :-)

I already got the right command for restarting child bridges here: homebridge/homebridge#2852

But I’m not to familiar with running scripts regularly. Do you use crontab for this? If not, how do you run the script automatically? I already read that I have to make the bash file executable when downloaded. Is there anything else I have to be aware of?

Did not see your post, I can help but basically, this script is running in daemon mode on a rpi4 to monitor the logs.

PatriceRobert avatar Jan 07 '22 17:01 PatriceRobert

@dubocr Are you still maintaining the project? If not, do you think it would be possible to revert to the previous version? It had its issues but when it comes to this specific bug, it actually feels like the cure is worse than the disease.

You can always install an older version by adding the version string at the update command. Or more easily through Homebridge UI. What was the last version where the error handling worked better?

MirkoKas avatar Jan 07 '22 18:01 MirkoKas

You can always install an older version by adding the version string at the update command. Or more easily through Homebridge UI.

Oh, that's good to hear. I'm using HOOBS which doesn't seem to support it in the UI, but I'm sure I can figure it out. Thank you!

What was the last version where the error handling worked better?

Unfortunately, I'm not sure. I'll probably try installing the previous version and see if it helps.

mhalttu avatar Jan 08 '22 17:01 mhalttu

Hi guys,

I've made some updates regarding this workaround in the latest release 2.2.15. Sorry about my silence, I'm far from everything these latest months (crazy France, job and other projects like this one).

Hope this fix will improve.

dubocr avatar Jan 22 '22 03:01 dubocr

Merci Romain, will give it a try ! -- Patrice.

PatriceRobert avatar Jan 22 '22 07:01 PatriceRobert

Thanks for the new version! Just did the update. Did not have any issues the last days (Somfy…) but will see if it improves the error handling anyway.

MirkoKas avatar Jan 22 '22 07:01 MirkoKas

@dubocr Thank you for the update, much appreciated!

mhalttu avatar Jan 24 '22 07:01 mhalttu

Thanks a lot Romain, now everything is working fine ! Update Homebridge to 1.4.0 with Avahi advertiser and update your plugin too....;

nscheffer avatar Jan 24 '22 14:01 nscheffer

Hello,

my Homebridge has the same issue. Now I'm blocked for 960 (!) hours:

[18/05/2022, 19:04:41] [Brustor] API client will be locked for 960 hours because of bad credentials or temporary service outage. You can restart plugin to force login retry.
[18/05/2022, 19:04:41] [Brustor] Bad credentials
[18/05/2022, 19:04:41] [Brustor] [LightVar_Wh_io] off API client locked. Please check your credentials then restart.
If your credentials are valid, please wait some hours to be unbanned

I don't understand what is the issue and how it can be prevented.

Any advice?

Thanks, Stefan

UPDATE: I works again. I think it's because the new public IP-Adress of my local WiFi (every night my router re-connects to my ISP and gets a new public IP)

Stefan-83 avatar May 18 '22 18:05 Stefan-83

'There hasn't been any activity on this issue recently. Please make sure to update to the latest Homebridge TaHoma version to see if that solves the issue. This issue will be closed in case of inactivity.'

github-actions[bot] avatar Sep 04 '22 03:09 github-actions[bot]