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

At least one of your integrations requires reconfiguration to continue functioning. #599

Closed
1 task done
kaczkalolo opened this issue Oct 13, 2021 · 130 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@kaczkalolo
Copy link

Did you read the instructions?

The problem

Every now and then overkiz stops working and i get notification that it requires reconfiguration. When i enter credentials it says aborted.

What version of this integration (ha-tahoma) has the issue?

2.8.2

What version of Home Assistant Core has the issue?

core-2021.9.6

Which gateway / hub do you use?

Somfy Tahoma

Device model

No response

Home Assistant log

No response

Additional information

No response

@kaczkalolo kaczkalolo added the bug Something isn't working label Oct 13, 2021
@Kaibob2
Copy link

Kaibob2 commented Oct 13, 2021

Same here, never had this issue before. It appeared after upgrading to the latest version.
After reauthentication and the Aborted popup the rssi_level sensor becomes unavailable and after a HA restart everything is fine again.

@iMicknl
Copy link
Owner

iMicknl commented Oct 13, 2021

@Kaibob2 this is not directly related to the reauth, see #560.

However, we will have a look to see if we can make the reauthentication less strict, however this is due to Somfy throwing 'Bad Credentials' while they are updating their servers. Previously we didn't handle this correctly and thus many people got blocked.

@Kaibob2
Copy link

Kaibob2 commented Oct 13, 2021

I see. Then only the first sentence stays relevant :)

@dhover
Copy link

dhover commented Oct 13, 2021

Here the same problem witj version 2.8.2. Have reauthenticated for the third time in a few days.
Logfile:
2021-10-13 09:22:26 ERROR (MainThread) [custom_components.tahoma] Error fetching device events data: Cannot connect to host tahomalink.com:443 ssl:default [Connect call failed ('178.32.15.131', 443)]

@iMicknl
Copy link
Owner

iMicknl commented Oct 13, 2021

@dhover could you share your full log perhaps? I wonder if they first had a maintenance error.

@Kaibob2
Copy link

Kaibob2 commented Oct 13, 2021

I'm scanning the log file continously to pop up a persistent notification when the server is in maintenance. I can confirm, that today I only had the "Integration has to be reconfigured" entry in the notification panel without a previous maintenance error.

@iMicknl
Copy link
Owner

iMicknl commented Oct 13, 2021

Thanks, it would be great to have full logs and perhaps we need to add some extra debug information. Our current issue is that Somfy is throwing BadCredentials errors, and thus we ask to reconfigure....

except BadCredentialsException as exception:
                raise ConfigEntryAuthFailed() from exception

@dhover
Copy link

dhover commented Oct 13, 2021

In the logfile there is only one entry for this integration. Nothing else.
First I saw an error in the notifications tab. I pressed the link and I went to the integration. I had to fill in the password for my Somfy account.
The same procedure happened now about 3 to 4 times. With previous version I've never got those problems.

@dhover
Copy link

dhover commented Oct 13, 2021

I can activate the debug log for this integration if you tell be how to.

@iMicknl
Copy link
Owner

iMicknl commented Oct 13, 2021

@dhover here you can read how to activate the debug log.

With previous version I've never got those problems.

This change has been added in version 2.6.2 already, did you just update from that version? My guess would be that Somfy is throwing more errors in the last days..

My own instance had the same issue.
2021-10-12 14:31:38 ERROR (MainThread) [custom_components.tahoma] Authentication failed while fetching device events data: Bad credentials

We will try to see if we can have this less strict, however the other way we get many issues like these: https://github.com/iMicknl/ha-tahoma/issues?q=is%3Aissue+invalid+auth+.

@Kaibob2
Copy link

Kaibob2 commented Oct 13, 2021

I always install the most recent version as soon as it becomes available. The issue started appearing maybe 3 days ago.

@kaczkalolo
Copy link
Author

kaczkalolo commented Oct 13, 2021

I've seen that started before like month or two back but thought that that will be corrected as i'm not the only one that have that issue. Now that it's been there for a period of time i thought i will create an issue here...
Sorry for that.
Oh and reloading integrations does not do anything. I don't know how about restarting HAAS...

@AdmiralRaccoon
Copy link

I have the same issue, but it helps restarting HA, then reconfiguration is not necessary (at least for me)

@SeraphimSerapis
Copy link

SeraphimSerapis commented Oct 19, 2021

+1 -- I re-authenticate every few days (which works fine). Difficult to tell since when (not sure which version may have introduced this behavior).

@kaczkalolo
Copy link
Author

kaczkalolo commented Oct 19, 2021 via email

@Wiggum127
Copy link

