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.74k stars 30k forks source link

Freebox integration timeout when trying to connect #38062

Closed Crocmagnon closed 4 years ago

Crocmagnon commented 4 years ago

The problem

I just changed my freebox and I can't connect to my new Delta S. It worked previously with my Freebox Mini 4K.

The authorization screen never appears on the box.

I already successfully paired my phone with the companion app. It appears in the "Applications" page of the settings. There are no failed attempts logged.

I removed the .storage/freebox folder.

I use a custom port for the box remote access, the same as my previous mini 4K box. External domain is also the same.

Here's the output of http://mafreebox.freebox.fr/api_version :

box_model_name | "Freebox v7 (r1)"
api_base_url | "/api/"
https_port | xxxx
device_name | "Freebox Server"
https_available | true
box_model | "fbxgw7-r1/full"
api_domain | "xxxx.fbxos.fr"
uid | "xxxx"
api_version | "8.0"
device_type | "FreeboxServer7,1"

Environment

Problem-relevant configuration.yaml

Configured through UI.

Traceback/Error logs

Here's what I have in the logs when pressing "Submit".

Jul 22 13:46:29 architect hass[20867]: 2020-07-22 13:46:29 INFO (MainThread) [aiofreepybox.aiofreepybox] Read application authorization file
Jul 22 13:46:29 architect hass[20867]: 2020-07-22 13:46:29 INFO (MainThread) [aiofreepybox.aiofreepybox] No valid authorization file found
Jul 22 13:46:40 architect hass[20867]: 2020-07-22 13:46:40 ERROR (MainThread) [homeassistant.components.freebox.config_flow] Unknown error connecting with Freebox router at xxxx.fbxos.fr
Jul 22 13:46:40 architect hass[20867]: Traceback (most recent call last):
Jul 22 13:46:40 architect hass[20867]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/freebox/config_flow.py", line 74, in async_step_link
Jul 22 13:46:40 architect hass[20867]:     await fbx.open(self._host, self._port)
Jul 22 13:46:40 architect hass[20867]:   File "/srv/homeassistant/lib/python3.7/site-packages/aiofreepybox/aiofreepybox.py", line 66, in open
Jul 22 13:46:40 architect hass[20867]:     self._access = await self._get_freebox_access(host, port, self.api_version, self.token_file, self.app_desc, self.timeout)
Jul 22 13:46:40 architect hass[20867]:   File "/srv/homeassistant/lib/python3.7/site-packages/aiofreepybox/aiofreepybox.py", line 124, in _get_freebox_access
Jul 22 13:46:40 architect hass[20867]:     app_token, track_id = await self._get_app_token(base_url, app_desc, timeout)
Jul 22 13:46:40 architect hass[20867]:   File "/srv/homeassistant/lib/python3.7/site-packages/aiofreepybox/aiofreepybox.py", line 181, in _get_app_token
Jul 22 13:46:40 architect hass[20867]:     r = await self._session.post(url, data=data, timeout=timeout)
Jul 22 13:46:40 architect hass[20867]:   File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/client.py", line 582, in _request
Jul 22 13:46:40 architect hass[20867]:     break
Jul 22 13:46:40 architect hass[20867]:   File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/helpers.py", line 586, in __exit__
Jul 22 13:46:40 architect hass[20867]:     raise asyncio.TimeoutError from None
Jul 22 13:46:40 architect hass[20867]: concurrent.futures._base.TimeoutError
probot-home-assistant[bot] commented 4 years ago

freebox documentation freebox source (message by IssueLinks)

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

Hey there @snoof85, @quentame, mind taking a look at this issue as its been labeled with an integration (freebox) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

Quentame commented 4 years ago

Hi !

Thanks for sharing your output of http://mafreebox.freebox.fr/api_version, I'll compare with mine (but with a Revolution) to see what I can do.

We actually uses API version 6, so maybe we should get the value from here.

evenisse commented 4 years ago

Hi, I juste tested with my freebox Delta and HA 0.113.0. All works fine. Can you try to reboot your freebox and your HA?

Crocmagnon commented 4 years ago

Rebooting the box did the trick, thanks! And sorry for the noise.