iMicknl / ha-tahoma

Custom component for Home Assistant to interact with smart devices via Somfy TaHoma or other OverKiz based API's.
MIT License
153 stars 30 forks source link

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

Closed kaczkalolo closed 2 years ago

kaczkalolo commented 3 years ago

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

Kaibob2 commented 3 years ago

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

iMicknl commented 3 years ago

@Kaibob2 this is not directly related to the reauth, see https://github.com/iMicknl/ha-tahoma/issues/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 commented 3 years ago

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

dhover commented 3 years ago

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 commented 3 years ago

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

Kaibob2 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

iMicknl commented 3 years ago

@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 commented 3 years ago

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

kaczkalolo commented 3 years ago

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 commented 3 years ago

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

SeraphimSerapis commented 3 years ago

+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 commented 3 years ago

I can't authenticate using App password...

On Tue, 19 Oct 2021 at 11:03 Tim Messerschmidt @.***> wrote:

+1 -- I re-authenticate every few days (which works fine).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/iMicknl/ha-tahoma/issues/599#issuecomment-946509440, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALII6UHNCIMVRLPLMMLPSFTUHUX6LANCNFSM5F46FMHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Pozdrawiam Kaczmarski Krystian

Wiggum127 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

platform : cozytouch

RienduPre commented 3 years ago

Same issue here, very annoying

Schermafbeelding 2021-10-26 om 13 18 38 Schermafbeelding 2021-10-26 om 13 17 30
bscheutjens commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

corrected for me using the master https://github.com/iMicknl/ha-tahoma/issues/614

iMicknl commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 🤩😍

bscheutjens commented 3 years ago

For me it just happened again for the second day in a row. I understand this is caused by the Somfy servers, but is it possible to react a bit less strict to that bad credentials exception? For example that the integration tries a second time after x time and if it still fails force the reconfigure?

iMicknl commented 3 years ago

@bscheutjens that is indeed one of the plans, however our time is limited. Someone could try to help on a fix, or just wait.

We will also contact Somfy to understand this behavior. As mentioned earlier in this thread, the other way where we were less strict, many users got ip banned a few times per month and we got many issues with that as well.

I agree that current behavior is suboptimal and it is also disturbing my own automations, however the time that we can spend on this integration is limited so please be patient all.

f7byu3e4jn commented 3 years ago

Same issue here.. Somfy integration asking to reauthenticate. After authentication, error ‘aborted’ is shown but integration works as it should. Just restarting Home Assistant also solves issue.

vincentsaluzzo commented 3 years ago

I have the same issue on my side, I haven't activated debug log but I will to it right now to see if it was exactly the same bugs.

In the case the it was also the BadCredential issue, classing this error as a ConfigEntryNotReady rather than a ConfigEntryAuthFailed if it was a success maybe one hour before could solve the issue, WDYT?

(Sorry If compltely wrong, I'm really not an expert in HA nor in Python, my last experience with both was three years ago to support EnOcean cover and I never finish my development to be in production. I'm just trying to help solving the issue)

github-actions[bot] commented 2 years ago

'There hasn't been any activity on this issue recently. Is this issue still present? Please make sure to update to the latest Home Assistant version and version of this integration to see if that solves the issue. Let us know if that works for you by adding a comment 👍. This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.'

bscheutjens commented 2 years ago

Just FYI (because I was triggered by github-actions), I haven't seen the issue in the last few weeks.

f7byu3e4jn commented 2 years ago

I also have not witnessed this issue occur in the last few weeks.

peka45 commented 2 years ago

it's seems there is another connection method on atlantic cozytouch which use altantic api For me curl --request POST 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/login' --form 'userId=xxx@xxx' --form 'userPassword=xxx' is down today

But i found on other github this method:

get access token: curl --header "Content-Type: application/x-www-form-urlencoded" --header "Authorization: Basic czduc0RZZXdWbjVGbVV4UmlYN1pVSUM3ZFI4YTphSDEzOXZmbzA1ZGdqeDJkSFVSQkFTbmhCRW9h" -d "grant_type=password&username=xxx@xxx&password=xxx" https://api.groupe-atlantic.com/token then get jwt curl --request GET --header "Authorization: Bearer access_token_here" https://api.groupe-atlantic.com/gacoma/gacomawcfservice/accounts/jwt

and finally: curl --request POST 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/login' --form 'jwt=jwt_here'

hope this helps..

(sorry for my english)

iMicknl commented 2 years ago

@peka45 this is not related to this issue. If you face issues with this integration, please create a new issue. We already implemented the new authentication method for Cozytouch/Atlantic in this integration.

dhover commented 2 years ago

Today this integration requires a reconfiguration. I am using version 2.9.4.

mstuij commented 2 years ago

I have also just got the message to reconfigurate.

Wiggum127 commented 2 years ago

same here

bscheutjens commented 2 years ago

Same for me, got the message about an hour ago. Looks like this was caused by something on Somfy side. As I wrote 6 days ago, I haven't seen it in weeks and now it happened at the same as it happened to other people.

f7byu3e4jn commented 2 years ago

same here

sweebee commented 2 years ago

Got the same issue, will probably be fixed soon:

Error fetching device events data: Server is down for maintenance.

dhover commented 2 years ago

Yes but why do we need a reconfiguration when the server is down?

iMicknl commented 2 years ago

Yes but why do we need a reconfiguration when the server is down?

Please read back in this issue, it has been explained already multiple times. TLDR: Somfy does throw a BadCredentials error when you credentials changed, however sometimes they throw this error as well when they have internal issues (e.g. just after maintenance).

For all the others, I faced the same issue indeed and we will still see if we have a better solution. I didn't have time to contact Somfy about this issue yet. For now, you don't need to respond with +1 / same issue. 😉

dhover commented 2 years ago

I understand. Thanks for your explanation.

callifo commented 2 years ago

I had this happen to me tonight, now I have two accounts with the same username. If I have both enabled, one gets ignored.

This outputs to the log,

2021-12-11 21:13:28 ERROR (MainThread) [homeassistant.components.cover] Platform tahoma does not generate unique IDs. ID rts://x-x-x/x already exists - ignoring cover.master_bedroom
2021-12-11 21:13:28 ERROR (MainThread) [homeassistant.components.cover] Platform tahoma does not generate unique IDs. ID rts://x-x-x/x already exists - ignoring cover.living_room
2021-12-11 21:13:28 ERROR (MainThread) [homeassistant.components.cover] Platform tahoma does not generate unique IDs. ID rts://x-x-x/x already exists - ignoring cover.study
2021-12-11 21:13:28 ERROR (MainThread) [homeassistant.components.cover] Platform tahoma does not generate unique IDs. ID rts://x-x-x/x already exists - ignoring cover.bedroom_3

The second one is listed as 'Not loaded'. I also cannot delete either of them, clicking the hamburger, and then Delete->OK does nothing. Even after a reboot.

mstuij commented 2 years ago

I have got the message again. But even with my correct password, I get an invalid authentication.

dhover commented 2 years ago

Same here. The integration shows "Aborted" after username/password but the connection is ok. So everything seems ok for now.

iMicknl commented 2 years ago

I had this happen to me tonight, now I have two accounts with the same username. If I have both enabled, one gets ignored.

The second one is listed as 'Not loaded'. I also cannot delete either of them, clicking the hamburger, and then Delete->OK does nothing. Even after a reboot.

@callifo please create a new issue for this one. This is not a known bug related to this issue. Could you try to remove the integration from HA entity registrry (integrations page) and than reboot and add again?

Elyahou commented 2 years ago

I also receive this messages, every few days... I need to reenter my password, and then it display aborted, but then works OK. Until I got the same message again...