I'm also experiencing this problem. Every few days I need to reconfigure the integration. Basically entering the password again via the HA App or Web GUI. Currently using the latest version of the integration and HA 2021.9.7

@iMicknl
Copy link
Owner

iMicknl commented Oct 19, 2021

Thanks all for reporting, we need to dive into this when we have more time.

Unfortunately this is not due to a recent update on our side, but to Somfy throwing more frequent 'BadCredentials' errors while users are using the right credentials.

@dhover
Copy link

dhover commented Oct 19, 2021

The integration has worked well for a couple of days.
This morning I got some errors:

2021-10-19 09:33:44 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.041 seconds (success: True) 2021-10-19 09:34:14 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.039 seconds (success: True) 2021-10-19 09:34:44 ERROR (MainThread) [custom_components.tahoma] Error fetching device events data: Server is down for maintenance. 2021-10-19 09:34:44 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.038 seconds (success: False) 2021-10-19 09:35:14 INFO (MainThread) [custom_components.tahoma] Fetching device events data recovered 2021-10-19 09:35:14 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.041 seconds (success: True)

After this error it starts running again. After about 1 hour the integration stops with the following lines:

2021-10-19 10:22:45 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.047 seconds (success: True) 2021-10-19 10:23:15 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.039 seconds (success: True) 2021-10-19 10:23:45 ERROR (MainThread) [custom_components.tahoma] Authentication failed while fetching device events data: Bad credentials 2021-10-19 10:23:45 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.076 seconds (success: False)

Now I have a notification in HA shown. If I press Check it out I go to the integration page. I have to reconfigure the integration.
Now it's running fine again.

@ghostsam45
Copy link

ghostsam45 commented Oct 20, 2021

same issue :
Config entry 'xxxxxxx@xxxxxx' for tahoma integration could not authenticate: Bad credentials

platform : cozytouch

@RienduPre
Copy link

Same issue here, very annoying

Schermafbeelding 2021-10-26 om 13 18 38

Schermafbeelding 2021-10-26 om 13 17 30

@bscheutjens
Copy link

I've had the same issue a few times. Last time was just a few hours ago. I'm running HA and this integration on the latest versions.

@majorhector
Copy link

Same problem here after upgrading with last version. I need to reconfigure every 2-3 days.

I don't have this problem with the official Sonfy Integra

@ghostsam45
Copy link

corrected for me using the master #614

@iMicknl
Copy link
Owner

iMicknl commented Oct 26, 2021

@ghostsam45 this is not fixed in master.

All, unfortunately this is due to a response on Somfy TaHoma server side. I am not sure why they throw this 'BadCredentials' exception this often. Last weeks have been busy, however I will try to contact Somfy and look for a fix on our side in the mean-time.

This is not related to a recent update. Version 2.6.2 already had the updated logic for the 'Reconfigure' when Somfy throws this error.

@ghostsam45
Copy link

ah ok sorry that solved my problem on the cozytouch platform

I received this email yesterday from Atlantic, sorry for the French

Cher utilisateur Cozytouch, Notre application Cozytouch a connu depuis quelques jours des problèmes de stabilité causés par une sollicitation grandissante de nos serveurs. Si cela vous a impacté, nous vous présentons toutes nos excuses pour la gêne occasionnée. Toutes nos équipes sont mobilisées pour rétablir la situation le plus rapidement possible.

@golles
Copy link

golles commented Oct 27, 2021

Sorry for the duplicate issue #624 I found it interesting to see I got the Bad credentials 2 days at almost the exact same time (10:35).

2021-10-26 10:35:53 ERROR (MainThread) [custom_components.tahoma] Authentication failed while fetching device events data: Bad credentials
2021-10-27 10:35:26 ERROR (MainThread) [custom_components.tahoma] Authentication failed while fetching device events data: Bad credentials

@Quentame
Copy link

Quentame commented Oct 27, 2021

Translation

Cher utilisateur Cozytouch, Notre application Cozytouch a connu depuis quelques jours des problèmes de stabilité causés par une sollicitation grandissante de nos serveurs. Si cela vous a impacté, nous vous présentons toutes nos excuses pour la gêne occasionnée. Toutes nos équipes sont mobilisées pour rétablir la situation le plus rapidement possible.

Dear Cozytouch user, Our Cozytouch application has experienced stability problems for a few days caused by increasing demand on our servers. If this has impacted you, we apologize for the inconvenience. All our teams are mobilized to restore the situation as quickly as possible.


So maybe the issue is temporary and caused by Somfy/Overkiz/Atlantic servers.

When we could get local control 🤩😍

@mstuij
Copy link

mstuij commented Jan 14, 2022

@mstuij this is a known issue unfortunately, the only thing you can do now is disable the integration and wait.

