pkpio / fitbit-googlefit

Export Fitbit data to Google Fit. Unlike the alternatives such as fitnessyncer.com, this offers very fine intraday granularity (every minute/second data).
http://pkp.io/blog/fitbit-to-googlefit-sync/
GNU General Public License v3.0
491 stars 61 forks source link

REM State sync #47

Open DanHidalz opened 6 years ago

DanHidalz commented 6 years ago

I previously owned a Fitbit device and sold it because its closed environment. Now I'm thinking on getting one back provided that this allows me to sync most of my data to Google Fit but I have one questions.

Would this script allow me to sync the new sleep states that Fitbit implemented? REM sleep and the kind.

Thanks a lot for your help!

DanHidalz commented 6 years ago

I'm not that fond into coding but as I see here in convertors.py:

Convert sleep data point to google fit sleep types

    if data_point['value'] == 1:
        sleepType = 72
    elif data_point['value'] == 2:
        sleepType = 109
    elif data_point['value'] == 3:
        sleepType = 112
    else:
        sleepType = 72

Those states correspond as I have read to 72=sleep, 109=light sleep and 112=awake.

Isn't there a way to convert the fitibit sleep data points to Google Fit sleep types Deep sleep (110), REM sleep (111)?

pkpio commented 6 years ago

@DanHidalz Good point. This was written before Fitbit introduced the REM sleep feature. It should be possible now - assuming Fitbit is including that information in the API response - I think they are.

Will look into this. Thanks 😄

DanHidalz commented 6 years ago

I guess they're including it at least that's what I could extract from here: https://dev.fitbit.com/reference/web-api/sleep/

If this could be included I'm definitely buying one back! Lol. Let me know if you are able to implement it or have news regarding it!

Thanks!!

DanHidalz commented 6 years ago

Hi, people! Are there news regarding this? Thanks in advance!

maleadt commented 5 years ago

The https://github.com/Woyken/fitbit-googlefit fork seems to implement this.

DanHidalz commented 5 years ago

Thanks a lot @maleadt!