• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Fitbit

Scheduled Pinned Locked Moved Troubleshooting
129 Posts 42 Posters 167.4k Views 37 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    bhepler Module Developer
    last edited by May 10, 2017, 7:42 PM

    @Oliver_Tooth Well, the Wife wants her FitBit stats on the mirror so I’m going to end up using this module at some point. I’ll try and catch up to you and we’ll debug this together.

    O 1 Reply Last reply May 10, 2017, 8:06 PM Reply Quote 0
    • O Offline
      Oliver_Tooth @bhepler
      last edited by May 10, 2017, 8:06 PM

      @bhepler That’d be fantastic if you could! This is a 21st birthday present due in just under a weeks time, so i’m starting to panic somewhat!

      1 Reply Last reply Reply Quote 0
      • O Offline
        Oliver_Tooth @daniel44992
        last edited by May 14, 2017, 9:43 AM

        @daniel44992 I too am having this exact issue. Did you ever find a solution?

        1 Reply Last reply Reply Quote 0
        • B Offline
          bhepler Module Developer
          last edited by May 15, 2017, 1:48 PM

          @Oliver_Tooth I was able to successfully install the Fitbit module and get it to pull information from the web API. It took a little tweaking, but I did get it to work.

          Problems I encountered:

          • Python was not installed. I had to install it and figure out how to install “pip”.
          • Fitbit doesn’t make their developer area visible off their main website. I ended up bouncing through their forums first.
          • Example config file on the module GitHub page contains errors. The character after config: should be {, not [.
          • The secret key and appID field values need to be surrounded by single quotes, something not explained in the readme file.

          Here’s the relevant portion of my config.sys file.

          {
                  module: 'MMM-fitbit',
                  position: 'bottom_left',
                  config: {
                          credentials: {
                                  client_id: '000XX0',
                                  client_secret: 'abbacadabba1234567890',
                                  },
                          resources: [
                                  'steps',
                                  'floors',
                                  'caloriesOut',
                                  'distance',
                                  'activeMinutes',
                                  'sleep',
                                  'heart'
                                  ],
                          update_interval: 60
                          }
          },
          

          When you run npm start the MMM-Fitbit python script will run and kick out a few lines in the console. I’m not entirely sure what it’s doing, but here’s what mine reads:

          Set credential request recieved.
          { client_id: '000XX0',
            client_secret: 'abbacadabba1234567890' }
          Initial run request recieved.
          Running getData.py
          results: [{"message":"credentials.ini exists","type":"status"},{"message":"Writing credentials to credentials.ini","type":"status"},{"message":"Writing id: 000XX0 and secret: abbacadabba1234567890","type":"status"},{"message":"Credentials write successful","type":"status"}]
          

          When I ran the setupAccess.py script, it failed to modify the credentials.ini file. I ended up editing it manually and plugging in my application ID and my secret key. The format is simple. Spaces before & after the = and no quotes around the ID or key.

          V O V 3 Replies Last reply May 15, 2017, 4:01 PM Reply Quote 1
          • V Offline
            Vendittelli Module Developer @bhepler
            last edited by May 15, 2017, 4:01 PM

            @bhepler Please, if you spot any problems with the documentation, create a pull request on GitHub and I’ll happily make those changes.

            1 Reply Last reply Reply Quote 1
            • O Offline
              Oliver_Tooth @bhepler
              last edited by May 15, 2017, 5:53 PM

              @bhepler That’s great news! I’ve managed to get mine up and working, but from what I can tell initially, it doesn’t seem to stay authorised for longer than a day, i’m currently browsing the python-fitbit forum for help on that. It’s also only showing data for steps, with all other fields showing 0. Is this something you’ve encountered?

              B 1 Reply Last reply May 15, 2017, 8:02 PM Reply Quote 0
              • B Offline
                bhepler Module Developer @Oliver_Tooth
                last edited by May 15, 2017, 8:02 PM

                @Oliver_Tooth Somewhat. I see steps, distance and calories. Sleep is zero. There’s definitely something going on here. I haven’t run it long enough to encounter the authorization problem. I’ll investigate further tonight.

                @Vendittelli - I’ll do that. I should have a PR for you in a couple days. Thanks for the great module!

                1 Reply Last reply Reply Quote 0
                • S Offline
                  s199
                  last edited by Jun 30, 2017, 10:56 AM

                  Hello, thank you for that nice addon…i finally managed to make it work (exemple code is still incorrect on github…) but there is a problem, im using an alta hr and i only have the “steps” info on display, everything else is set to 0 :/
                  Any idea how i can fix that ?

                  S 1 Reply Last reply Nov 16, 2017, 6:50 PM Reply Quote 0
                  • S Offline
                    Sandy2503
                    last edited by Sep 20, 2017, 3:13 PM

                    The Modul wont work on my Mirror too.
                    First:
                    In the moment i haven`t any Fitbit Hardware. I use the Fitbit -App on my WindowsPhone. I can see in the App all useful things like step etc. and the data will sync with the Fitbit webservce.
                    I can see all activitys an the Mirror with a Zero …

                    When i stop the mirror with
                    pm2 stop mm and try to start the python script setupAccess.py from the local terminal so i can see this:

                    //your code here
                    sudo python setupAccess.py
                    Get credentials from credentials.ini ? (Y/N)
                    y
                    {"message": "credentials.ini exists", "type": "status"}
                    {"message": "Reading from crentials.ini", "type": "status"}
                    {"message": "Read of credentials.ini successful.", "type": "status"}
                    [19/Sep/2017:19:30:03] ENGINE Listening for SIGHUP.
                    [19/Sep/2017:19:30:03] ENGINE Listening for SIGTERM.
                    [19/Sep/2017:19:30:03] ENGINE Listening for SIGUSR1.
                    [19/Sep/2017:19:30:03] ENGINE Bus STARTING
                    CherryPY Checker:
                    The Application mounted at '' has an empty config.
                    
                    [19/Sep/2017:19:30:03] ENGINE Started monitor thread 'Autoreloader'.
                    [19/Sep/2017:19:30:03] ENGINE Started monitor thread '_TimeoutMonitor'.
                    [19/Sep/2017:19:30:03] ENGINE Serving on http://127.0.0.1:8080
                    [19/Sep/2017:19:30:03] ENGINE Bus STARTED
                    

                    and not more - and no prompt …

                    when i now from a second terminal the mirror restart with pm2 restart mm
                    i see on the mirror only:

                    //your code here
                    ```Traceback (most recent call last):
                      File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 670, in respond
                        response.body = self.handler()
                      File "/usr/local/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 217, in __call__
                        self.body = self.oldhandler(*args, **kwargs)
                      File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 67, in __call__
                        raise sys.exc_info()[1]
                    HTTPError: (404, `Missing parameters: state`)
                    
                    CherryPy 3.8.2
                    

                    Can anyone help me to fix the problem ?

                    Greetz Sandy2503

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      stephenmelody @s199
                      last edited by Nov 16, 2017, 6:50 PM

                      @s199 I also have this problem, only Steps is coming through. Did you manage to get it fixed?

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 7
                      • 8
                      • 9
                      • 10
                      • 11
                      • 12
                      • 13
                      • 9 / 13
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy