Import SleepBot Data

754 views
Skip to first unread message

Braden Schmidt

unread,
Oct 2, 2012, 12:24:56 AM10/2/12
to sleep-as...@googlegroups.com
I would like to import all of my SleepBot data into Sleep As Android. I have approx 280 nights worth of data. I have exported the data into a csv file from SleepBot but it is in a different form than the Sleep As Android export. I tried to import it but it failed. 
Using Excel I tried manipulating some of the data but each field is going to need to be changed. Also I don't know how to fake the ID.

Has anybody had any experience with doing this conversion? Or does anybody know of an easier way to manipulate multiple fields easier?

Thanks

Petr Nalevka

unread,
Oct 2, 2012, 4:19:23 AM10/2/12
to sleep-as...@googlegroups.com
Hello Branden,

thank you very much for your feedback. It should not be so difficult to convert. The id field is basically a java timestamp of the from time. It is the number of milliseconds since January 1, 1970, 00:00:00 GMT. Framerate and timezone should basically be constants and you don't need to bother with the data (if I'm correct).

Thank you very much.

Best regards,

Petr

--
Best regards,

Petr

Braden Schmidt

unread,
Oct 2, 2012, 2:04:27 PM10/2/12
to sleep-as...@googlegroups.com, pe...@nalevka.com
Thanks for the reply,

The exported data from Sleep As Android  has the "From" and "To" field dates and times concatenated together:
       To (or From)
 29. 09. 2012 0:00

Whereas SleepBot has it separated:
    Date        |  Sleep Time  |     Wake Time  |
9/30/2012  |       0:31          |             8:47       |

Do you have any idea how I can easily combine these together so I can import into your app? Also how can I provide an ID field?

Thanks for your help,
Braden

Steven Zhang

unread,
Apr 2, 2014, 1:56:32 AM4/2/14
to sleep-as...@googlegroups.com, pe...@nalevka.com
Hey Braden. 

Did you ever have success on this? Do you have a script of some sort that you made?

I would like to try this now

Thanks

K Kaland

unread,
Jun 3, 2014, 1:05:57 PM6/3/14
to sleep-as...@googlegroups.com, pe...@nalevka.com
I tried this, formatting everything like Sleep as Android does, but I got an error when importing.

Just a simple "failed to import from your SD card, file: /sleep-data/sleep-export.csv"

I'm guessing something went wrong, but I don't know where to find the logs that might explain what in more detail.

Petr Nalevka

unread,
Jun 3, 2014, 5:15:28 PM6/3/14
to sleep-as...@googlegroups.com, sleep-as...@googlegroups.com, mar...@stava.me

Petr replied

Cc: sleep-as...@googlegroups.com, mar...@stava.me

Jun 3 23:15
Hello,

could you please send a debug report (alarmlist->menu->send debug) after you do the import? I will have a look. If you would send the import file as well or at least a portion of it I can try to import and debug.


Thank you very much.

Best regards,

Petr Nalevka
Urbandroid Team

Conversation started by sleep-as...@googlegroups.com

Cc: pe...@nalevka.com, sleep-as...@googlegroups.com

Jun 3 19:06
--
You received this message because you are subscribed to the Google Groups "Sleep as Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-dr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

{#HS:33089350-584#}
Powered by Help Scout

Joel Low

unread,
Sep 13, 2014, 4:17:51 AM9/13/14
to sleep-as...@googlegroups.com, pe...@nalevka.com
Hello there,

I've just wrote a short Ruby script to migrate the data to Sleep as Android's format. You can get it at https://gist.github.com/lowjoel/7f8612a2b945d15eb96e#file-sleepbot-migrate-to-sleep_as_android-rb -- it runs using Ruby. Copy the SleepBot data CSV to the same directory as the file, call it sleepbot-raw.csv, and run the script.

It also supports the raw SQLite data dump. If you can extract the database from SleepBot (ie your device is rooted...) you can export the raw data dump and then it will also migrate ratings.

Regards,
Joel

Petr Nalevka

unread,
Sep 13, 2014, 9:46:43 AM9/13/14
to Andres Del Rio' Via Sleep As Android

Petr replied

Sep 13 15:46
Hello Joel,

many thanks for your effort on this. Would you like me to link your project from our documentation? We could include this in the backup section.

One questions, I saw that the CSV file does only include sleep times, but nut any activity data is that true or I'm missing something?


Thank you very much.

Best regards,

Petr Nalevka
Urbandroid Team

Andres Del Rio' Via Sleep As Android replied

Cc: pe...@nalevka.com, sleep-as...@googlegroups.com

Sep 13 10:18
Hello there,

I've just wrote a short Ruby script to migrate the data to Sleep as
Android's format. You can get it at
https://gist.github.com/lowjoel/7f8612a2b945d15eb96e#file-sleepbot-migrate-to-sleep_as_android-rb
-- it runs using Ruby. Copy the SleepBot data CSV to the same directory as
the file, call it sleepbot-raw.csv, and run the script.

It also supports the raw SQLite data dump. If you can extract the database
from SleepBot (ie your device is rooted...) you can export the raw data
dump and then it will also migrate ratings.

Regards,
Joel

Petr replied

Cc: sleep-as...@googlegroups.com, mar...@stava.me

Jun 3 23:15
Hello,

could you please send a debug report (alarmlist->menu->send debug) after you do the import? I will have a look. If you would send the import file as well or at least a portion of it I can try to import and debug.

Thank you very much.

Best regards,

Petr Nalevka
Urbandroid Team

Conversation started by Andres Del Rio' Via Sleep As Android

Cc: pe...@nalevka.com, sleep-as...@googlegroups.com

Jun 3 19:06
--
You received this message because you are subscribed to the Google Groups "Sleep as Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-dr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joel Low

unread,
Sep 13, 2014, 10:01:27 AM9/13/14
to sleep-as...@googlegroups.com
Hi Petr,

Sure, link to it if it might help anyone. It should just work -- I made it a gist so that people can help fix things if necessary. Maybe this might belong better in the "import from other apps" section, if you have one ;)

The CSV that SleepBot exports only contains sleep time, rating, and comments. The SleepBot android database does have accelerometer data, but I can't make any sense of it :( I'd like to import that into Sleep as Android too, but I can't do that if I can't understand the encoding. It looks like JSON, but the keys and values don't make sense to me.

Regards,
Joel

Petr Nalevka

unread,
Sep 13, 2014, 10:24:00 AM9/13/14
to Andres Del Rio' Via Sleep As Android

Petr replied

Sep 13 16:23
Many thanks, looking at this I did come to a similar conclusion even I did not examine the data in the database. Anyway I did include an import section here https://sites.google.com/site/sleepasandroid/doc/backup and renamed the chapter as "Data, backup, import and sharing..." Hopefully this makes sense..


Thank you very much.

Best regards,

Petr Nalevka
Urbandroid Team

Andres Del Rio' Via Sleep As Android replied

Cc: sleep-as...@googlegroups.com

Sep 13 16:01
Hi Petr,

Sure, link to it if it might help anyone. It should just work -- I made it
a gist so that people can help fix things if necessary. Maybe this might
belong better in the "import from other apps" section, if you have one ;)

The CSV that SleepBot exports only contains sleep time, rating, and
comments. The SleepBot android database does have accelerometer data, but I
can't make any sense of it :( I'd like to import that into Sleep as Android
too, but I can't do that if I can't understand the encoding. It looks like
JSON, but the keys and values don't make sense to me.

Regards,
Joel

Reply all
Reply to author
Forward
0 new messages