google fit bed time automatic integration



I’ve added few new metrics to the app.
The most notable ones are the ability to bed time and strength training from google fit. I use “Sleep as Android” that syncs to googlefit. If you have sleep data in google fit and want to track bed time, you just need to configure bed time in After it’s configured it will send the count of minutes you were late every day if you don’t go to bed on time.
I also added a metric that fetches strength training minutes from google fit. It should work with many apps on the android play store that sync to google fit.

Have a productive day :smile:

Beeminding bedtime

Thanks a lot! could you explain a bit on how to set it up? i’m having a bit of troble on the sleep as android integration to google fit


First you need to look for google fit on “Sleep as Android” configuration and make sure the toggle button is on.
Then you should create a “do less” goal in beeminder, setting up the total minutes you allow yourself to he late before going red. For example, I set up 120 minutes a week.
The last step is to click “sleep lag” goal on, choosing bed time and timezone and clicking save.
After doing that, will report the count minutes you were late each day. For example, if you set 11pm as bed time and started “Sleep as Android” recording at 11:22 pm, the app will report 22.
If you were not late it will report 0.
Let me know if something is not clear.


Thanks! Why does it always refer to 00:00:00 UTC ?


It was just more convenient for me to send all the measurements as UTC and let beeminder handle the conversions. Aftert you mentioned it I realized that It’s not accurate as it might cause the datapoint to be counted in the wrong day.
Now it should be fixed and the timestamp reported will use the timezone you configured in the app.


Could you please the measurement principle and/or sensors that register sleep? I have no idea what google fit is. Some kind of autodata integration to track bed time would be wonderful if it still works sleeping together with my spouse in double bed and without any internet-temptation devices nearby.


Google fit is a general health platform that allows app developers to manage fit/health related data. Some apps can report to google fit your sleep. The one I use is called “Sleep As Android”. It works by starting a “recording” when you go to bed and stopping it in the morning. In practice the phone can be in another room. You can try it if you have an android device.


So what hardware sensors does your solutipn use? Where are they positioned?


There are no hardware sensors. It’s an android app that you manually start before sleeping.


Probably the app reads the motion sensors of the phone, right? You have to put the phone on the mattress, right? So I guess it wouldn’t be able to distinguish which spouse is sleeping.


The app uses the hardware sensors to figure out how much time you were in “deep sleep”. If this feature is not relevant for you, the hardware sensors don’t matter.
For bed time tracking purposes, you have to manually start the app and press a button for the app to start recording. Because you do this on your phone, the app knows it’s you and not your spouse. Now if you don’t want to have the phone next to you, just start the app somewhere else before you go to sleep.
It doesn’t seem convenient as you might as well put the bed time manually on beeminder. This solution just happens to work for me as I use “Sleep as Android” for sleep tracking anyway.


Thanks, that clears it up.


thanks @galtsubery for, it’s great, …, but, …, (there must be a but, right?),

would it be possible to extend google fit integration to cover other exercises?, and ideally, user-defined composite of exercises?, …, here’s my user case so that you know what I mean.

I use several different apps to track different exercises. All of them integrate with google fit. But some of them report the exercise as “circuit training”, other as “calisthenics”, other as “strengthening” and so on. It would be great to be able to track a mix of those exercises, aggregating the active time and/or calories.

Currently can track “Hourly Steps”, “Strength training”, “Active time”, “Sleep Duration”, and “Bed time lag” from google fit. So it would be like Strength training, but for a user-defined group of exercises.

Is that something that would be relatively easy to implement?, I’ve no idea, but I think it would be a great improvement to and beeminder.


It would be possible to show a list of activity types and configure types that you’d want to count.
Calorie tracking is not as simple because of the way Google Fit API works.


that would be awesome!, …, regarding calorie tracking, at least for me it not important at all. I actually put it in my post just because I think there are other people out there counting calories


@galtsubery trying to set this up now. for whatever reason, none of my new slugs are appearing in the dropdown menu- only the one single slug I had when i first signed up for


@stevenzhang Could it be that the missing slug is set up in another goal in


Checked. It’s not the case. Actually now I don’t see any available slugs in the slug dropdown :frowning: