Coder Social home page Coder Social logo

mmm-googlefit's Introduction

MMM-GoogleFit

A magic mirror module to grab google fit daily step count and daily weights.

status

This module is not maintained and will not recieve any support from me.

What it Looks Like

Normal Usage:
Normal use screenshot


Colored Rings (each new color means 1x base step count):
Colored rings screenshot


NEW - Optional Icons (Now enabled by default)
Icons screenshot


Authentication Flow:
Authentication screenshot

Installing

This module is pretty simple to set up. You simply need to clone the module into your modules folder (like other modules).

$ cd MagicMirror/modules
$ git clone https://github.com/amcolash/MMM-GoogleFit.git

Then add the following to MagicMirror/config/config.js and optionally configure any options below.

{
    module: 'MMM-GoogleFit',
    position: 'position',
    config: {
        // If desired
    }
},

Finally, restart your magic mirror.

You will need to authenticate with google fit for this module to work. Follow the onscreen instructions which should tell you to visit https://google.com/device and input the code displayed. Simply enter the code and allow the module to access your google fit data. That's it!

Configuration Options

Below are listed all possible configuration options for this module.

SOME VALUES HAVE CHANGED SINCE THIS MODULE WAS FIRST PUBLISHED. CHECK YOUR CONFIG.

Note; If you want to use metric/imperial units for weights (or if they are not what you expect), please set the according units inside of your base config/config.js file as listed in the magic mirror instructions here.

Option Description
updateInterval How often to update (in minutes)
Possible values: number
Default value: 30
stepGoal How many steps you want to take each day (to fill pie chart)
Possible values: number
Default value: 10000
startOnMonday If the calendar view should start on Sunday (default) or Monday.
Possible values: boolean
Default value: false
lastSevenDays If the calendar view should show the last 7 days or if it should show the current week (default). Note: This setting takes priority over startOnMonday.
Possible values: boolean
Default value: false
reverseOrder Reverses the calendar view ordering - so the last day is on the left instead of the right.
Possible values: boolean
Default value: false
displayWeight If the module should show weight data.
Possible values: boolean
Default value: true
chartWidth How wide the chart portion of the module should be (in pixels), excludes icons
Possible values: number
Default value: 300
chartPadding Percent of available chart width dedicated to padding. If each ring takes 50px and there is 0.2 (percent) padding, then 10px are used for padding, making the chart 40px.
Possible values: number (between 0 - 1)
Default value: 0.2
innerThickness How thick inside gap of the chart rings should be (percent), where 0 = no innner gap and 1 = only gap, no visible chart.
Possible values: number (between 0 - 1)
Default value: 0.8
fontSize Font size
Possible values: number
Default value: 18
stepCountLabel Enable step count to be listed below the step rings
Possible values: boolean
Default value: false
useIcons Enable icons on the side of the module
Possible values: boolean
Default value: true
colors Array of colors for the step counter
Possible values: Array[#hexColor]
Default value: ["#EEEEEE", "#1E88E5", "#9CCC65", "#5E35B1", "#FFB300", "#F4511E"]
debug Turn on debug mode?
Possible values: boolean
Default value: false

Multiple Instances of the Module

This module can be used multiple times on the mirror (for different users) with some work, however this is not fully supported out of the box. Check out this github issue for instructions.

Libraries Used

This module (like most open source) has some help from others, shoutout to the authors and contributors! Cheers

  • Beautiful and responsive charts from HighCharts
  • Icons from the lovely people at icons8
  • Saving a json file (because it is easier) with jsonfile

mmm-googlefit's People

Contributors

amcolash avatar kolbyjack avatar konecnyna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mmm-googlefit's Issues

Changing start of the week

Hi,

Is it possible to change the start of the week to Monday?
Also, sorry for opening an issue for this, but I couldn't find the option anywhere.

Best regards

Undefined state

Hi Andrew,

I just started to test your MMM-module :) Thanks for making it available!
Unfortunately right now it just shows 'undefined' states.
2018-05-03 20_52_27

A little bit of background:

  • I installed MM completely from scratch a few days ago for my final installation (Finally finished the frame).
  • I looked through the available modules, found yours, installed it.
  • I "reactivated" Google Fit. Meaning I stopped using it a while ago. Which is the reason why it shows 0 for every day.
  • Auth worked right away (pretty cool!). In standard config it worked fine. After changing some parameter it still worked fine:
