cmaion / polar

A set of command line tools written in Ruby to interact with Polar watches and decode raw data files
89 stars 22 forks source link

Convert sleep data #8

Closed carmenfdezb closed 6 years ago

carmenfdezb commented 6 years ago

Hi cmaion! First, thank you so much for doing this tool, it's very useful for me. I have a polar M430 and your code works perfect in my watch. I would like to ask you if it is possible to convert sleep data from /U/0//SLEEP to a TXT or CSV file. Regards.

cmaion commented 6 years ago

Hi Carmen

No M430 here, so I don't have access to those sleep data. However that might be doable if I can get the protobuf proto files & sample files.

Would you like to share a copy of the sleep files you have, so that I can take a look? Where are those files stored in the Polar filesystem?

Cheers

carmenfdezb commented 6 years ago

Thanks for your quick answer! I'll send it you as soon as I get home (I'm at work now). Cheers.

carmenfdezb commented 6 years ago

Hi again! Here it's the 'SLEEP' folder compressed to .zip file: https://www.dropbox.com/s/rw7uc7i9lloyg8t/SLEEP.zip?dl=0

'SLEEP' folder is located in /U/0/<YYYYMMDD>/, the .zip here is 'SLEEP' folder from /U/0/20180926/. If you need more info, just tell me.

Thanks!

Cheers.

cmaion commented 6 years ago

OK that one was easy! See 1b852275135fb01a05ec46ef2239dc046ddd44f1

Here it goes :

Sleep start                         : 2018-09-25 22:33:39 +0200
Sleep end                           : 2018-09-26 06:09:09 +0200
Last modified                       : 2018-09-26 07:31:39 +0200
Sleep goal (minutes)                : 480
Snooze times                        : 
Alarm time                          : N/D
Sleep start offset (seconds)        : 0
Sleep end offset (seconds)          : 0
Sleep user rating                   : PB_SLEPT_UNDEFINED
Recording device                    : XXXXXXXX
Battery ran out                     : false

Sleep wake phases (from sleep start):
        0s: PB_WAKE
       30s: PB_NONREM3
      150s: PB_WAKE
      180s: PB_NONREM3
      360s: PB_WAKE
      390s: PB_NONREM3
      930s: PB_WAKE
      960s: PB_NONREM3
     2490s: PB_WAKE
     2580s: PB_NONREM3
     6810s: PB_WAKE
     6840s: PB_NONREM3
     8430s: PB_WAKE
     8520s: PB_NONREM3
     9780s: PB_WAKE
     9810s: PB_NONREM3
     9900s: PB_WAKE
    10020s: PB_NONREM3
    12180s: PB_WAKE
    12240s: PB_NONREM3
    12780s: PB_WAKE
    12810s: PB_NONREM3
    13230s: PB_WAKE
    13260s: PB_NONREM3
    13620s: PB_WAKE
    13650s: PB_NONREM3
    13800s: PB_WAKE
    13830s: PB_NONREM3
    15390s: PB_WAKE
    15450s: PB_NONREM3
    16170s: PB_WAKE
    16320s: PB_NONREM3
    18930s: PB_WAKE
    18990s: PB_NONREM3
    19110s: PB_WAKE
    19140s: PB_NONREM3
    21030s: PB_WAKE
    21060s: PB_NONREM3
    21930s: PB_WAKE
    21990s: PB_NONREM3
    23010s: PB_WAKE
    23040s: PB_NONREM3
    25110s: PB_WAKE
    25200s: PB_NONREM3
    27360s: PB_WAKE
carmenfdezb commented 6 years ago

Wow!! Thank you so much! I will take a look ;)

carmenfdezb commented 6 years ago

I've noticed that my id device is showed in your comment ('Recording device'), could you hide it? Thanks in advance!

cmaion commented 6 years ago

Sure, sorry for that.