FORUMS
Remove All Ads from XDA

Trying to make a sleep mode profile for my oneplus 7 pro.....

230 posts
Thanks Meter: 23
 
By StoneRyno, Senior Member on 28th November 2019, 02:15 AM
Post Reply Email Thread
There is so much do not disturb customization in this version of android or perhaps specific to oneplus. I am not sure which. That I'm not sure how to make this do what I'm used to it doing on my previous device LG G4. During the day I have it more or less as follows I may be forgetting some things:

Only ring if the phone call is from someone in my contacts.
Text messages always sound etc no matter who sent them.
Email always sounds.
Calendar always sounds.

What I need is the profile to silence everything while I sleep. To do this on the LG G4 I had a sleep profile from 12am to 12pm that set all volume controls to zero. And somehow though I can't remember ended that sleep profile early if I had an alarm go off during that time frame so that I could be disturbed because I was no longer sleeping after the alarm went off. The reason for the 12am to 12pm time frame was to give leeway to time going to bed and also time for waking up without an alarm. The idea was so that I didn't forget to silence things before going to be and forget to undo that once I was awake.
28th November 2019, 09:05 PM |#2  
ktmom's Avatar
Senior Member
Thanks Meter: 2,423
 
More
So typically DND settings built into android allow at least close to this level of control. I'm not sure how Oxygen OS is configured, but on a Pixel I can configure DND to ring only for starred contacts, but allow text and other notifications through. Or, silence everything.

All of that said, you should be able to manage volume levels through Tasker, reject (send to voicemail) calls that are not in your contacts.

If you import your old profile, doesn't it work on the OnePlus?
29th November 2019, 12:47 AM |#3  
StoneRyno's Avatar
OP Senior Member
Thanks Meter: 23
 
More
Quote:
Originally Posted by ktmom

So typically DND settings built into android allow at least close to this level of control. I'm not sure how Oxygen OS is configured, but on a Pixel I can configure DND to ring only for starred contacts, but allow text and other notifications through. Or, silence everything.

All of that said, you should be able to manage volume levels through Tasker, reject (send to voicemail) calls that are not in your contacts.

If you import your old profile, doesn't it work on the OnePlus?

Stupid me I forgot to backup my old tasker stuff so I have to start from scratch again.
In the do not disturb setting UI of the settings UI there are the following:

Toggle DND on/off: this is toggled on and is set to stay on all the time.
Behavior heading
Notifications: tapping it opens a new UI giving you some default choices for notifications in general. I have this set to no sound at all. And override DND in specific areas outside of this part of settings regarding notifications from SMS/MMS messages, email, voicemail, calendar alarms. Might be one or two I am forgetting to mention.
Exception heading
Calls: tapping here brings up settings to allow calls from (anyone, contacts only, starred contacts only, none.) I have this set to contacts only.
Messages: same detail as calls. Set same as calls.
Other sounds: toggles to allow alarms, media, and touch sounds. I have these toggled to allow.

As for the other stuff that overrides DND I accessed that setting from within each of the apps settings. Not sure if that was a redirect from the app settings to a system settings area that I'm not aware of how to get to otherwise. So what I need is a profile that will mute everything while I sleep and return to how everything is currently set. On the LG G4 I accomplished this by turning all volumes to zero for sleep and then restored them all to 100% upon either the end time trigger of the sleep profile on upon an alarm I set to get up before the end of the timeframe of the profile.

What I was wondering if this was the way to go or if a more simple toggle one setting would accomplish it. I didn't see any DND setting in the system setting for no interruptions at all despite the overrides set. What I'm thinking is the same approach as before and set media, notification, ringer, and system volumes to zero and restore to 100% at end. The part I can't remember how I did it was ending the sleep profile when an alarm goes off that I set to a time prior to the end of the timeframe of the profile. Any idea how I would have done that?
29th November 2019, 02:12 AM |#4  
ktmom's Avatar
Senior Member
Thanks Meter: 2,423
 
