plees-tracker icon indicating copy to clipboard operation
plees-tracker copied to clipboard

Add reminders to start/stop tracking of regular sleeps

Open mike-nc94 opened this issue 2 years ago • 10 comments

Problem

It happens from time to time that I forget to start or stop the tracking of my daily sleep.

Desired solution

It would be nice to have the app remind me in the evening and morning to interact accordingly. I imagine a setting where I can simply create multiple time based, recurring reminders that will trigger a notification. Optimally tracking would be started or stopped respectively when the notification (or a button on it) is pressed.

Additionally such reminders could even serve as a call to go to bed.

mike-nc94 avatar May 09 '23 18:05 mike-nc94

Would this more or less duplicate the functionality of some alarm clock?

I'm not entirely against it, but I rarely have the "forgot to go to bed" problem myself.

Would you be interested in contributing a PR that does this?

Also, any other open source apps that have something similar, in case we could model our UI based on what they do?

vmiklos avatar May 12 '23 08:05 vmiklos

Would this more or less duplicate the functionality of some alarm clock?

If you want yes but ... I find an alarm clock more intrusive than a notification and also would not integrate with the app so features like quick start and stop from the notification are not possible.

I'm not entirely against it, but I rarely have the "forgot to go to bed" problem myself.

It's not a "forgot to go to bed" problem rather than discipline to enter every sleep.

Would you be interested in contributing a PR that does this?

In principle yes but I am not familiar with Kotlin and unfortunately don't really have enough time to dedicate. :/

Also, any other open source apps that have something similar, in case we could model our UI based on what they do?

Yes, actually I discovered that feature from com.oriondev.moneywallet ^1 and find it really useful there.

mike-nc94 avatar May 15 '23 19:05 mike-nc94

Thanks. Time is a limed resource for all of us, but otherwise this looks reasonable to me for addition.

vmiklos avatar May 16 '23 07:05 vmiklos

Additionally such reminders could even serve as a call to go to bed.

That would be a good bonus for those of us who find ourselves staying up too late and getting 5 hours of sleep. In some ways that's the main reason I'm still using Sleep as Android...

LinuxinaBit avatar May 23 '23 11:05 LinuxinaBit

Also, any other open source apps that have something similar, in case we could model our UI based on what they do?

Not really open source but Samsung Health sends 2 notifications. One at night that says something like "Almost bedtime. Try reading or meditating". It automatically estimates when you went to bed and woke up (based on phone usage or the gyro sensor, I assume). It then sends a notification in the morning asking if the estimated time is correct and if so, to record it.

I don't think this app needs the auto-estimate feature but these types of notifications would be nice. Samsung Health requires an account to use it, so let me know if you want me to take screenshots of the notifications and app UI.

Would like to help someday but I'm currently caught up with college and work.

gursuj avatar Jan 07 '24 09:01 gursuj

That's a good idea: a first step we could do is to just schedule an alarm based on the already set ideal sleep length. If you start tracking and you don't stop in 8 hours (by default), then it makes sense to trigger a notification.

I assume the way to do that is something like https://developer.android.com/develop/background-work/services/alarms/schedule

That is just for the stop part, and perhaps it needs a setting to be opt-in, but otherwise it would solve half of what this issue is requesting.

vmiklos avatar Jan 09 '24 16:01 vmiklos

Counting 8 hours from the start of tracking is a good idea. Forgot to mention that Samsung Health allows setting a target time for when you want to go to bed and wake up. The "get ready for bed" notification is sent around 10 minutes before the target bed time.

gursuj avatar Jan 09 '24 17:01 gursuj

https://github.com/vmiklos/plees-tracker/issues/382#issuecomment-1548479529

@mike-nc94, in the meantime, https://github.com/tasks/tasks/blob/f3c28fe60d4bd3dadf314f253dc16658ed367954/README.md with a task synchronized to NextCloud via CalDAV seems to work better for me, because it's multiplatform.

RokeJulianLockhart avatar Apr 20 '24 10:04 RokeJulianLockhart