Yes I know but I wanted to share my experience with the fix version of this problem.

UPDATE: GOOD NEWS: I have tried another time to re-enter the credentials (I had already tried some times) and now everything is working again!

@iMicknl
Copy link
Owner

iMicknl commented Jan 14, 2022

Thanks for sharing. We are still working on a more definitive fix and try to have that in before the core release.

My own production instance is blocked as well since this morning, thus I have some feeling that we will revert the 'temporary fix' soon.

@themaninspain
Copy link

I'm afraid that I'm also banned for some time by Somfy. I have posted it on discord channel.

My covers were now for 2 hours unavailable (Somfy Tahoma app still works).

So I decided to reboot Home Assistant. Then I get the notification that some integration was not working (the ha-tahoma).

So I needed to re-enter my credentials and now I get the message: "Invalid authentication"

I also have this problem.

@lwsrbrts
Copy link

lwsrbrts commented Jan 14, 2022

After working perfectly well for a week, I am unable to log in using either the integration or the mobile app. Something tells me that Somfy is having a problem rather than it being an issue with the integration. imho.

If i navigate to the Tahomalink.com site and attempt to log in, I get a "server error" message.

The response code is a 401 but the specific error is:
{ "errorCode": "RESOURCE_ACCESS_DENIED", "error": "Cannot use JSESSIONID and bearer token in same request" }

This is their website, nothing to do with me, the integration or whichever IP I attempt to log in from. Either they've blocked the account itself and are sending an irrelevant message back rather than "you're banned" or they're having a bad day.

As mentioned, the app is also not working for me.

EDIT: I thought it worth mentioning actually that my brother works in the window covering/blind industry and happened to mention that his business has probably already sold double the amount of Somfy blind motors and controllers etc. in the last couple of months than they sold in the entirety of the previous twelve months. If that is mirrored across other resellers, Somfy will have added a lot of devices/accounts etc recently and will likely have complaints that force them to resolve the issues with their services sooner rather than later.

@vlebourl
Copy link
Collaborator

yup, Tahoma link is down here as well.

@tetienne
Copy link
Collaborator

They have some trouble currently: https://twitter.com/Somfyfr/status/1481903321858387968
That’s the correct timing to ask for a local API :D

@themaninspain
Copy link

They have some trouble currently: https://twitter.com/Somfyfr/status/1481903321858387968 That’s the correct timing to ask for a local API :D

I'll second the request for a local API

@spudje
Copy link

spudje commented Jan 14, 2022

