iMicknl / ha-tahoma

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

CozyTouch is not working anymore due to login API changes (3.0) #589

Closed Quentame closed 3 years ago

Quentame commented 3 years ago

Did you read the instructions?

The problem

After updating the app to 3.0.0, I opened it and then some kind of update proccess are beeing made to my account (maybe also the bridge I guess).

Here is the app release note (sorry in French even when trying to for the language to Englich):

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

2.8.0

What version of Home Assistant Core has the issue?

core-2021.9.6

Which gateway / hub do you use?

Cozytouch

Device model

unknown

Home Assistant log

Logger: custom_components.tahoma
Source: helpers/update_coordinator.py:227
Integration: Overkiz (by Somfy)
First occurred: 10:36:25 (1 occurrences)
Last logged: 10:36:25

Authentication failed while fetching device events data: Bad credentials

I did not get better logs after setting log level to debug

Additional information

Before the installation of the update, the hub firmware version was 2021.3.4

iMicknl commented 3 years ago

What's new

Your customer account evolves, it becomes simpler and more convenient! Benefit from a single identifier between our different services.

Your e-mail address becomes your unique identifier for Cozytouch and your customer account. For new users, account creation has been simplified. You no longer need to add a Cozytouch bridge to create an account.

See you soon in Cozytouch!

Thanks for reporting, @Quentame! I can imagine that this is similar to what Nexity is doing, where we were able to overcome this limitation, but it required some work... We will investigate.

steve41200 commented 3 years ago

I try for the first time your integration for Rexe (Econnect2)l, and he won't connect. I have login or password incorrect. I don't know if it is due to the same problem. I have a new heater IO (I have plug a zigbeeswitch behind the other), but him is in a bathroom and I will give a shot to your integration. I will try again and give you return of my try

steve41200 commented 3 years ago

I have an old VM for trying a long time ago with Homebridge on it (and plug in Tahoma and it will always works to control Rexel Box via HA, the login and pass are good. The plug in is not update since long time) I have try to a long time ago via Node Red with Overkill node directly, but I don't found them, I've erase them I think...

iMicknl commented 3 years ago

@steve41200 best would be to create a new issue, since the CozyTouch situation is a bit different. Happy to help you in a new issue. I think you are the first Rexel user to test this out.

uowis commented 3 years ago

I have delete a Sauter Account to recreate a Atlantic account to resolve same probleme. ... And i have lost energy consumption data

Hankey71 commented 3 years ago

hello, I accidentally updated the application and therefore my cozytouch bridge. The ha-tahoma integration no longer works. I can no longer connect. Do you have a temporary solution while it is time to fix the problem?

jugla commented 3 years ago

Hello, I have update the cozytouch app to version 3.0.0 . Same as @Quentame and @Hankey71 , the ha-tahoma integration no longer works :-(

Thanks in advance for your work !

iMicknl commented 3 years ago

I haven't had time yet to dive in to it. You can help by trying to capture the requests they do on login (e.g. with Proxyman or another proxy/MITM tool).

You can join our Discord as well, to work all together to tackle this ;-).

iMicknl commented 3 years ago

It seems that @davidbonan already figured this out, we will see if we can easily support this as well. (cc @tetienne)

It is a pity that CozyTouch and Nexity are all moving to different login methods. Apparently CozyTouch is using a JWT token, where Nexity is using the SSO token. We need to see if we can support all of this within our OverKiz client, or if we just use this a first time, to create a secondary Overkiz account.

context: https://github.com/dubocr/overkiz-client/pull/3/files

davidbonan commented 3 years ago

@iMicknl It's not me but geogeocutcut did this fix on its plugin for jeedom and i adapted it for homebridge.

iMicknl commented 3 years ago

It seems Android has been updated as well, I will try to add support for new CozyTouch this week.

iMicknl commented 3 years ago

Could you give https://github.com/iMicknl/ha-tahoma/archive/refs/heads/feature/support_custom_authentication.zip a try? Extract this file and place custom_components/tahoma in your custom_components folder.

This should fix the CozyTouch issue, however this hasn't been tested yet. Looking forward to hear your results.

jugla commented 3 years ago

Great !! the authentification has worked :-) NB: I notice that the integration has taken some time to set up in HomeAssistant

iMicknl commented 3 years ago

