FitBit - support multiple devices

Having been using a custom component for about a year it has now stopped working because of updates to Home assistant meaning it is no longer found.

Both me an my wife have Fitbit and its been great to have them upload step data and report back every few hours throughout the day.

It seems strange that this hasn’t already been integrated given it was raised about 3 years ago but here we are again.

If anyone can help with this or even look to update the custom component so it works would be great.

thanks very much.
Kev

I can probably fix this. Got a link to the github repository?

I find the core integration fails to update the security token and it stops working after a month or so.

Hi, thanks for the reply.

There have been a few but I have been following these posts with the info in

Fitbit Component to support multiple Users - Feature Requests - Home Assistant Community (home-assistant.io)

Hope this helps :slight_smile:

GitHub - agners/home-assistant at fitbit-multiple-trackers

None of those link to a custom integration, that you said you were using:

If you mean this:

Go to config/custom_components/fitbit and change the manifest.json file from this:

{
  "domain": "fitbit",
  "name": "Fitbit",
  "documentation": "https://www.home-assistant.io/integrations/fitbit",
  "requirements": [
    "fitbit==0.3.1"
  ],
  "dependencies": [
    "configurator",
    "http"
  ],
  "codeowners": [
    "@robbiet480",
    "@agners"
  ]
}

to this (added a version key):

{
  "domain": "fitbit",
  "name": "Fitbit",
  "version": "1.2.3",
  "documentation": "https://www.home-assistant.io/integrations/fitbit",
  "requirements": [
    "fitbit==0.3.1"
  ],
  "dependencies": [
    "configurator",
    "http"
  ],
  "codeowners": [
    "@robbiet480",
    "@agners"
  ]
}

Restart home assistant and it should be working again.

Hi, Thanks for the suggestion.

That was my first thoughts when it happened but alas it still didnt work after adding the version.

The Home assistant just reports that it cant find the custom component despite it being there!

whether custom component is the right term, it was more that someone modified the original to work with multiple users.

Custom component is a left-over from the old days. They’re called custom (or third party) integrations now. However the directory you put them in is still called config/custom_components.

Ok, it must have other issues. The owner of that repository seems active you could try contacting him.

@agners Is there an equivalent custom component in HACS so that I can use the multiple users in the HassOS as good as this Hass.io custom integration?
Or any other workaround that I can use to mitigate the limiting capability of current fitbit integration?

Still no Joy with this!

Check out my working solution.

Fabulous thanks so much!

Have 2 Fitbits running with this now.

For reference I did have problems with the notifications not coming up to configure but foundit was because I didnt have the home assistant internal or external URLS Set. once I put these in it all sprung to life!

Glad it worked out for you! I will add some notes about the URL’s so thank you for sharing.

I changed my Github name so you can find me here now.

I updated Home Assistant and it stopped working but I was able to get it all back up in a few minutes.

Steps assuming you used the default folder & file names:

  1. Pull the fitbit1.conf and fitbit2.conf, etc. files from the /Conf folder to your local computer
  2. Pull the Fitbit folders from /Config/Custom_components to your local computers
  3. Remove the Fitbit sensors from configuration.yaml or sensor.yaml and save to your local computer
  4. Restart Home Assistant
  5. Start from step 1 in my instructions on Github. Instead of using the files on the Github use the files you pulled to your local computer. You will not need to do anything on dev.fitbit.com if you reuse your previous files.
  6. After you complete the first Fitbit account start over with the remaining Fitbit accounts.

Brian

So far mine has been working ok still!

I’ll keep you posted if I run into a problem!

Can I ask how people are handling the Fitbit data once they get it into HA?

I’ve got mine hooked up in a slightly different way - it’s set up via another Pi running a Python script and then made available via MQTT. I’ve got some simple listings of the data (daily and weekly) but I’m also curious as to how others are presenting their data in Lovelace?

Primarily I use the data for a bit of fun between me and the wife as to who did the most steps in a day. I have home assistant notify us both every 4 hours how many steps we have both done and then at 9pm it determines the winner and sends out a message to say who won.

I do log the steps inside home assistant over the week to see the patterns of both of us overlayed but its not for anything in particular other than for interest.

Interesting, thanks.

The reason I ask is as I mentioned I’m pulling in the data indirectly via another Pi and MQTT. I’ve never been able to get the HA plugin to work, primarily as I don’t have (or want) external internet access to my HA server.

The MQTT route seems to be working to a point, but there are some weird quirks in the FitBit API that I’ve had to work around. For example sleep and heart rate are entirely absent in the data from midnight until the first sync of the day, and the grouping of the data within the API per day is also rather strange in places.

Of course I’ve got complete flexibility as to how I encode the data in the Python script that’s updating the MQTT server, at least as far as I can get it out of the API.

@TheTroubleshooter, this integration has stopped working, can you please revisit this whenever you have time? Thanks a lot for your efforts.