core: Freebox : ClientConnectorError while setup when router is in bridge mode

The problem

I switched my freebox to bridge mode. The freebox integration stopped working from this instant. I tried to create a new fresh configuration but I doesn’t work anymore.

What is version of Home Assistant Core has the issue?

core-2021.5.5

What was the last working version of Home Assistant Core?

core-2021.5.5

What type of installation are you running?

Home Assistant Container

Integration causing the issue

freebox

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Nothing in the logs.
But this error message when I click "Soumettre" :
 Erreur inconnue: veuillez réessayer plus tard

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 20 (2 by maintainers)

Most upvoted comments

Not stale, I’ll try to fix that

I workaround the problem by having a valid IPv6 address, so that XXX.fbxos.fr:YYYY is done through IPv6. curl --cacert Freebox_ECC_Root_CA.pem -v4 https://XXXX.fbxos.fr:YYYY fails but curl --cacert Freebox_ECC_Root_CA.pem -v6 https://XXXX.fbxos.fr:YYYY succeeds. In bash, I needed to specify the ROOT CA (as shown above) but home assistant seems to already accept it (to be double checked as I did lots of tests before finding the correct way). The PEM can be obtained from https://dev.freebox.fr/sdk/os/#https-access

However, there was still another problem. Even with an IPv6 address reachable from the internal network, the home assistant code calls get_hosts_list from the freebox_api package. However, in bridge mode, the freebox answers:

File "/usr/local/lib/python3.11/site-packages/freebox_api/api/lan.py", line 64, in get_hosts_list
    return await self._access.get(f"lan/browser/{interface}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/freebox_api/access.py", line 122, in get
    return await self._perform_request(self.session.get, end_url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/freebox_api/access.py", line 114, in _perform_request
    raise HttpRequestError(err_msg)
freebox_api.exceptions.HttpRequestError: Request failed (APIResponse: {"msg": "Erreur lors de la r\u00e9cup\u00e9ration de la liste des h\u00f4tes : Interface invalide", "success": false, "error_code": "nodev"})

So, I needed to comment-out the await fbx.lan.get_hosts_list() line in config_flow.py and to replace fbx_devices: list[dict[str, Any]] = await self._api.lan.get_hosts_list() by fbx_devices: list[dict[str, Any]] = [] in router.py (better fixes to be found here, but it seems ok that in bridge mode, no list of hosts exists)

Still up

Following documentation: https://dev.freebox.fr/sdk/os/# and trying at home, we should access the API internally (especially when in bridge) through url like http://mafreebox.freebox.fr/api/v4/login/

Documentation says: Building the API request URL

Once you’ve discovered a Freebox on the local network you can access the API at the following URL:

https://[api_domain]:[freebox_port]/[api_base_url]/v[major_api_version]/[api_url]

or for local access

https://mafreebox.freebox.fr/[api_base_url]/v[major_api_version]/[api_url]

But does not solve the problem for now …

@JigSawFr don’t think any changes related to this issue has been made