I’ve released a SmartApp that will display your current Google Fit step count and most recent weight as a tile in the SmartThings mobile app. This app also makes the steps count available to other apps that support the Steps Sensor capability. Huge thanks to @mnestor’s GCal-Search app for showing me how to handle Google OAuth2!
I’ve just pushed a fix to github that adds a bit more debug output and should hopefully fix the issue fetching the steps data. Please let me know if you’re still having an issue!
Well a graph from may 16 to oct 12 shows up in the fit app…apparently I haven’t opened the WeightGurus app to sync with the bluetooth scale for 3 weeks.
The app only requests the last week of weight measurements (annoyingly there’s no API to just get the most recent one, you have to specify a date range). I’ve extended the range to 6 weeks, let me know if you can see the weight now!
Thanks Sam,
That last change did it for me, it picked up my weight from the last weight sync 3 weeks ago. I should get a wifi scale instead of a bluetooth one. No errors in the log.
Really cool app…good job!
–Keith
I followed the instructions as best as I could but I’m getting “disallowed_useragent” on the app when I try to put in my google credentials. When I created the Oauth key I set it up for web application and specified the redirect URI. I’m running android 7.1 on a nexus 6. I copied and pasted the client ID and secret into the smartapp before publishing it. I also enabled the google fit API in a new project.
Looks like Google doesn’t allow logins through the SmartThings app anymore. Samsung would have to update the SmartThings app to use a real browser instead of an embedded web view for oauth logins.
I clicked on more details on the error and it said something about starting
November 2016 or so they would disallow Oath authentication from webview,
or something like that. It said something about steering developers to use
some other type of authentication.
Update: Here is the info about it. This change went into effect after the last post on this thread.
I was able to get this working by changing style to external on line 51 like this on the Smartapp:
href url:redirectUrl, style:“external”, required:true, title:“”, description:“Click to enter credentials”
This will make it so it loads in the browser instead of trying to embed it in Smartthings app and works perfect now for me. After I authorized it, I had to close the browser page and go back to the Smartthings app but it connected fine with my Google Fit account.
Thanks! I’ve updated the smartapp on github to use external authentication, glad to hear it’s working again. It should be possible to add calories, though you’ll have to re-authorize the app to add additional permissions. I’ll look into adding more data soon