FitBit unable to authorize

Go to Parameters → System → Network

Capture d’écran, le 2023-07-05 à 06.39.22
Capture d’écran, le 2023-07-05 à 06.39.36
Capture d’écran, le 2023-07-05 à 06.39.46

Thank you Vincent,
My system (latest HAOS) is different so I have no Parameters but I was able to find System/Network so I think I got it.
Thanks again.

It is no longer necessary to load the modified component in “custom_components”. The official component is already modified to work as of 2023-07.

In my case I don’t use nabu.casa I use Duck DNS so some steps are different

Once you are all set with Duck DNS (in case you just configured it) it is recommended to restart HA.

  • Next is to update the HA internal and external URL
    Settings-> System-> Network → (Home Assistant URL)

Internet: https://CustomName.duckdns.org:8123
Local Network https://192.168.x.xxx:8123

Changing for the values corresponding to your configuration.

Once I do this, restart HA

  • Creating the Fitbit Dev App
    If you have already created it, you can edit the values if necessary

The important one is the callback url:

https://xxxx.ui.nabu.casa:8123/api/fitbit/callback
Or
https://CustomName.duckdns.org:8123/api/fitbit/callback

Note that Homeassistant displays a trailing “/” but as Peter Shortland discovered this causes an error. This return URL is without “/” at the end. Be sure to choose “Personal” for the OAuth type.

The values of “OAuth 2.0 Client ID” and “Client Secret” will be needed for the Fitbit startup process to populate the “/config/fitbit.conf” file.

  • Once we have this we can add the sensor to HA
# Example configuration.yaml entry
sensor:
  - platform: fitbit
    clock_format: 12H
    monitored_resources:
      - "body/weight"

Copied from the original from the official Fitbit settings page

  • We restart HA

  • It will ask us to enter the data of “/config/fitbit.conf”

  • As a precaution we restart HA again

  • Grant Fitbit permissions

Then comes the critical process of giving the Fitbit app permissions to HA.
We will get a tab like “URL/api/Fitbit”
important not to click the link, copy and edit it
We change the URL to have the configuration of the internal network
https://192.168.x.xxx:8123/api/Fitbit
We enter the tab and grant all the permissions we need
we give to send

and everything works! :smiley:

You can now see the new sensors defined in the entities

2 Likes