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

Component Freebox #22993

Closed ninjax95 closed 5 years ago

ninjax95 commented 5 years ago

Hi,

I have the freebox component that does not run, I have this error message. I do not have a file created in the config directory I turn on Hassbian 0.91.3

2019-04-11 07:44:40 ERROR (MainThread) [homeassistant.setup] Error during setup of component freebox
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 151, in _async_setup_component
    hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/freebox/__init__.py", line 45, in async_setup
    await async_setup_freebox(hass, config, host, port)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/freebox/__init__.py", line 71, in async_setup_freebox
    await fbx.open(host, port)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiofreepybox/aiofreepybox.py", line 66, in open
    self._access = await self._get_freebox_access(host, port, self.api_version, self.token_file, self.app_desc, self.timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiofreepybox/aiofreepybox.py", line 124, in _get_freebox_access
    app_token, track_id = await self._get_app_token(base_url, app_desc, timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiofreepybox/aiofreepybox.py", line 181, in _get_app_token
    r = await self._session.post(url, data=data, timeout=timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/client.py", line 575, in _request
    break
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 585, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
2019-04-11 07:44:40 ERROR (MainThread) [homeassistant.core] Error doing job: Unclosed client session

Additional question, but can this component work if the freebox in bridge mode ?

Thanks

SNoof85 commented 5 years ago

Hi, Are you using a fixed configuration in configuration.yaml or are you using the discovery ?

Can you please tell me wich freebox you have, the output of this URL in your local network : http://mafreebox.freebox.fr/api_version

Did not see that you're using the bridge mode. I can't tell you if it would work with bridge mode. Did not tested it. But i guess that if you are using bridge mode you may have additional setup to do on your router.

Seems that even the offical compagnon app doesn't work with bridge mode : https://dev.freebox.fr/bugs/task/22301 At least not out of the box, you have some more setup to do...

cgtobi commented 5 years ago

Please fill out the issue template.

ninjax95 commented 5 years ago

Hi, Are you using a fixed configuration in configuration.yaml or are you using the discovery ? I use fixe configuration in configuration.yaml

freebox:
   host: xxxxxxx.fbxos.fr
  port: 303184

Can you please tell me wich freebox you have, the output of this URL in your local network : http://mafreebox.freebox.fr/api_version I have Freebox revolution,

{"box_model_name":"Freebox Server (r2)","api_base_url":"\/api\/","https_port":30318,"device_name":"Freebox Server","https_available":true,"box_model":"fbxgw-r2\/full","api_domain":"xxxxxxxx.fbxos.fr","uid":"720f99601875f27a746920671c7d9731","api_version":"6.0","device_type":"FreeboxServer1,2"}

Did not see that you're using the bridge mode. I can't tell you if it would work with bridge mode. Did not tested it. But i guess that if you are using bridge mode you may have additional setup to do on your router. Seems that even the offical compagnon app doesn't work with bridge mode : https://dev.freebox.fr/bugs/task/22301 At least not out of the box, you have some more setup to do...

I try the official compagnon with the mode bridge (I have my freebox in mode bridge and I have a independent routeur) and no problem to connect, I have all informations.

Thanks for you help

SNoof85 commented 5 years ago

Either you have a typo in your answer or you did something wrong with the port you configured ! 303184 is not valid for a port. The Freebox says it's 30318.

ninjax95 commented 5 years ago

Either you have a typo in your answer or you did something wrong with the port you configured ! 303184 is not valid for a port. The Freebox says it's 30318.

Sorry it's just a mistake when I do a copy/paste but on my configuration file the port is fine 30318

SNoof85 commented 5 years ago

Ok ! Then, just a thing to check the incoming port configuration on the Freebox. But I don't know how it's handled in bridge. As I said previously it's not a component issue but it's mostly due to your setup with bridge mode. You probably have some redirections to setup on your router.

Can you check on your Freebox the assiociated applications and also check if there's no failed associations mentionned ? On Home Assistant startup you don't have the prompt on the Freebox ?

Can you also try nmap on the freebox api endpoint to check if port 30318 is correctly opened ?

SNoof85 commented 5 years ago

Have you fixed the issue ?

stale[bot] commented 5 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.