More
I think which ever way gets you where you want to be is the way to go

On my Google phone, that's the ability to mute everything except alarms. There is also a toggle to disable DND when an alarm goes off.


As far as using tasker to turn volumes back up when an alarm goes off, my way of doing that is to intercept the notification for the alarm. Again, I'm using Google clock, and the way the notifications work may be different on your device.

Here is a taskernet share of a basic project using a notification intercept of the Google Clock alarm. Because there can be namespace collisions with imported projects, I append a variant of my username into variables, task and project names.
30th November 2019, 05:24 AM |#5  
StoneRyno's Avatar
OP Senior Member
Thanks Meter: 23
 
More
For everything to work the way it did I would need the sleep profile to end when an alarm goes off. The problem is I can't remember how that was done. I don't see an end condition that can be added to the sleep profile. The actual sleep profile is the only part I can remember enough to have replicated at this point. It being a from 12am to 12pm with a start task that turns all the volumes down to zero and an end task that turns them all back up. The alarm part I can't recall how it was done.
30th November 2019, 01:25 PM |#6  
ktmom's Avatar
Senior Member
Thanks Meter: 2,423
 
More
What was wrong with the notification intercept I shared?

That particular project was to put a large dismiss/snooze on the screen for a low vision individual, but it intercepts the alarm firing notification (for Google clock) and as I already said, intercepting the notification is the way I would do it.
1st December 2019, 01:23 AM |#7  
StoneRyno's Avatar
OP Senior Member
Thanks Meter: 23
 
More
It looks like it is a nice project, but it is requiring a plug-in. However the toggle was made before didn't require any additional things to be added. Isn't there a native event or state that a profile can trigger when an alarm goes off?
1st December 2019, 03:52 PM |#8  
ktmom's Avatar
Senior Member
Thanks Meter: 2,423
 
More
I assumed you tried using the native alarm clock or alarm done events in a profile and those didn't work. If you haven't, then try them. They don't work on my devices.

You could research java functions to get the next alarm and use the native java function action to then set a profile time context.

Remembered that tasker was designed to be a framework into which functionality could be added through plugins.
2nd December 2019, 07:15 PM |#9  
StoneRyno's Avatar
OP Senior Member
Thanks Meter: 23
 
More
One of those is probably what was used on my LG G4. Now to figure out if this was a part of the one profile or a separate profile. I assume 2nd profile as I don't see any way of adding a 2nd end condition to the first. I remember when it was originally designed the conversation arriving at a solution to function as wanted was a long one. What bothered me is that the thread it took place in is missing from the forum it took place in. I even attempted to inquire there again about making it but after a week of no response I figured it was no longer a good place to post at.
2nd December 2019, 09:05 PM |#10  
ktmom's Avatar
Senior Member
Thanks Meter: 2,423
 
More
Quote:
Originally Posted by StoneRyno

One of those is probably what was used on my LG G4. Now to figure out if this was a part of the one profile or a separate profile. I assume 2nd profile as I don't see any way of adding a 2nd end condition to the first. I remember when it was originally designed the conversation arriving at a solution to function as wanted was a long one. What bothered me is that the thread it took place in is missing from the forum it took place in. I even attempted to inquire there again about making it but after a week of no response I figured it was no longer a good place to post at.

What do you mean "2nd end condition"? A second context (condition) in the profile? Long press the first context.
2nd December 2019, 10:20 PM |#11  
StoneRyno's Avatar
OP Senior Member
Thanks Meter: 23
 
More
The sleep profile uses time condition 12am to 12pm. I only need a 2nd condition that ends it but doesn't impact the start. I know for sure I can do that with a second profile now that I know what I needed to use to as event trigger. I can run a task that toggles off the sleep profile and toggles it back on some hours later to trigger again at 12am. I wasn't sure if the alarm event could be an alternative condition for end so that the sleep profile was 12am to alarm done or 12pm.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes