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
71.59k stars 29.91k forks source link

Cannot authorize at Tellduslive #34602

Closed berlund closed 4 years ago

berlund commented 4 years ago

The problem

Tellduslive cannot be set up via the UI because it cannot retrieve a authorization url.

In the logs I can see this

2020-04-23 19:21:08 ERROR (SyncWorker_3) [tellduslive] Failed to retrieve authorization URL: HTTPSConnectionPool(host='api.telldus.com', port=443): Max retries exceeded with url: /oauth/requestToken (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl_choose_client_version', 'unsupported protocol')])")))

The SSL handshake problem can be reproduced on the host machine while there is no problem when running it from a workstation, e.g. Mac OS X.

The host machine is running Python 3.7.3.

Environment

Home Assistant Core release with the issue: 0.108.8 Last working Home Assistant Core release (if known): Operating environment (Home Assistant/Supervised/Docker/venv): venv, Raspian Buster lite Integration causing this issue: tellduslive Link to integration documentation on our website: https://www.home-assistant.io/integrations/tellduslive/

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

tellduslive version is 0.10.10 according to the logs

probot-home-assistant[bot] commented 4 years ago

Hey there @fredrike, mind taking a look at this issue as its been labeled with a integration (tellduslive) you are listed as a codeowner for? Thanks!

berlund commented 4 years ago

Looks like HASS should talk to pa-api.telldus.com instead of api.telldus.com since the first one supports TLS 1.2 which the latter one doesn't. TLS 1.2 seems to be the default minimum TLS version on Raspian Buster.

Looks like version 0.10.10 on Github uses pa-api, i.e. the correct API while the 0.10.10 one published on PyPi uses still the old one

blueslow commented 4 years ago

I can't make a local connection to the tellstick znet v2 , global to telldus live works.. It is the authorisation that fails: homeatutomation hassio on raspberry pi 3 version 108.x -- 109.3 It has worked earlier but stopped working for several weeks.

configuration.yaml.

tellusdlive: host: 192.168.10.48 Áfter selecting the ip addres and clicking on the link to (http://192.168.10.48/api/authorize?token=b9f20977f033471eb38deb1b4d788add ) and after logging in the following comes up:

404 Not Found The path '/tellduslive/authorize' was not found.

Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 217, in call File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 61, in call File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 227, in call File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 199, in handle NotFound: (404, "The path '/tellduslive/authorize' was not found.")

The following is the excerpts of the rewritten url: http://192.168.10.48/tellduslive/authorize?janrain_nonce=2020-05-06T ......

Please look into this because going over the global telldus live i slow and sometimes error prone.

mariwing commented 4 years ago

This has worked for me until this morning. I am using local API and I am running Buster on RPI3 (no changes on that for several months). This moring I got authentication errors

Failed request: 401 Client Error: Unauthorized for url: http://192.168.x.xxx/api/devices/list?supportedMethods=915&includeIgnored=0 Failed request: 401 Client Error: Unauthorized for url: http://192.168.x.xxx/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0

blueslow commented 4 years ago

Any progress on this issue?

fredrike commented 4 years ago

We need the help from @molobrakos on this as it is a library issue..

rs443 commented 4 years ago

Yesterday this issue started for me too, same as @mariwing:

2020-05-28 06:34:14 WARNING (SyncWorker_14) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/devices/list?supportedMethods=915&includeIgnored=0
2020-05-28 06:34:14 WARNING (SyncWorker_14) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0
2020-05-28 06:34:14 WARNING (MainThread) [homeassistant.components.tellduslive] Failed request

I upgraded from hass 0.109.6 to 0.110.3 which has the above telldis version bump, but it didn't solve the issue. The issue was the same in both versions. Running Home Assistant on Docker.

Managing the components with the Telldus app works, so the Telldus is up and running without issues.

fredrike commented 4 years ago

I don't have access to the Telldus API doc for local auth. If someone can dig it up I'll have a look.

mariwing commented 4 years ago

@fredrike Is this what you are looking for? http://developer.telldus.com/tellstick-server/api.html

For the record, I ended up removing and re-adding Telldus using cloud this time and not local. Telldus gave a lot of my sensors new numberings so there was some work with gui and automations to get it back to fully working state.

fredrike commented 4 years ago

As you have a Znet i suggest that you move to https://github.com/quazzie/tellstick-plugin-mqtt-hass as then all updates will be instant.

fredrike commented 4 years ago

tellusdlive: host: 192.168.10.48 Áfter selecting the ip addres and clicking on the link to (http://192.168.10.48/api/authorize?token=b9f20977f033471eb38deb1b4d788add ) and after logging in the following comes up:

404 Not Found The path '/tellduslive/authorize' was not found.

Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 217, in call File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 61, in call File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 227, in call File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 199, in handle NotFound: (404, "The path '/tellduslive/authorize' was not found.")

The following is the excerpts of the rewritten url: http://192.168.10.48/tellduslive/authorize?janrain_nonce=2020-05-06T ......

Please look into this because going over the global telldus live i slow and sometimes error prone.

@blueslow It is very strange, I can't find any reference to /tellduslive/authorize in the HA code.

@mariwing, @rs443 Could it be that the token refresh doesn't work and we see these errors because of an expired token?

blueslow commented 4 years ago

On 2020-05-28 10:49, Fredrik Erlandsson wrote:

@blueslow https://github.com/blueslow It is very strange, I can't find any reference to |/tellduslive/authorize| in the HA code. Can I assist in some way?

As you have a Znet i suggest that you move to https://github.com/quazzie/tellstick-plugin-mqtt-hass as then all updates will be instant. @fredrike I do not have any znet nodes

For the record, I ended up removing and re-adding Telldus using cloud this time and not local. >Telldus gave a lot of my sensors new numberings so there was some work with gui and >automations to get it back to fully working state.

@marwing, For your information the renumbering have also occurred in my system back in the day when it was working locally, somwhere around hassio version 0.8.

rs443 commented 4 years ago

@fredrike It seems like mine and @mariwing's issue is not the same as @blueslow. Let me know if I should create a separate issue.

Here are some Debug information of the tellduslive component from a reboot of hass, maybe it is helpful.

2020-05-28 10:22:36 INFO (MainThread) [homeassistant.setup] Setting up tellduslive
2020-05-28 10:22:36 INFO (MainThread) [homeassistant.setup] Setup of domain tellduslive took 0.0 seconds.
2020-05-28 10:22:36 INFO (SyncWorker_18) [tellduslive] tellduslive version 0.10.11
2020-05-28 10:22:36 ERROR (SyncWorker_18) [tellduslive] Failed to refresh access token: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/refreshToken
2020-05-28 10:22:37 DEBUG (SyncWorker_39) [tellduslive] Request http://10.0.0.50/api/devices/list {'supportedMethods': 915, 'includeIgnored': 0}
2020-05-28 10:22:37 WARNING (SyncWorker_39) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/devices/list?supportedMethods=915&includeIgnored=0
2020-05-28 10:22:37 DEBUG (SyncWorker_39) [tellduslive] Request http://10.0.0.50/api/sensors/list {'includeValues': 1, 'includeScale': 1, 'includeIgnored': 0}
2020-05-28 10:22:37 WARNING (SyncWorker_39) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0
2020-05-28 10:22:37 WARNING (MainThread) [homeassistant.components.tellduslive] Failed request
2020-05-28 10:22:53 DEBUG (SyncWorker_14) [tellduslive] Request http://10.0.0.50/api/devices/list {'supportedMethods': 915, 'includeIgnored': 0}
2020-05-28 10:22:53 WARNING (SyncWorker_14) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/devices/list?supportedMethods=915&includeIgnored=0
2020-05-28 10:22:53 DEBUG (SyncWorker_14) [tellduslive] Request http://10.0.0.50/api/sensors/list {'includeValues': 1, 'includeScale': 1, 'includeIgnored': 0}
2020-05-28 10:22:53 WARNING (SyncWorker_14) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0
fredrike commented 4 years ago

@fredrike It seems like mine and @mariwing's issue is not the same as @blueslow. Let me know if I should create a separate issue.

Here are some Debug information of the tellduslive component from a reboot of hass, maybe it is helpful.

2020-05-28 10:22:36 INFO (MainThread) [homeassistant.setup] Setting up tellduslive
2020-05-28 10:22:36 INFO (MainThread) [homeassistant.setup] Setup of domain tellduslive took 0.0 seconds.
2020-05-28 10:22:36 INFO (SyncWorker_18) [tellduslive] tellduslive version 0.10.11
2020-05-28 10:22:36 ERROR (SyncWorker_18) [tellduslive] Failed to refresh access token: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/refreshToken
2020-05-28 10:22:37 DEBUG (SyncWorker_39) [tellduslive] Request http://10.0.0.50/api/devices/list {'supportedMethods': 915, 'includeIgnored': 0}
2020-05-28 10:22:37 WARNING (SyncWorker_39) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/devices/list?supportedMethods=915&includeIgnored=0
2020-05-28 10:22:37 DEBUG (SyncWorker_39) [tellduslive] Request http://10.0.0.50/api/sensors/list {'includeValues': 1, 'includeScale': 1, 'includeIgnored': 0}
2020-05-28 10:22:37 WARNING (SyncWorker_39) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0
2020-05-28 10:22:37 WARNING (MainThread) [homeassistant.components.tellduslive] Failed request
2020-05-28 10:22:53 DEBUG (SyncWorker_14) [tellduslive] Request http://10.0.0.50/api/devices/list {'supportedMethods': 915, 'includeIgnored': 0}
2020-05-28 10:22:53 WARNING (SyncWorker_14) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/devices/list?supportedMethods=915&includeIgnored=0
2020-05-28 10:22:53 DEBUG (SyncWorker_14) [tellduslive] Request http://10.0.0.50/api/sensors/list {'includeValues': 1, 'includeScale': 1, 'includeIgnored': 0}
2020-05-28 10:22:53 WARNING (SyncWorker_14) [tellduslive] Failed request: 401 Client Error: Unauthorized for url: http://10.0.0.50/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0

You need to reauthenticate..

blueslow commented 4 years ago

@fredrike if you have determined that the issues are different then I suggest that you create a separate issue.

Is there a way to enable logging when local authentication is done?

If so, where do I find the log?

On 2020-05-28 12:49, Fredrik Erlandsson wrote:

@fredrike <https://github.com/fredrike> It seems like mine and
@mariwing <https://github.com/mariwing>'s issue is not the same as
@blueslow <https://github.com/blueslow>. Let me know if I should
create a separate issue.

Here are some Debug information of the tellduslive component from
a reboot of hass, maybe it is helpful.

|2020-05-28 10:22:36 INFO (MainThread) [homeassistant.setup]
Setting up tellduslive 2020-05-28 10:22:36 INFO (MainThread)
[homeassistant.setup] Setup of domain tellduslive took 0.0
seconds. 2020-05-28 10:22:36 INFO (SyncWorker_18) [tellduslive]
tellduslive version 0.10.11 2020-05-28 10:22:36 ERROR
(SyncWorker_18) [tellduslive] Failed to refresh access token: 401
Client Error: Unauthorized for url:
http://10.0.0.50/api/refreshToken 2020-05-28 10:22:37 DEBUG
(SyncWorker_39) [tellduslive] Request
http://10.0.0.50/api/devices/list {'supportedMethods': 915,
'includeIgnored': 0} 2020-05-28 10:22:37 WARNING (SyncWorker_39)
[tellduslive] Failed request: 401 Client Error: Unauthorized for
url:
http://10.0.0.50/api/devices/list?supportedMethods=915&includeIgnored=0
2020-05-28 10:22:37 DEBUG (SyncWorker_39) [tellduslive] Request
http://10.0.0.50/api/sensors/list {'includeValues': 1,
'includeScale': 1, 'includeIgnored': 0} 2020-05-28 10:22:37
WARNING (SyncWorker_39) [tellduslive] Failed request: 401 Client
Error: Unauthorized for url:
http://10.0.0.50/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0
2020-05-28 10:22:37 WARNING (MainThread)
[homeassistant.components.tellduslive] Failed request 2020-05-28
10:22:53 DEBUG (SyncWorker_14) [tellduslive] Request
http://10.0.0.50/api/devices/list {'supportedMethods': 915,
'includeIgnored': 0} 2020-05-28 10:22:53 WARNING (SyncWorker_14)
[tellduslive] Failed request: 401 Client Error: Unauthorized for
url:
http://10.0.0.50/api/devices/list?supportedMethods=915&includeIgnored=0
2020-05-28 10:22:53 DEBUG (SyncWorker_14) [tellduslive] Request
http://10.0.0.50/api/sensors/list {'includeValues': 1,
'includeScale': 1, 'includeIgnored': 0} 2020-05-28 10:22:53
WARNING (SyncWorker_14) [tellduslive] Failed request: 401 Client
Error: Unauthorized for url:
http://10.0.0.50/api/sensors/list?includeValues=1&includeScale=1&includeIgnored=0
|

You need to reauthenticate..

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/34602#issuecomment-635265953, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUOERXMBE4JSUOW6PFS5MLRTY6TBANCNFSM4MPKFMYQ.

rs443 commented 4 years ago

@fredrike It did the trick!

  1. Removed Telldus Live from the Integration Page.
  2. Restarted hass.
  3. Setup the integration again and reauthenticated for 1 year (and selected auto-reauthenticate).

Everything is running as normal again.

fredrike commented 4 years ago

@fredrike It did the trick!

  1. Removed Telldus Live from the Integration Page.
  2. Restarted hass.
  3. Setup the integration again and reauthenticated for 1 year (and selected auto-reauthenticate).

Everything is running as normal again.

I wonder what happens 2021-05-28...

blueslow commented 4 years ago

@fredrike I have now updated to HassOS 4.10 , Supervisor 227, Hassio and Home Assistant 0.111.2.

Removed Telldus Live from the Integration Page. Restarted hass. Setup the integration again to local node (192.168....) and reauthenticated for 1 year (and selected auto-reauthenticate).

Executed filter to remove old entities. Reassigned areas.

Everything is running as normal again.

fredrike commented 4 years ago

Removed Telldus Live from the Integration Page. Restarted hass. Setup the integration again to local node (192.168....) and reauthenticated for 1 year (and selected auto-reauthenticate).