startOnMonday: true,
stepGoal: 8000,
innerThickness: 0.9
  • After I started using Google Fit again (having more than 0 steps on the first day, and the others still left 0) the modules started to show the gibberish in the screenshot.
    The MM html looks like the following:
    2018-05-03 21_01_00

Here another view from my google fit account
2018-05-03 21_01_50

I assume the it'll start working after I have data for every of the last 7 days. Still, this is just and educated guess.
Just wanted to let you know that there may be an issue with the marginals.
Thx :)
Marc

Different Users

I would like to add the values of my girlfriend. How to do this?

Module loaded but don’t show data

Hi
My MagicMirror googlefit module don’t show data.
I have the xiaomi miband3 with Mifit app that send data to googlefit app on Android. The module was authenticated correctly and it appare on Google fit app authorized to receive data but it show default circle and blank color without data.
C8FC5CEA-6749-4119-BA04-6EEB3D546E34

I tried to delete the module and refollow the auth process but it don’t solve.
Thanks

TypeError: Cannot read property 'getElementsByClassName' of null

I see the following in chrome inspector after adding the module:

TypeError: Cannot read property 'getElementsByClassName' of null at moduleNeedsUpdate (main.js:176) at main.js:144 at new Promise (<anonymous>) at updateDomWithContent (main.js:137) at main.js:119

German translation

Hi,
is there a way to translate the module into German?
Like the weekdays and everything else?
If you need help regarding the translated text, I can help you out but I am a newbie with no programming skills

Wrong Data

I don´t Know why that is but the modules shows me completely wrong Data. For example I have done 6000 Steps a Day and the module only shows 2,1 K

Where is the Problem?

Stats Error

From the forums, link:

StacheEnthusiast 2/21/2018 6:10 PM

I’m getting an auth error, “stats error”. I’ve followed the steps and MMM-GoogleFit shows up in my google apps with permissions. Any ideas?

Shocking news that support has stopped

I am sad to read the latest update from the developer, the program (GoogleFit) module has stopped supporting, it is sad news

any how We wish you well

Error with default config

First of all, thanks for this module.
With default config, i'm receiving the following error whe starting MagicMirror.

WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'jsonfile'

And

Whoops! There was an uncaught exception...
{ [Error: Cannot find module 'jsonfile'] code: 'MODULE_NOT_FOUND' }

I'm on a Pi Zero with Server only and over 10 working modules.
Looks like node_helper has some issue

Authentication wrong code format

Hi,

i get the wrong code format for the authentification. My code format is XXX-XXX-XXX instead of XXXX-XXXX.

What can i do?

Thanks.

Error Getting Auth

I have just installed it I did connect my gmail to this and have the app on my phone. While the google fit module loading for first time I did a reboot on my raspberry and now I have this error message "Error Getting Auth Stats Error"

no longer showing my logged daily weight

After last update, I haven't been able to get my daily weights to show on the module...

I've tried pretty much everything I can figure in attempts to get it to work. But, everything I have tried will not show them.

Can someone help me with this?

Is anyone else having the same problem?

Thanks in advance!!!

error getting auth

i went to the link shown. entered code. still getting error getting auth

Display Error

Hi, at first let me say thanks for this great module.
i got an display error since updating to latest magic mirror version.
grafik
Picture is attached. Any idea how to fix this?

Multiple Instances of The Module

Making a ticket based off of some forum feedback:

nitram: Jan 31, 1:50 PM
Nice work. Do you know if it’d handle two instances - i.e. two google accounts? I can imagine some friendly competition in my house with this!

amcolash: Jan 31, 1:54 PM
I have not played around with multiple instances of a MM module, but I can take a look into it when I get some time this weekend. There are some assumptions that are made right now that prevent multiple instances from accessing different accounts. That being said, I am not sure how much work it would take to do but I am up for at least investigating this.

nitram: Feb 1, 1:27 PM
That’d be awesome! I hope it’s straightforward. Also, I’m using it currently on a pi zero W and had no issues with the authentication process. Cheers.

Sleep tracker?

Loving this module. I see on GoogleFit that you can track your sleep. Is there a way to also display Sleep History from GoogleFit on this module?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.