Fitbit Integration Authentication Instructions?

Hey, everyone. Trying to setup the Fitbit Integration and I’m running into a couple of issues:

  • I’m running Hassio on a Raspberry Pi 3B+ with the Let’s Encrypt add-on for SSL
  • I’m port-forwarding my 443 port on my router to port 8123 for Home Assistant
  • I’ve created the fitbit app setting the callback to my public domain over the https protocol
  • Right-clicking into the permissions screen, everything shows up correctly, I authorize Home Assistant
  • When redirected to the callback URL I get a 500 API error. The logs mention oauthlib.oauth2.rfc6749.errors.InvalidClientError as the exception getting thrown.

This sounds like a bug with Home Assistant, the Fitbit component and newly created Fitbit apps, but I wanted to check if you guys have any ideas.

Thanks!

Did you manage to solve it? I am having exact same problem.

No, unfortunately not, haven’t received a reply yet so I’m stuck for now. I can only confirm the issue is still present on 0.86.

Same issue here. I’ve asked in the Discord but didn’t get an answer.

Are we all using Hassio based installations? So far I’m guessing that either the HA Fitbit platform is broken/incompatible with newly created Fitbit apps, or this is an error due to how HA is run on Hassio. I’m planning on trying out a Hassbian installation one of these days and see if the error is replicated on that environment as well.

I use hassio, on RPI3, but that shouldn’t matter really.

Since december, there is an open issue on github for fitbit… Not sure if it’s relevant…

But maybe you can write your comments there, so it gets some traction.

The comment just above yours on that thread is actually mine :slight_smile: But I’ll give that thread a bump as well shortly, hopefully we catch the eye of a HA developer.

1 Like

I’m going to attempt the workaround mentioned in the 2nd comment on that bug report using this method: Editing Component Files in Hassio

I’ll let you know if I have any luck with this.

@p1ranha I was actually able to authorize Fitbit successfully using a custom component. I’ve posted the steps on the Github thread, let me know if you need any help in getting things up and running.

3 Likes

That’s great. Do I only need to add the fitbit.py file in custom components and that’s it?

@jegormeister + restart HA after adding the file. If everything went well, you should see a message in the logs that you are running a custom component that was not tested by the HA team.

You should then be able to proceed and authorize Fitbit.

@andreimarinescu I managed to get it working yesterday. Thank you very much for the fix and help!

Hey man, could you tell me how you get it to work, i have no more hair left trying to deal with this.

thanks

Hey there. Did you take a look on the Github post referenced above? I’ve posted each step that’s needed there. Let me know if you’re stuck on any of them or what the specific issue you’re seeing is and I’ll try to help out as much as possible.

Sorry for the late reply, thanks your custom component worked. thanks a million

1 Like

I still can’t get this working.
I did the following stept to get this working:

  • Created a folder named ‘fitbit’ in my ‘custom_components’ folder

  • Copied the file from Github as ‘sensor.py’ in this folder.

  • Added the following to my ‘configuration.yaml’:

    - platform: fitbit
      clock_format: 24H
      monitored_resources:
        - "activities/distance"
        - "activities/heart"
        - "activities/steps"
        - "activities/tracker/distance"
        - "activities/tracker/steps"
        - "devices/battery"
    
  • Rebooted HA

  • Made a new application at dev.fitbit.com

  • Copied the Fitbit-ClientID and Fitbit-ClientSecret to the freshly created fitbit.conf

  • Rebooted HA

  • — I don’t see a message about an unsupported custom component in the LOGS!!

  • Tried to authorize the Fitbit app

  • Sadly no succesful authorization: 500 Internal Server Error…

Which step did I forgot?

HA version: 155
Hass.io : HassOS 2.11

1 Like

Did you solve this or gave up? I have the same 500 response (it is just the last bit of the installation):

image

And this is what I see in the log:

Solved by chosing ALL options and not only some - then it goes through

Which version did you use for the Fitbit-component?

I just gave up…

Did you get it working? I did and refreshed my installation today do to changes in hassio 0.102