It would be interesting to see what happened (with debugging on) in the logs if you set it to one day. The code should renew token but I'm not sure if that have been tested.

Executed filter to remove old entities. Reassigned areas.

Everything is running as normal again.

Great! Perhaps we can close this issue then (and we will talk again in a year).

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check 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.

MaxwellErnst commented 9 months ago

04 Not Found The path '/tellduslive/authorize' was not found.

Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 217, in call File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 61, in call File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 227, in call File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 199, in handle NotFound: (404, "The path '/tellduslive/authorize' was not found.")

I get it authorize when I used another webbrowser (firefox) and had the power removed to the Telldus for 10 minutes.

jbentzer commented 9 months ago

I also succeeded in getting HomeAssistant authorized using Firefox, after failing with Chrome and Safari with the error 'The path '/tellduslive/authorize' was not found' as described above. I did not power the Telldus device off and on.

TSA3000 commented 9 months ago

I also succeeded in getting HomeAssistant authorized using Firefox, after failing with Chrome and Safari with the error 'The path '/tellduslive/authorize' was not found' as described above. I did not power the Telldus device off and on.

I tried Firefox and it worked

haraldhh commented 9 months ago

I removed the power from my Tellstick Znet Live v2, and then it actually presented the authentication page, but I still get the page with "04 Not Found The path '/tellduslive/authorize' was not found."

Does the Znet v2 actually support local API?

1bjornj commented 9 months ago

I removed the power from my Tellstick Znet Live v2, and then it actually presented the authentication page, but I still get the page with "04 Not Found The path '/tellduslive/authorize' was not found."

Does the Znet v2 actually support local API?

I was experiencing same, and I had to use firefox or safari. Brave, edge and google chrome was showing 404.

Alexander-Thor commented 1 week ago

Safari solved the authorize issue for me too. Thanks 1bjornj!