Freebox device tracker

Hi,

I would like to track only some devices.
So I have enabled the freebox tracker in the configuration.yaml like this :

device_tracker:
  - platform: freebox
    host: mafreebox.free.fr
    port: 80
    new_device_defaults:
      track_new_devices: False
      hide_if_away: True

But when I do that the tracking is not working anymore. The devices are still listed and refreshed in known_devices.yaml but the status icons are not refreshed anymore on the homepage.

Any idea of the origin of the problem ?

Hey @schmurtz,

Have you specified in the known_devices.yaml which devices you want to track by setting track: true?

Hi There,

Trying to get this work with my hassbian install. Basically it works, but it keeps asking on my freebox revolution if i’m OK to associate the hassbian application every 30 seconds…

So i decided to fix the freebox platform in my config but now i have as log : get_session_token failed
I checked the host and port, everything seems to be correct.
When i fix the values in the config, there’s no popup at all on the freebox.

Could you help ?

Hey @SNoof85,

It looks like the storage of the authentication token is not done correctly. It should be saved in a file called “freebox.conf” inside the home Assistant configuration directory; could you check if there is such a file there, and if there isn’t, check if Home Assistant has write access to this directory?

@stilllman mais oui !
Thanks a lot, the file was here and i probably done something wrong with the rights on the configuration folder.I’ve deleted it and now it asked again on the freebox with the discovery and it asked only 1 time :slight_smile:
Thanks again for this quick and good answer, and also for the work done on this project.

Edit : oops, i spoke a bit fast, i see few seconds later my answer that the freebox keeps asking for auth… and in the web interface of the router i see many auth failures (because i don’t confirm the access each time…)

Edit2 : in the freebox.conf file i have :

{"app_version": "0.65", "track_id": 118, "app_id": "hass", "app_token": "E9Gkc77mKvxDsN1myLWaoM3b6A97PnQvWb4ZvZ7nzygf/bycodS+ARDmndCWwcrl", "device_name": "hassbian", "app_name": "Home Assistant"}

@SNoof85 The content of the file seems correct, so the problem probably lies elsewhere. The library used to connect to the Freebox lacks some logging to help identify the issue, I’ll try to add some and keep you posted when I do, so that we can troubleshoot the issue. In the meantime, can you tell me what version of the Freebox you have? Not sure this is very relevant, but the more info, the easier it will be to understand what is going on :slight_smile:

You’re absolutely right, i shoud have start with all details.

I’m running hassbian up to date (system & HA) on a wired raspberry pi 3 B+.
The router is a freebox revolution r1 (3.5.2 firmware), rebooted during the issue to check if it was not from the router.

As a workaround at the moment i disabled the new applications associations on the router and it’s still working (status of tracked devices are up to date since few days with this).

Hi @stilllman and thanks for your work.

I’m running 0.90.1 and I get an error each time the freebox platform is setted up.

Error setting up platform freebox
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/__init__.py", line 174, in async_setup_platform
hass, {DOMAIN: p_config})
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/freebox/device_tracker.py", line 15, in async_get_scanner
scanner = FreeboxDeviceScanner(hass.data[DATA_FREEBOX])
KeyError: 'freebox'

Let me know if I can help.

Hey, thanks for the thanks ^^

It looks like Home Assistant is trying to initialize the device tracker before initializing the Freebox component. The great @SNoof85 has made some changes a few releases ago to start implementing new features (upload/download sensors, wifi switch, etc.), maybe you haven’t updated your configuration after the breaking change? The configuration used to be

device_tracker:
      - platform: freebox
        host: foobar.fbox.fr
        port: 1234

but now it should be

freebox:
  host: foobar.fbxos.fr
  port: 1234

Let me know if this was the issue!

1 Like

:open_mouth: I didn’t even check for news in the component configuration page. Sorry…

Of course, it’s working now !

No worries, glad I could help!

Hi !
If you are running hassio, i would suggest you to use the check configuration addon before any upgrade :slight_smile: That would avoid these kind of issues if you have no time to explore all breaking changes :wink:

Hello @stilllman,
we have an issue with the mini 4k freebox.
Since my last update to 0.111.3 I’ve lost the device tracker.

2020-06-18 12:08:01 ERROR (MainThread) [homeassistant.components.upnp] Unexpected error fetching Freebox Server data: Error during async_call(), status: 500, body: <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>401</errorCode><errorDescription>Invalid Action</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>

The configuration is in the right form:

freebox:
    host: mafreebox.freebox.fr
    port: 443

Any idea?

Hmm I replaced the configuration with the external url, added all permissions to the application and now it’s working…!
Thanks for the good work btw!

If you read the docs it’s clearly stated that you have to use the API domain Wich is an external address. And FYI the integration can be configured without any yaml input. You can add freebox from the frontend.

@raomin Glad to hear you managed to fix your setup, and thanks @SNoof85 for following up

Hi everyone, @stilllman,

Does anyone know how to setup consider_home for freebox device_tracker?

1 Like

Anyone having a clue? :slight_smile:

Hi !

I don’t have anymore any freebox at home. But normally as it’s now configured via UI the consider_home should be on the options of the freebox integration. (i’m using unifi and it’s in the integration options)

But i’m not sure it is implemented on freebox device tracker platform.

Sadly no, it’s not. No options on the Freebox integration.
image