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 201.0k 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.
    • O Offline
      olliewarren411 @Hellangel1987
      last edited by

      @Hellangel1987 Can you post the config code you’re using please?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Hellangel1987
        last edited by

        Im using your code as provided

        O 1 Reply Last reply Reply Quote 0
        • O Offline
          olliewarren411 @Hellangel1987
          last edited by

          @Hellangel1987
          Yes If possible please paste your entire config file as the error might be elsewhere

          H 1 Reply Last reply Reply Quote 0
          • H Offline
            Hellangel1987 @olliewarren411
            last edited by paviro

            @olliewarren411

            here we go

            /* Magic Mirror Config Sample
             *
             * By Michael Teeuw http://michaelteeuw.nl
             * MIT Licensed.
             */
            
            var config = {
            	port: 8080,
            
            	language: 'de',
            	timeFormat: 24,
            	units: 'metric',
            
            	modules: [
                		{
                    		module: 'MMM-FRITZ-Box-Callmonitor',
                    		position: 'top_right',  // This can be any of the regions. Best results in left or right regions.
                    		header: "Letzte Anrufe", // This is optional
                    		config: {
                        		// See 'Configuration options' for more information.
                    	}
                		},
            			{
            				module: ‘MMM-fitbit’,
            				position: ‘top_center’,
            				config: {
            				credentials: {
            				client_id: ‘123456789’,
            				client_secret: ‘123456789’,
            			},
            				resources: [
            				‘steps’,
            				‘floors’,
            				‘caloriesOut’,
            				‘distance’,
            				‘activeMinutes’,
            				‘sleep’,
            				‘heart’
            			]
            			}
            			},			
            		{
            			module: 'alert',
            		},
            		{
            			module: 'clock',
            			position: 'top_left'
            		},
            		{
            			module: 'calendar',
            			header: 'Feiertage',
            			position: 'top_left',
            			config: {
            				calendars: [
            		{
            						symbol: 'calendar-check-o ',
            						url: 'webcal://www.schulferien.org/media/ical/deutschland/ferien_bayern_2016.ics'
            		}
            				]
            		}
            		},
            		{
            			module: 'calendar',
            			header: 'Termine NetApp',
            			position: 'top_left',
            			config: {
            				calendars: [
            		{
            						symbol: 'calendar-check-o ',
            						url: '################################'
            		}
            					   ]
            		}
            		},
            		{
              			module: 'localtransport',
            			header: 'Verbindungen NBG HBF',
              			position: 'top_left',
              			config: {
                			api_key: '###########',
                			origin: 'Nuremberg Dunantstr',
                			destination: 'Nuremberg HBF'
              		}
            		},
            		{
                			module: 'MMM-Traffic',
                			header: 'Verkehr',
            			position: 'top_left',
                			classes: 'dimmed medium', //optional, default is 'bright medium', only applies to commute info not route_name
                			config: {
                    		api_key: '#############',
                    		mode: 'driving',
                    		origin: 'Nuernberg',
                    		destination: 'Muenchen',
                         		route_name: 'Route nach NetApp Muc',
            			show_summary: true,
                    		changeColor: true,
                    		showGreen: true,
                    		limitYellow: 5, //Greater than 5% of journey time due to traffic
                    		limitRed: 20, //Greater than 20% of journey time due to traffic
                    		traffic_model: 'best_guess',
                    		interval: 120000 //2 minutes
                		}
            		},
            		{
            			module: 'compliments',
            			position: 'lower_third'
            		},
            		{
            			module: 'currentweather',
            			position: 'top_right',
            			config: {
            				location: 'Nuremberg',
            				locationID: '',  //ID from http://www.openweathermap.org
            				appid: '#################'
            		}
            		},
            		{
            			module: 'weatherforecast',
            			position: 'top_right',
            			header: 'Wettervorhersage',
            			config: {
            	            		location: 'Nuremberg',
            				locationID: '2861650',  //ID from http://www.openweathermap.org
            	            		appid: '##############'
            		}
            		},
            		{
                			module: 'MMM-MovieInfo',
                			position: 'top_right',
                			config: {
                    		api_key: '#############'
                		}
            		},
                		{
                    		module: 'email',
                        		position: 'bottom_bar',
                        		header: 'Emails',
                        		config:{
                            	user: '##############',
                            	password: '#############',
                            	host: 'imap.mail.me.com',
                            	port: 993,
                            	tls: true,
                            	authTimeout: 10000,
                            	numberOfEmails: 5,
                            	fade: true
                    	}
                		},
            		{
            			module: 'newsfeed',
            			position: 'bottom_bar',
            			config: {
            				feeds: [
            		{
            						title: "Focus Eilmeldungen",
            						url: "http://rss.focus.de/fol/XML/rss_folnews_eilmeldungen.xml"
            		}
            				],
            				showSourceTitle: true,
            				showPublishDate: true
            		}
            		},
            	]
            
            };
            
            /*************** DO NOT EDIT THE LINE BELOW ***************/
            if (typeof module !== 'undefined') {module.exports = config;}
            

            Note from admin: Please use Markdown on code snippets for easier reading!

            O 1 Reply Last reply Reply Quote 0
            • O Offline
              olliewarren411 @Hellangel1987
              last edited by olliewarren411

              @Hellangel1987

              Looks like you’re using the wrong quote marks around elements, you’re using ‘ try using ’

              There is a difference.

              or use the code below; I’ve tested it working.

              @Hellangel1987

              Looks like you’re using the wrong quote marks around elements, you’re using ‘ try using ’

              There is a difference.

              or use the code attached; I’ve tested it working.

              0_1471976763018_config.txt

              H 1 Reply Last reply Reply Quote 0
              • P Offline
                plumcraft
                last edited by paviro

                Thanks for publishing this module but i got some issues with it.

                When i’m running sudo python setupAccess.py and put my client and secret it, the script looks frozen. (Same behaviour after multiple retries)

                Anyone having the same issue ?

                I don’t know why, i’ve followed instructions here :
                https://github.com/SVendittelli/MMM-fitbit

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Hellangel1987 @olliewarren411
                  last edited by

                  @olliewarren411

                  good job buddy now it works but i dont get any numbers :(

                  alt text

                  O 1 Reply Last reply Reply Quote 0
                  • O Offline
                    olliewarren411 @Hellangel1987
                    last edited by olliewarren411

                    @Hellangel1987
                    No Problem.

                    When you run #sudo python setupAccess.py# on the python directory inside the MMM-fitbit folder does it redirect you to log into you fitbit account in an internet browser?

                    Also what fitbit model are you using? I tried this with a fitbit alta and it didn’t work. Then I tried with my fitbit ChargeHR and it works perfect* see attached. I changed the CSS to display vertically.
                    0_1471979871787_IMG_4570.JPG

                    *i say it works perfect i just need a way to keep the connection to my fitbit account over a long period of time without having to re-run sudo python setupAccess.py on the python directory once a day.

                    H T 2 Replies Last reply Reply Quote 0
                    • H Offline
                      Hellangel1987 @olliewarren411
                      last edited by

                      @olliewarren411

                      Im using The Fitbit Charge HR

                      O 1 Reply Last reply Reply Quote 0
                      • O Offline
                        olliewarren411 @Hellangel1987
                        last edited by

                        @Hellangel1987
                        When you run #sudo python setupAccess.py# on the python directory inside the MMM-fitbit folder does it redirect you to log into you fitbit account in an internet browser?

                        1 Reply Last reply Reply Quote 0
                        • H Offline
                          Hellangel1987
                          last edited by

                          @olliewarren411

                          yepp works perfect. i have the token and autorized that app in browser.
                          after that i startet mirror with sudo npm start. but only zero numbers are shown :(

                          Did i have to do this once a day? Any cronjob for that ?

                          O 1 Reply Last reply Reply Quote 0
                          • O Offline
                            olliewarren411 @Hellangel1987
                            last edited by

                            @Hellangel1987

                            Sorry I’m out of ideas then.

                            Cronjob? I’m pretty new to this.

                            1 Reply Last reply Reply Quote 0
                            • H Offline
                              Hellangel1987
                              last edited by

                              @olliewarren411 can you describe your steps and your configs ? i think there is any missconfiguration in my credentials config i think soo.

                              O 1 Reply Last reply Reply Quote 0
                              • O Offline
                                olliewarren411 @Hellangel1987
                                last edited by

                                @Hellangel1987

                                I cant easily explain as I had to play around a lot to get it to work… and then it just did.

                                When setting up your app on the fitbit website did you get the below steps?

                                Check browser and personal for OAuth settings
                                Callback URL MUST BE http://127.0.0.1:8080/
                                Give your app read & write permissions (read-only untested)

                                I could not set the Personal and OAuth settings until I got my personal URL wrong. When the page reloaded these two extra options appeared.

                                H 2 Replies Last reply Reply Quote 0
                                • H Offline
                                  Hellangel1987 @olliewarren411
                                  last edited by

                                  @olliewarren411

                                  i set it all on that page. exeption was my location. but all other options are set.

                                  1 Reply Last reply Reply Quote 0
                                  • H Offline
                                    Hellangel1987 @olliewarren411
                                    last edited by

                                    @olliewarren411

                                    works! i sued your code. Delete the token. set it up new - start it with sudo npm start in MagicMirror directory. -> WORKS!

                                    I think i missunterstand the fibit API page where you have some buttons tu push and autorize the app (i think i pushed them in the wrong way)…

                                    You sayed something about your token.ini -> can you explain what exactly you have to to every day? i think about an cronjob for that - good chance to solve that together!

                                    And another option is the weight of my fitbit ARIA, these data are also available - how can we bind them into the app ?

                                    O 1 Reply Last reply Reply Quote 0
                                    • O Offline
                                      olliewarren411 @Hellangel1987
                                      last edited by

                                      @Hellangel1987
                                      Glad to hear you got it working.

                                      I’m just trying to get the module to refresh more often. Not sure how to go about it.

                                      You probably could get your weight data in too, you’d need to contact the creator of the module for that.

                                      K 1 Reply Last reply Reply Quote 0
                                      • K Offline
                                        kckndrgn @olliewarren411
                                        last edited by

                                        @olliewarren411 said in Fitbit:

                                        Yes, you can change the refresh interval. In the script MMM-fitbit.js you’ll see

                                        start: function() {
                                        		Log.info('Starting module: ' + this.name);
                                        		this.sendSocketNotification('SET CREDS',this.config.credentials)
                                        		this.sendSocketNotification('GET DATA', 'intial');
                                        		
                                        		this.fadeSpeed = 500;
                                        		
                                        		// Schedule update interval.
                                        		var self = this;
                                        		setInterval(function() {
                                        			self.updateData();
                                        		}, 60*60*1000);
                                        },
                                        

                                        change the 60 x 60 x 1000 to an interval of your choosing. Just be careful to to refresh too often as you’ll get emails from FB telling you that you are pulling too much data. I think (and I’d have to check tonight) that I have mine set to 15 x 60 x 1000.

                                        O 1 Reply Last reply Reply Quote 0
                                        • O Offline
                                          olliewarren411 @kckndrgn
                                          last edited by

                                          @kckndrgn

                                          Thanks! works perfect. I’ve copied your set up so it refreshes the data every 15 mins.

                                          1 Reply Last reply Reply Quote 0
                                          • P Offline
                                            plumcraft
                                            last edited by

                                            I was getting invalid redirect_uri during the setup process. (sudo python setupAccess.py)

                                            But now It’s working for me, great module !

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 2 / 7
                                            • 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