home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.61k stars 30.77k forks source link

Authentication broken with Wolf Smartset service #113492

Closed vidin453 closed 6 months ago

vidin453 commented 8 months ago

The problem

Last month something was changed on Wolf side - new mobile app. Probably they changed the protocol as well.

File "/usr/local/lib/python3.12/site-packages/wolf_smartset/wolf_client.py", line 95, in fetch_parameters desc = await self.request('get', 'api/portal/GetGuiDescriptionForGateway', params=payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/wolf_smartset/wolf_client.py", line 35, in request await self.authorize() File "/usr/local/lib/python3.12/site-packages/wolf_smartset/wolf_client.py", line 66, in authorize await self.authorize_and_session() File "/usr/local/lib/python3.12/site-packages/wolf_smartset/wolf_client.py", line 70, in authorize_and_session self.tokens = await self.token_auth.token(session) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/wolf_smartset/token_auth.py", line 39, in token raise InvalidAuth wolf_smartset.token_auth.InvalidAuth

What version of Home Assistant Core has the issue?

core-2024.2.5

What was the last working version of Home Assistant Core?

core-2024.2.5

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Wolf SmartSet Service

Link to integration documentation on our website

https://www.home-assistant.io/integrations/wolflink/

Diagnostics information

home-assistant_wolflink_2024-03-15T09-03-28.411Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 8 months ago

Hey there @adamkrol93, mind taking a look at this issue as it has been labeled with an integration (wolflink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `wolflink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign wolflink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


wolflink documentation wolflink source (message by IssueLinks)

witjojo commented 8 months ago

Hi, I have the same issue, the authentication is broken. Please help.

j3mu5 commented 8 months ago

Hello,

I suspect that Wolf is temporarily blocking the login due to frequent queries. The reasons for this assumption are

In HomeAssistant, I receive data for a short time until the service is unavailable again. Presumably my IP is blocked after a certain rate limit and is available again after a timeout. image

So is the solution to limit the number of requests? This does not seem to be possible via the front end.

vidin453 commented 8 months ago

I suspect that Wolf is temporarily blocking the login due to frequent queries. The reasons for this assumption are

  • I can't log in from my computer on the website and from my phone in the app when I'm on the home network
  • If I turn off WiFi on my phone and use mobile data, I can log in to the app without any problems. Has my IP been blocked?

In HomeAssistant, I receive data for a short time until the service is unavailable again. Presumably my IP is blocked after a certain rate limit and is available again after a timeout.

So is the solution to limit the number of requests? This does not seem to be possible via the front end.

The mobile app/browser access works fine for me from the same network, but the integration can’t connect.

drcolt commented 7 months ago

Hello, I've similar issues.

The Integration can be added, but after a few minutes all Sensors Switch to unknown state, failed to reload the integration. Anybody working on this? I'd assume we're not the only ones with issues ;-)

Br

tsgoff commented 7 months ago

Also getting the error "Invalid authentication"

Ant-Bugworks commented 7 months ago

same for me, not working anymore

tsgoff commented 7 months ago

https://www.wolf-smartset.com/ itself looks broken.

https://www.wolf-smartset.com/idsrv/.well-known/openid-configuration 429 Too Many Requests

Somehow my IP where homeassistant is running is blocked. Workaround is to change the public IP until this IP is also blocked

vidin453 commented 7 months ago

https://www.wolf-smartset.com/ itself looks broken.

https://www.wolf-smartset.com/idsrv/.well-known/openid-configuration 429 Too Many Requests

Somehow my IP where homeassistant is running is blocked. Workaround is to change the public IP until this IP is also blocked

image

Works fine for me with browser and mobile app from the same IP as HA, but HA itself can’t connect.

PS: also tried that I disabled Wolf in HA for 2 days but still can’t connect after enabled again.

AnathosN commented 7 months ago

I am experiencing the same issue and as soon as the integration turns to not available with Invalid Login I cannot login at the Smartset app or the website as well from the same network. I also cannot change my public IP from which HA accesses the Wolf API. Seems to be an issue with the rate the integration queries the API imho. I will try and check if my Wolf sales rep can give me a contact at the development team to ask if thats the reason and if there is a save query rate where the integration would not be blocked.

SDvanDeElk commented 7 months ago

I am experiencing the same issue and did some trials to narrow the topic.

When using the Wolf cloud integration from HA, a first connect to the Wolf portal succeeds and sensor data is transferred. As soon as the automatic polling for updates start (standard after 60 seconds), the smartset server blocks the IP which was used by the HA instance and all sensors become unavailable.

It is then as well not possible to connect to the smartset portal directly via webbroser when using the same IP. However, the WolfLink device is still connected and transferring data. This can be tested by logging to the smartset portal via your mobile device (not using your home WLAN) with another IP.

The blocking of the IP address is lifted after a certain amount of minutes, if no further polling requests are done by HA. It can be tested by disabling the automatic polling of the integration within the HA settings.

This behaviour so far is 100% repeatable with always the same outcome.

According to a comment by the Wolf-smartset development team in this thread (https://github.com/home-assistant/core/issues/104595), this is due to the fact that the integration is not using the right OAuth flow.

There are some recently closed issues here adressing an update to the OAuth flow for the Wolf integration and already being merged to the dev branch.

However, the most recent dev daily build I tried (date 17.03.2024) did not fix the topic. Although even the polling frequency has been increased to 90 seconds (instead of 60 sec). So it seems that the introduced fixes were not enough to get rid of the problem.

Weske90 commented 7 months ago

Why not a intergration local? with ip number and pasword. and not cloud. i have @ the moment problems with cloud login and it is not possible to local login

tsgoff commented 7 months ago

It looks like the device is only pushing the informations to the wolf-smartset Provider https://lucon-systems.de/ Already contacted them but got no reply. The wolf link pro has a modbus interface. But only to control air conditioning units.

Weske90 commented 7 months ago

if i login to my wolf heat pump air water with local IP adress i must use de password on the sticker on the Wolf link module and not the password from the cloud account.

so i can read all parameters with IP adress local i can make screenshots if im home.

i preffer to use in home assistant the local ip and not the cloud.

Weske90 commented 7 months ago

if i login to my wolf heat pump air water with local IP adress i must use de password on the sticker on the Wolf link module and not the password from the cloud account.

so i can read all parameters with IP adress local i can make screenshots if im home.

i preffer to use in home assistant the local ip and not the cloud.

vidin453 commented 7 months ago

if i login to my wolf heat pump air water with local IP adress i must use de password on the sticker on the Wolf link module and not the password from the cloud account.

so i can read all parameters with IP adress local i can make screenshots if im home.

i preffer to use in home assistant the local ip and not the cloud.

Is there any way to login with this integration locally? Unfortunately I use docker install and can't use the ism7mqtt add-on from the store :(

Weske90 commented 7 months ago

if i login to my wolf heat pump air water with local IP adress i must use de password on the sticker on the Wolf link module and not the password from the cloud account. so i can read all parameters with IP adress local i can make screenshots if im home. i preffer to use in home assistant the local ip and not the cloud.

Is there any way to login with this integration locally? Unfortunately I use docker install and can't use the ism7mqtt add-on from the store :(

i dident now that there was a intergration for locally. thats my question for official wolf intergration on home assistant. i will try ism7mqtt add-on this evening.

SDvanDeElk commented 7 months ago

Unfortunately, the ism7mqtt or ism8 addon is no option to use when restricted to running HA as docker container. Would really appreaciate a fix of the actual cloud integration.

tsgoff commented 7 months ago

Unfortunately, the ism7mqtt or ism8 addon is no option to use when restricted to running HA as docker container. Would really appreaciate a fix of the actual cloud integration.

I just tried it. Works flawlessly. Even over VPN at a remote location. You just need to make sure that the container has access to port 9092 on the ism and access to the mqtt from your homeassistant instance.

The Dockerfile is in the repo here: https://github.com/b3nn0/hassio-addon-ism7mqtt/blob/main/ism7mqtt/Dockerfile

Weske90 commented 7 months ago

Unfortunately, the ism7mqtt or ism8 addon is no option to use when restricted to running HA as docker container. Would really appreaciate a fix of the actual cloud integration.

I just tried it. Works flawlessly. Even over VPN at a remote location. You just need to make sure that the container has access to port 9092 on the ism and access to the mqtt from your homeassistant instance.

The Dockerfile is in the repo here: https://github.com/b3nn0/hassio-addon-ism7mqtt/blob/main/ism7mqtt/Dockerfile

This in home assistant add-on is not working. i use a docker container for musquitto and you can only fill in mqtt poort and no mqtt ip adress.

so its easyer that thay fix te HA intergration could and add local.

Rezessivo commented 7 months ago

I spoke with Wolf Support. The colleague immediately asked if I had a Homeassistant instance running. Apparently, the IP is blocked very quickly once you’ve loaded the integration. After an internet reconnect (with a new public IP), it works exactly once. I’ve created a workaround that functions. If there’s interest, I can check later…

tsgoff commented 7 months ago

Unfortunately, the ism7mqtt or ism8 addon is no option to use when restricted to running HA as docker container. Would really appreaciate a fix of the actual cloud integration.

I just tried it. Works flawlessly. Even over VPN at a remote location. You just need to make sure that the container has access to port 9092 on the ism and access to the mqtt from your homeassistant instance. The Dockerfile is in the repo here: https://github.com/b3nn0/hassio-addon-ism7mqtt/blob/main/ism7mqtt/Dockerfile

This in home assistant add-on is not working. i use a docker container for musquitto and you can only fill in mqtt poort and no mqtt ip adress.

so its easyer that thay fix te HA intergration could and add local.

you can create a proxy with ha-proxy or nginx to forward the port or use docker features to forward the port to HA

SDvanDeElk commented 7 months ago

I spoke with Wolf Support. The colleague immediately asked if I had a Homeassistant instance running. Apparently, the IP is blocked very quickly once you’ve loaded the integration. After an internet reconnect (with a new public IP), it works exactly once. I’ve created a workaround that functions. If there’s interest, I can check later…

Would be great if you could share your workaround!

Marijan11 commented 7 months ago

I spoke with Wolf Support. The colleague immediately asked if I had a Homeassistant instance running. Apparently, the IP is blocked very quickly once you’ve loaded the integration. After an internet reconnect (with a new public IP), it works exactly once. I’ve created a workaround that functions. If there’s interest, I can check later…

Can you share your workaround please?

Rezessivo commented 7 months ago

Workaround: (schreibe mal auf Deutsch, betrifft vermutlich sowieso in der Mehrzahl Deutsche User) geht in Einstellungen, Geräte & Dienste, Wolf Smartset Service. Dort auf die 3 Punkte oben rechts klicken und Systemoptionen anklicken. Dort die beiden Schieberegler ausschalten, damit die Integration nicht ständig falsche Anfragen sendet und eure IP geblockt wird. Aktualisieren klicken. Jetzt am besten mal die Internetverbindung neu aufbauen, damit ihr eine neue IP vom Provider bekommt. Dann nach dieser Anleitung verfahren: https://smarterkram.de/1162/ In meiner Automation starte ich dann quasi die Integration alle 15 Minuten 1x automatisch neu. Das funktioniert bisher fehlerfrei. Da ich nur den Warmwasserwert abgreife, reichen mir 15 Minuten...kann man ja mal testen, ob das auch alle 10 oder 5 Minuten läuft...

rudi-mentaer commented 7 months ago

Danke für Deinen Workarround. Das Problem ist doch, das Wolf die Kommunikation zügig unterbindet und dann die IP banned. Danach ist die IP solange gesperrt bist Du über Nacht vom Provider eine neue bekommst, oder Du manuell updatest. Mir ist nicht klar wie dieser Workarround den Ban umgehen soll...

Rezessivo commented 7 months ago

anscheinend "bombardiert" die Integration (wenn sie aktiv ist) die Wolf Server mit Anfragen. Dadurch das du die beiden Schieberegler unter Systemoptionen deaktivierst, werden keine Anfragen mehr gesendet. Wenn du dann die Integration (in meinem Falle alle 15min.) neu startest, wird nur 1x abgefragt. Das läuft bei mir jetzt seit Wochen so problemlos. Mann könnte testen das Zeitintervall, wenn gewünscht, mal auf 10 oder 5 Minuten zu reduzieren. Keine Ahnung wann Wolf die IP bannt....

rudi-mentaer commented 7 months ago

Offenbar „bombardiert“ die Integration (wenn sie aktiv ist) den Wolf Server mit Anfragen. Dadurch dass du die beiden Schieberegler unter Systemoptionen deaktivierst, werden keine Anfragen mehr gesendet. Wenn du dann die Integration (in meiner Falle alle 15min.) neu startest, wird nur 1x abgefragt. Das läuft bei mir jetzt seit Wochen so problemlos. Man könnte das Zeitintervall testen, wenn gewünscht, mal auf 10 oder 5 Minuten zu reduzieren. Keine Ahnung wann Wolf die IP bannt....

Danke

rudi-mentaer commented 7 months ago

Offenbar „bombardiert“ die Integration (wenn sie aktiv ist) den Wolf Server mit Anfragen. Dadurch dass du die beiden Schieberegler unter Systemoptionen deaktivierst, werden keine Anfragen mehr gesendet. Wenn du dann die Integration (in meiner Falle alle 15min.) neu startest, wird nur 1x abgefragt. Das läuft bei mir jetzt seit Wochen so problemlos. Man könnte das Zeitintervall testen, wenn gewünscht, mal auf 10 oder 5 Minuten zu reduzieren. Keine Ahnung wann Wolf die IP bannt....

Danke

Nochmal Danke für Deinen Workarround. Ich habe mir aus der von Dir geposteten Anleitung von Smarterkram das Shell Kommando zusammengebaut, diese in die configuration.yaml eingesetzt und rufe das über eine Automatisierung alle 15min auf -> Funktioniert. Beim testen bin ich 2,3 mal auf Neustarten gekommen, dann war die IP sofort wieder gesperrt. Ich bleibe mal bei dem Intervall von 15min. Es gibt 160 Downloads der Integration. Wenn das mehr User verwenden habe ich Angst, dass sie den Kanal auch noch dicht machen.

Viele Grüße Stef

Rezessivo commented 7 months ago

Offenbar „bombardiert“ die Integration (wenn sie aktiv ist) den Wolf Server mit Anfragen. Dadurch dass du die beiden Schieberegler unter Systemoptionen deaktivierst, werden keine Anfragen mehr gesendet. Wenn du dann die Integration (in meiner Falle alle 15min.) neu startest, wird nur 1x abgefragt. Das läuft bei mir jetzt seit Wochen so problemlos. Man könnte das Zeitintervall testen, wenn gewünscht, mal auf 10 oder 5 Minuten zu reduzieren. Keine Ahnung wann Wolf die IP bannt....

Danke

Nochmal Danke für Deinen Workarround. Ich habe mir aus der von Dir geposteten Anleitung von Smarterkram das Shell Kommando zusammengebaut, diese in die configuration.yaml eingesetzt und rufe das über eine Automatisierung alle 15min auf -> Funktioniert. Beim testen bin ich 2,3 mal auf Neustarten gekommen, dann war die IP sofort wieder gesperrt. Ich bleibe mal bei dem Intervall von 15min. Es gibt 160 Downloads der Integration. Wenn das mehr User verwenden habe ich Angst, dass sie den Kanal auch noch dicht machen.

Viele Grüße Stef

stimmt, könnte man in den Workaround auch noch mitaufnehmen....Smartset Integration komplett deaktivieren, wenn beim Testen von allem möglichen, Neustarts anstehen ..

rudi-mentaer commented 7 months ago

bei mir ist seit gestern auch mit dem Workarround Schluß :-(

Rezessivo commented 7 months ago

bei mir ist seit gestern auch mit dem Workarround Schluß :-(

glaube das lag an anderen Sachen bei Wolf Smartset. Hatte gestern auch massive Probleme...seit einigen Stunden läuft es bei mir wieder stabil....

rudi-mentaer commented 7 months ago

yip. bei mir auch wieder. Ist mir schon ein paar mal aufgefallen, wenn Wolf was an der Architektur umstellt, dann hast Du gar keinen Service mehr, meist am Wochenende. Sollten wir bei uns in der Arbeit auch so machen, würde vieles vereinfachen :-)

mtielen commented 6 months ago

There are 2 problems in the underlying lib used by this integration both have been fixed one by me and one by @torkleyy https://github.com/janrothkegel/wolf-comm

Workaround I implemented is to implement the changes manually. This makes it all working nicely again. Till the owner merges it.

Wank-ster commented 6 months ago

There are 2 problems in the underlying lib used by this integration both have been fixed one by me and one by @torkleyy https://github.com/janrothkegel/wolf-comm

Workaround I implemented is to implement the changes manually. This makes it all working nicely again. Till the owner merges it.

So, do I get that right?

If I copy your contents from here image

to here (and of course replace the existing ones) image

It should be working again?

mtielen commented 6 months ago

@Wank-ster No you need to update the underlying lib which is locate in HA Core: /usr/local/lib/python3.12/site-packages/wolf_comm

Look out at an update of HA this will be reset to the default lib and you need to do it again. Fully working version you find here: https://github.com/mtielen/wolf-comm of the lib with all the implemented code.

SDvanDeElk commented 6 months ago

@Wank-ster No you need to update the underlying lib which is locate in HA Core: /usr/local/lib/python3.12/site-packages/wolf-comm

Look out at an update of HA this will be reset to the default lib and you need to do it again. Fully working version you find here: https://github.com/mtielen/wolf-comm of the lib with all the implemented code.

Thank you very much. For me, integration works well again by manually replaceing the lib. Do you have any idea, when this might be integrated into the dev branch or latest release? As far as I understood, the original developer does not respond since years...

mtielen commented 6 months ago

I wrote the new developer of the current library @janrothkegel an email to merge the pull request and publish a new lib. If he has done that we can open an PR on HA for a new version of the lib and then it should be solved.

Wank-ster commented 6 months ago

Here's a question:

It seems that I only have python 3.11 located in usr/lib/python3.11/site-packages/ (no "/local/" !) but there is no wolf-comm folder in it.

The proposed path "/usr/local/lib/python3.12/site-packages/wolf-comm" doesn't exist starting from "/python3.12/..."

Furthermore: In the package there is a folder included which is called "wolf_comm" while the path points to "wolf-comm".

Can someone explain or help?

mtielen commented 6 months ago

Here's a question:

It seems that I only have python 3.11 located in usr/lib/python3.11/site-packages/ (no "/local/" !) but there is no wolf-comm folder in it.

The proposed path "/usr/local/lib/python3.12/site-packages/wolf-comm" doesn't exist starting from "/python3.12/..."

Furthermore: In the package there is a folder included which is called "wolf_comm" while the path points to "wolf-comm".

Can someone explain or help?

@Wank-ster Should be wolf_comm I made a typo but corrected it in my earlier post. You need to use /usr/local/lib/python3.12/site-packages/wolf_comm

Wank-ster commented 6 months ago

Here's a question: It seems that I only have python 3.11 located in usr/lib/python3.11/site-packages/ (no "/local/" !) but there is no wolf-comm folder in it. The proposed path "/usr/local/lib/python3.12/site-packages/wolf-comm" doesn't exist starting from "/python3.12/..." Furthermore: In the package there is a folder included which is called "wolf_comm" while the path points to "wolf-comm". Can someone explain or help?

@Wank-ster Should be wolf_comm I made a typo but corrected it in my earlier post. You need to use /usr/local/lib/python3.12/site-packages/wolf_comm

So in my case I really need to create every folder starting from "/python3.12", right?

Sorry for asking dumb questions but terminal is not my strong side...

mtielen commented 6 months ago

Here's a question: It seems that I only have python 3.11 located in usr/lib/python3.11/site-packages/ (no "/local/" !) but there is no wolf-comm folder in it. The proposed path "/usr/local/lib/python3.12/site-packages/wolf-comm" doesn't exist starting from "/python3.12/..." Furthermore: In the package there is a folder included which is called "wolf_comm" while the path points to "wolf-comm". Can someone explain or help?

@Wank-ster Should be wolf_comm I made a typo but corrected it in my earlier post. You need to use /usr/local/lib/python3.12/site-packages/wolf_comm

So in my case I really need to create every folder starting from "/python3.12", right?

Sorry for asking dumb questions but terminal is not my strong side...

@Wank-ster No the directory /usr/local/lib/python3.12 should already be there. If not you probably in the wrong docker container you need to make sure you are in HA one. If you use HAOS ssh into it and then use "docker exec -it homeassistant bash" This will bring you in the right container to do the changes. I'm trying to figure out how to make a more upgrade resistant fix

mtielen commented 6 months ago

@janrothkegel just gave me access and I have updated the lib now. So will open a PR to get the version changed If you want to install the new version of the lib you can use pip now as I updated it also on pypi: pip install wolf_comm==0.0.7

Wank-ster commented 6 months ago

@mtielen does the merge mean that we will have the fix anytime soon in the next HA update?

mtielen commented 6 months ago

@Wank-ster Yes it has part of the latest dev release now.

Wank-ster commented 6 months ago

@Wank-ster Yes it has part of the latest dev release now.

So I updated to the latest beta, restarted HA, restarted the OS, reconfigured the integration, but still:

image

It syncs initially and after 15-20 seconds it breaks...

image

Did I do anything wrong?

mtielen commented 6 months ago

@Wank-ster Yes it has part of the latest dev release now.

So I updated to the latest beta, restarted HA, restarted the OS, reconfigured the integration, but still:

image

It syncs initially and after 15-20 seconds it breaks...

image

Did I do anything wrong?

@Wank-ster No you didn't do anything wrong

The fix is in beta 2024.5.0b1 I just tested it.

It could be you are on a 1 hour block list at Wolf. Just disable the integration for a little over 1 hour. Then enable it again this should get you of the Wolf block list. Can also check with your mobile app that it works again if you connect from the same external ip as the integration.

vindiesel891 commented 6 months ago

Hi, can someone help me to install the package and resolv the issue? I've already use the command "pip install" from terminal. I've reboot the sistem, reconfigured the app but the issue persist. What's the correct way for resolv the issue? Thanks

mtielen commented 6 months ago

Hi, can someone help me to install the package and resolv the issue? I've already use the command "pip install" from terminal. I've reboot the sistem, reconfigured the app but the issue persist. What's the correct way for resolv the issue? Thanks

Wait till tonight version 2024.5 will be released and this will fix the issue once and for all or install the beta

vindiesel891 commented 6 months ago

Hi, can someone help me to install the package and resolv the issue? I've already use the command "pip install" from terminal. I've reboot the sistem, reconfigured the app but the issue persist. What's the correct way for resolv the issue? Thanks

Wait till tonight version 2024.5 will be released and this will fix the issue once and for all or install the beta

Ok. I’ve installed the 2024.5 a few minutes ago. I’ve remove the Wolf Smartset app and i’ve reconfigured it. The problem persist 😖 what I have to do?? Thanks