Fitbit Authentication

I am not getting the Fitbit plugin authenticated.

I created the app on the Fitbit site. Added the secret key and ID in the fitbit.conf file.

Then the dashboard prompts me to authorize the app on this url: https://192.168.1.141:8123/auth/fitbit

That is strange because the IP address is the internal server address. My external address should be:
https://www.mydomain.com:8123
I got the following error from fitbit:

The app you're trying to connect did not provide valid information to Fitbit. Please report this issue to them.

Developer information: unauthorized_client - Invalid client_id

I made some progress.

I addedd base_url to the http section in the configuration.yaml file.

The app shows the correct url.
But still getting error message.

Is the client_id stored somewhere else then in the fitbit.conf file?

Fitbit is a pain to authenticate. Are you attempting to do this from the same network as the Hass system? If not make sure you do that, also if possible try to do it from the system running Hass and see if that helps.

What did you put in as a redirect URL in the fitbit site? Your external address or an internal one? If external change it to the internal address of your Hass box.

Thank for the update.
I finaly managed.

I removed the app on the Fitbit site. And created a new one.
My feedback url is not IP based but stil points to my domain.

I then opened the HA IOS App and clicked on Fitbit configuration.
On my iPhone I opened the webpage from Fitbit to confirm the security.

And voila it worked.

Thanks

I have deleted the app on Fitbit site, created a nwa one and get new Client ID and Client Secret.
Update the fitbit.conf file.
When I call the configuration site, I got error unauthorized_client - Invalid client_id and I see the old ID there!
How to really update the Fitbit credentials? The config file seems not the right place…
Thank you

Fitbit failed under 52.0 and is due to be fixed once 52.2 is released. ATM my Fitbit stats have stopped working since 52.0. I raised this issue on the HA GitHub site and has now been closed pending the 52.2 update.

Thank You for info, You save me several more hours…

1 Like

Yes. Thanks. I started to delete the app on fitbit and created a new one but could’t get it to work.
I will wait for the next release and try again to get it to work.

1 Like

Updated to 53.0 today and started over with Fitbit Authenticaton. It seemed to go through ok but I am not getting any data back into HA. Have restarted several times but nothing.

Anyone else tried it since the latest update?

Getting the following in the logs

2017-09-10 09:28:14 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform fitbit
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File “/usr/lib/python3.4/asyncio/tasks.py”, line 372, in wait_for
return fut.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/sensor/fitbit.py”, line 272, in setup_platform
if int(time.time()) - expires_at > 3600:

@tchellomello

There is a quick fix here until this is sorted

https://github.com/home-assistant/home-assistant/issues/9359

I succesfully register my Fitbit by adding the “last saving… etc” in the fitbit.conf, then remove it from there, but now nothing is showing in my HA page about the Fitbit!
My config contains almost the example provided on the site:

sensor fitbit1:
  - platform: fitbit
    clock_format: 24H
    monitored_resources:
      - "activities/heart"
      - "body/weight"
      - "activities/steps"

An error is in the log file:

2017-09-11 20:08:57 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform fitbit Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=self.hass.loop) File "/usr/lib/python3.4/asyncio/tasks.py", line 377, in wait_for return fut.result() File "/usr/lib/python3.4/asyncio/futures.py", line 275, in result raise self._exception File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/fitbit.py", line 272, in setup_platform if int(time.time()) - expires_at > 3600: TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

What to do next to get some info from my Fitbit? Thank you

You need to leave the “last_saved_at” text in the fitbit.conf file as your fitbit token gets refreshed every so often.

It works now, thank you.

I need a quicker update for the Fitbit sensor. How it could be possible to choose the update interval in the HA? I understand their 150 requests limit per hour, but I need only very few variables, may be only one - the hearth rate. I need it for something very similar to this: Dead man's switch

1 Like

I just spend A LOT of time to get the Fitbit Heart Rate into Home Assistant but I can only get the Resting Heart Rate, NOT the current heart rate. This is very annoying!
So unfortunately this is not a solution.
Does anybody know a way to get Current heart rate into HA?