@jugla that is indeed because of the development build, this will be faster when it is officially released. Let me know if you run into any errors eventually.

Quentame commented 3 years ago

Confirmed working on my side too.

darthmamour commented 3 years ago

Could you give https://github.com/iMicknl/ha-tahoma/archive/refs/heads/feature/support_custom_authentication.zip a try? Extract this file and place custom_components/tahoma in your custom_components folder.

This should fix the CozyTouch issue, however this hasn't been tested yet. Looking forward to hear your results.

work for me! thanks!

jugla commented 3 years ago

Hello, no error at all during this day :-)

YomoShitsu commented 3 years ago

Hello , I tried to extract files and put them into tahoma folder but same result for me....

image

iMicknl commented 3 years ago

@YomoShitsu did you update your CozyTouch app to 3.0 and are you able to login there? Please double check your credentials.

YomoShitsu commented 3 years ago

@iMicknl Absolutely !

I am able to login on Cozytouch app in 3.0 on iOS.

image

I had disconnect and reconnect on it and no problem.

image

The only thing I can say is that I created Cozytouch account in version 3.0 And my password has 14 characters only with upper and lower cases an numbers. Not special characters

So I don't know what's happened...

hewittd commented 3 years ago

Could you give https://github.com/iMicknl/ha-tahoma/archive/refs/heads/feature/support_custom_authentication.zip a try? Extract this file and place custom_components/tahoma in your custom_components folder.

This should fix the CozyTouch issue, however this hasn't been tested yet. Looking forward to hear your results.

Working again, many thanks for the support - much appreciated :)

YomoShitsu commented 3 years ago

@hewittd we agree that I had to put all files present in ha-tahoma-feature-support_custom_authentication folder in custom_components/tahoma ? Without erase all files ?

Quentame commented 3 years ago

@hewittd we agree that I had to put all files present in ha-tahoma-feature-support_custom_authentication folder in custom_components/tahoma ? Without erase all files ?

Nope, as said here https://github.com/iMicknl/ha-tahoma/issues/589#issuecomment-940495377

Here are the steps:

  1. remove your current [ha_dir]/custom_components/tahoma folder
  2. unzip ha-tahoma-feature-support_custom_authentication.zip
  3. copy the ha-tahoma-feature-support_custom_authentication/custom_components/tahoma folder
  4. paste in [ha_dir]/custom_components folder
YomoShitsu commented 3 years ago

Shame on me.......

It works for me ! Many many thanks !!!

browetd commented 3 years ago

Working for me too ! Thanks !!!!

fritanga commented 3 years ago

I can confirm it's working nicely with my heatpump water heater :) Thanks for the super fast workaround :)

pod31 commented 3 years ago

Great news. A new version with this fix is scheduled quickly I suppose? Thanks ageain for your work in this great integration :)

iMicknl commented 3 years ago

Great news. A new version with this fix is scheduled quickly I suppose? Thanks ageain for your work in this great integration :)

Depends on your definition of quickly 😉. We will work on integrating the new login methods for CozyTouch and Nexity in a nice way, thu this can take some time. This was just a quick workaround for now, however keep an eye on this issue and our changelogs.

gtblaurent commented 3 years ago

bonjour, je n'arrive pas a faire fonctionné mon cozytouch avec cette méthode je pense que je dois mal faire une manipulations j'ai remplacé le dossier tahoma par le tahoma dans l'extraction mais j'ai toujours email ou mot de passe incorrect le cozytouch et bien en version 3.0

hello, I can't get my cozytouch to work with this method I think I must do something wrong I replaced the tahoma folder with the tahoma in the extraction but I still have the wrong email or password on the cozytouch and good in version 3.0

pod31 commented 3 years ago

Same here

bonjour, je n'arrive pas a faire fonctionné mon cozytouch avec cette méthode je pense que je dois mal faire une manipulations j'ai remplacé le dossier tahoma par le tahoma dans l'extraction mais j'ai toujours email ou mot de passe incorrect le cozytouch et bien en version 3.0

Pareil de mon côté I have this error stacktrace 👍 Traceback (most recent call last): File "/config/custom_components/tahoma/config_flow.py", line 84, in async_step_user return await self.async_validate_input(user_input) File "/config/custom_components/tahoma/config_flow.py", line 48, in async_validate_input await client.login() File "/usr/local/lib/python3.9/site-packages/pyhoma/client.py", line 116, in login jwt = await self.cozytouch_login() File "/usr/local/lib/python3.9/site-packages/pyhoma/client.py", line 160, in cozytouch_login if token["token_type"] != "bearer": KeyError: 'token_type'

iMicknl commented 3 years ago

@gtblaurent please post in English, since not everyone here speaks French. (You can use a translate engine if you want).

Thanks for sharing your stacktrace @pod31, we will have a look. Currently the error handling isn't great yet, that's why it isn't released yet.

gtblaurent commented 3 years ago

@iMicknl hello, I can't get my cozytouch to work with this method I think I must do something wrong I replaced the tahoma folder with the tahoma in the extraction but I still have the wrong email or password on the cozytouch and good in version 3.0

browetd commented 3 years ago

@gtblaurent did you follow the steps described in the post from @Quentame (see previous post).

gtblaurent commented 3 years ago

@browetd , yes, I followed the steps after I put back the tahoma folder which is in the archive in "custom_components"

iMicknl commented 3 years ago

@gtblaurent, would you be able to work with me via Discord (iMick #1903) so we can speed up the development? Easiest would be if you could temporary change your password and send your credentials, so I can do some live debugging on my machine.

That way I can have a look if this is indeed an issue of the integration, or just on your machine. Or you can wait until we release this broadly, instead of this preview.

gtblaurent commented 3 years ago

@iMicknl mail send

pod31 commented 3 years ago

How can we change the password until the cozytouch app is lock ? I'm not sure about my password 😬

iMicknl commented 3 years ago

I don't know, I don't own a CozyTouch device.

I hope to have the new CozyTouch implementation released after this weekend, which has been tested by multiple users.

YomoShitsu commented 2 years ago

Hello @iMicknl I'm sorry to disturb you but since I updated home assistant core in 2021.10.6, My overkiz component does not work anymore... I tried to made a rollback in 2021.10.3 (I had a backup) but same issue... I don't saw nothing in logs..... Could you help me to debug this issue please ?

Thx in advance

jugla commented 2 years ago

Hello, I think it's because there are some evolution in lower package before official release of ha-tahoma. Here in the logs 2021-10-21 19:51:20 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package git+https://github.com/iMicknl/python-tahoma-api.git@feature/add_sso_token#pyhoma==9.9.9: WARNING: Did not find branch or tag 'feature/add_sso_token', assuming revision or ref. ERROR: Command errored out with exit status 1: git checkout -q feature/add_sso_token Check the logs for full command output.

YomoShitsu commented 2 years ago

I hope official release will come as soon as possible. Thanks for logs

iMicknl commented 2 years ago

Please update to latest master :)

jugla commented 2 years ago

Thanks a lot : it works (with today's master) 👍 :-)

iMicknl commented 2 years ago

Great! We faced some other unexpected issues with Nexity, thus we didn't officially release this yet...

Stay tuned :).

YomoShitsu commented 2 years ago

Hello, Thanks @iMicknl it works in core os 2021.10.3 and core os 2021.10.6 For logger :

logger: default: critical logs: custom_components.tahoma: debug

Is that better to enable logs on debug or on error ?

Another point :

I saw that your component refresh sensor temperature all 10 minutes. But what about refresh of setting climate temperature ?

Regards

tetienne commented 2 years ago

@YomoShitsu debug log are a log more verbose. It’s useful to enable them when you are in trouble and want to open an issue. Otherwize, you can keep change it to error.

I saw that your component refresh sensor temperature all 10 minutes. But what about refresh of setting climate temperature ? I don’t understand your question. If you set the temperature, the command is immediately send to the server.

YomoShitsu commented 2 years ago

At my home the command is not send immediately to the server (it takes 10 minutes...) If I manually modifiy climate temperature in the physical box at my home it takes a long time to be updated in home assistant

tetienne commented 2 years ago

If I manually modifiy climate temperature in the physical box at my home it takes a long time to be updated in home assistant This one I can get it. And if it’s like the Somfy thermostat, it’s perhaps because they only send us the event 10 min later.

About setting (and not getting) the target temperature, we immediately send the command.

But please, go on our Discord, it’s off topic here.

YomoShitsu commented 2 years ago

Ok thx