Given this instability I really regret having bought the way overpriced Connexoon already :( (No complaint to you guys, but to Somfy)

But, I cannot temporarily disable the integration when it is in "Attention required" mode. But I guess in this mode it will also not try to login continuously, or would it?

@themaninspain
Copy link

Given this instability I really regret having bought the way overpriced Connexoon already :( (No complaint to you guys, but to Somfy)

But, I cannot temporarily disable the integration when it is in "Attention required" mode. But I guess in this mode it will also not try to login continuously, or would it?

I agree with you, I also would have chosen a different gate opener if I had know about Somfy's terrible service.
Regarding disabling the integration, I had the same issue, if you look at the integrations screen within HA config you should have the "attention required" but there will also be the Overkiz integration (shows up with the rest of your installed integrations) which you can disable

@spudje
Copy link

spudje commented Jan 14, 2022

Oh yeah indeed, thanks a lot. Has that 2nd entry been there all the time, never noticed it?

@themaninspain
Copy link

Oh yeah indeed, thanks a lot. Has that 2nd entry been there all the time, never noticed it?

No, the warning is separate from the integration itself. Once you dismiss the warning only the integration shows up.

@spudje
Copy link

spudje commented Jan 14, 2022

OK, I see, thanks once more.

@redneckdba
Copy link

Just came across this thread about replacing the somfy box with a velux klf-200 which has a local API and can also talk to somfy motors. I think, I'll give this one a try as it does not rely on a rather unstable cloud service.
https://community.home-assistant.io/t/velux-klf-200-pairing-with-somfy-io-motors-and-remotes/248075/14

@github-vincent-saluzzo
Copy link

Unfortunatelly, KLF-200 can't speak with climate sensor so it need a Connexoon box or using TaHoma just for that..

@mstuij
Copy link

mstuij commented Jan 14, 2022

What I have heard is that KLF200 also has some troubles.

I think we will have to wait till one day Somfy has added local support or you have to jailbreak your Tahoma (look at this topic)

@lwsrbrts
Copy link

For me, the mobile/phone application is now working again as is the Overkiz integration.

@iMicknl
Copy link
Owner

iMicknl commented Jan 14, 2022

Same problem for me, every day I need to re-setup the app. I've a Tahoma Switch.
If anyone have an idea.. ?

Please read this issue before you reply to it... If you would scroll up, you would have an idea why you face this.

You can find more context about the current issues in #599 (comment). We are currently testing an alternate solution and hopefully this will solve this issue..

Please don't reply to this thread with your "+1, I am facing the same issue". I would like to keep this (already way too long) issue thread open for new comments, but otherwise we will lock it again and just broadcast the news here.

@antoineguilbert
Copy link

Same problem for me, every day I need to re-setup the app. I've a Tahoma Switch.
If anyone have an idea.. ?

Please read this issue before you reply to it... If you would scroll up, you would have an idea why you face this.

You can find more context about the current issues in #599 (comment). We are currently testing an alternate solution and hopefully this will solve this issue..

Please don't reply to this thread with your "+1, I am facing the same issue". I would like to keep this (already way too long) issue thread open for new comments, but otherwise we will lock it again and just broadcast the news here.

Sorry, i've seen the message after. My comment is deleted :)

@egoward
Copy link

egoward commented Jan 15, 2022

Just did a little digging as this is a great service and problem caused my bathroom window to be left open overnight - not good given temperature and price of gas! Sharing my thoughts:

As a workaround hack, it's very easy to setup an automation that triggers "Call service" with "Home AssistantCore Integration: Restart" in the UI every day. Someone has a video talking you through that here.

Longer term, looks like the server is using an old web scheme (JSESSION) where client is unaware of token expiration time. This has now been combined with a short token lifetime so client appears to need to send username and password whenever server throws wobbly, currently set to every 24 hours. That's a bit annoying and fragile. I'd suggest increasing the timeout in the short term (maybe 7 or 24 days) , then changing to a modern auth scheme (OAuth & refresh token).

Short term, I get why it will take a few days to test the fix. Thank you and we will try to be patient :)

@iMicknl
Copy link
Owner

iMicknl commented Jan 15, 2022

@egoward you are spot on. The move to OAuth is indeed what we are currently investigating, since Somfy moved their mobile app to this login method. They didn't move tahomalink.com yet (?). However, even with OAuth it won't be ideal probably since:

  • You can only pass the auth token to the login() endpoint, which means you need to (re)register the event listener.
  • The token is valid for an hour (3600s), however in my initial tests it seems that the session will live longer.

For now, my temporary solution was to use OAuth for the login, and just relogin when we get an Unauthorized exception, just like we do now. It seems that the OAuth server is way more stable and thus BadCredentials shouldn't be thrown anymore.

It seems you are quite technical, would you like to contribute and test as well?

Update: my response above wasn't correct, you can pass the token to every endpoint, thus a normal OAuth behavior.

@egoward
Copy link

egoward commented Jan 15, 2022

Thanks @iMicknl, sounds like a great temporary solution. I am technical but pretty bad with python so my code contributions will likely not be very welcome. Very happy to take test patches on my home setup and will also see if I can get a dev HA setup going so I can be more help.

@bilak
Copy link

bilak commented Jan 17, 2022

@iMicknl with auth token isn't there also a refresh token? If so, what is the lifespan for it? In many cases (also mobile apps) uses refresh token that lasts longer than 1 hour. So in case your auth token is gone, you can still refresh it (generate new auth token) with refresh token.
I'm not an python dev, but if you point me to the code where you are doing the stuff with auth maybe I can help. I'm using python in few scripts also with oauth.

@iMicknl
Copy link
Owner

iMicknl commented Jan 17, 2022

@bilak feel free to join us on Discord to discuss development and see iMicknl/python-overkiz-api#321 for the underlying library.

And you are right, it seems possible to not use the /login endpoint to create a session, but just pass the auth bearer to every request (and thus use the refresh token as well).

@iMicknl
Copy link
Owner

iMicknl commented Jan 24, 2022

Update
We have an early test version available that could possibly fix the issues. It would be great if you could give it a try and let us know if you face any issues with the reauth message.

https://github.com/iMicknl/ha-tahoma/archive/refs/heads/enhancement/move_somfy_oauth.zip. Extract this file and place custom_components/tahoma in your custom_components folder.

@iMicknl
Copy link
Owner

iMicknl commented Jan 25, 2022

Please update to v2.12.0 and report back (in a new issue), if you face any issues. Let's close this huge and unclear issue. Thanks all for reporting and looking for workarounds.

@iMicknl iMicknl closed this as completed Jan 25, 2022
Repository owner locked as resolved and limited conversation to collaborators Jan 25, 2022
@iMicknl iMicknl unpinned this issue Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests