Enable Do Not Disturb at specfic time if connected to WiFi.

576 views
Skip to first unread message

Matt

unread,
Nov 19, 2017, 12:29:55 PM11/19/17
to Tasker
Hi All,

I'm having a bit of trouble creating the following task/profile.

What I would like to do is when I am connected to my home WiFi and if the time is 10pm turn Do Not Disturb on (the only thing that can play is my alarm) and then at 8:30am when my alarm sounds turn Do Not Disturb off.

Is this possible? If so would someone be able to give me some guidance on what I need to do to get this working please.

Thanks

Matt

Pent

unread,
Nov 19, 2017, 1:10:35 PM11/19/17
to Tasker

What I would like to do is when I am connected to my home WiFi and if the time is 10pm turn Do Not Disturb on (the only thing that can play is my alarm) and then at 8:30am when my alarm sounds turn Do Not Disturb off.

Create a profile, add a Time context, connect to a task which has the action Do Not Disturb.

Back in the main screen, long-click on the Time context (left), select Add Context, State, Net, Wifi.

You need to enable Tasker's Notification Listener service to do the Do Not Disturb but, but after
you created the action it should warn you about that.

Pent

Matt

unread,
Nov 19, 2017, 1:24:53 PM11/19/17
to Tasker
Oh my god! Thanks Pent, that was so much easier than what I was trying to do... I suppose it was because I didn't know about  long holding and being able to add another context.

Thanks so much :)

Matt

Matt

unread,
Nov 21, 2017, 4:04:57 AM11/21/17
to Tasker
Hi Pent,

I have been using the Do Not Disturb profile for a few days now and I have noticed it works perfectly at 10pm when activating the profile but at 8:45am it doesn't turn off Do Not Disturb even though I have the timer set from 10am to 8:45am.

I'm not sure if I have done something wrong but I followed your instructions so not too sure why it's not working :(

Thanks

Matt

Matt

unread,
Nov 22, 2017, 1:33:17 PM11/22/17
to Tasker

Hi Guys,

This is how I have my Do Not Disturb profile setup which works great for turning DND on but at 08:45 it doesn't turn off - have I done something wrong?



TASK

PROFILE


Thanks


Matt

Matt

unread,
Nov 24, 2017, 3:01:46 PM11/24/17
to Tasker
Hi all,

Does anyone have any suggestions as to why this doesn't turn off Do Not Disturb?

Yesterday it didn't turn on DND, I had to restart my phone for it to activate.

Thanks

Matt

Rich D

unread,
Nov 24, 2017, 5:13:15 PM11/24/17
to Tasker Google Groups Post

Does anyone have any suggestions as to why this doesn't turn off Do Not Disturb?

Yesterday it didn't turn on DND, I had to restart my phone for it to activate.


start with all the relevant settings here. 

Tasker new doze settings power managment. 



Matt

unread,
Nov 24, 2017, 5:29:25 PM11/24/17
to Tasker
Hi Rich,

Thanks for the reply :) I have checked all those settings and they are all OK so not too sure what else could be stopping it from turning off.

The instructions are a bit out of date but I'm sure I checked in the correct sections.

Any other suggestions?

Thanks :)

Rich D

unread,
Nov 24, 2017, 5:57:47 PM11/24/17
to Tasker Google Groups Post

Any other suggestions?

1.  when posting for help, Always post the most recent profile/ task "Descriptions " and any relevant run logs. 

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

2. Just to clarify your profile should not go inactive on Friday at 8:45.  It will go inactive on Thurs at midnight because you do not have Friday listed in the day context. 


3. If you find the profile is not going active or inactive at the specified "day" and time the first thing to do is activate the run log and check it. Menu / more / run log. This will show if the profile is failing or if the task is failing. 



Matt

unread,
Nov 24, 2017, 6:05:54 PM11/24/17
to Tasker
Hi Rich,

Apologies, I wasn't aware there was an export function. Here's the export for my profile...

Profile: Do Not Disturb Weekdays (3)
Time: From 22:00 Till 08:45
State: Wifi Connected [ SSID:SKY56M0P MAC:* IP:* Active:Yes ]
Day: Sun, Mon, Tue, Wed or Thu
Enter: Do Not Disturb On (8)
A1: Do Not Disturb [ Mode:Alarms ]
A2: Media Volume [ Level:7 Display:Off Sound:Off ]

2. So the profile will not automatically turn off Do Not Disturb on a Friday morning at 08:45? Currently it hasn't turned off any of the days I have had it active.

3. I have activated the log, I presume this will populate when the profile is active?

Thanks

Regards

Matt

Rich D

unread,
Nov 24, 2017, 6:15:52 PM11/24/17
to Tasker Google Groups Post
Enter: Do Not Disturb On (8)
        A1: Do Not Disturb [ Mode:Alarms ]
        A2: Media Volume [ Level:7 Display:Off Sound:Off ]

2. So the profile will not automatically turn off Do Not Disturb on a Friday morning at 08:45? Currently it hasn't turned off any of the days I have had it active.

Ok.



3. I have activated the log, I presume this will populate when the profile is active?


Correct. Please post the log results that show the times the profile should go active and inactive.


When it goes inactive Tasker should 'restore' the dnd setting and restore the media volume.  Perhaps restoring both of these creates a issue.  If I get some some time I will do some testing. 

Matt

unread,
Nov 24, 2017, 6:21:35 PM11/24/17
to Tasker
Thanks, Rich.

I appreciate all the help you have given so far :)

I will post the log when it populates although that will be Monday, alternatively I do have a weekend profile that if it doesn't turn off Do Not Disturb I could post this.

Thanks again Rich

Regards

Matt

Rich D

unread,
Nov 24, 2017, 7:01:29 PM11/24/17
to Tasker Google Groups Post


I will post the log when it populates although that will be Monday, alternatively I do have a weekend profile that if it doesn't turn off Do Not Disturb I could post this.

The best way to troubleshoot these issues is to get problem down to its  simplest form.  I would suggest making a new test profile with with just a time context that you can set to activate currently and deactivate in 5 min. and just do the dnd setting. if that works add the volume setting, if that works add the day context.  if all that works then disable that profile but save it for future testing, then and wait to see if your other profiles work. Use the run log and view it after each test to get accustomed to what it should look like. 

If you post run log results be sure to post the profile description for that log.

Matt

unread,
Nov 25, 2017, 7:00:24 AM11/25/17
to Tasker
So I have just edited my profile to run on a Saturday between 11:44 and 11:54, the only thing I changed was the date and it worked fine by turning off the Do Not Disturb - maybe it's when it gets to the next day is where the problem occurs? Anyway here's the logs, I think I have exported these correctly, if not would someone be able to tell me how to export it please.

PROFILE

Profile: Do Not Disturb Weekdays (3)

Time: From 11:43 Till 11:53


State: Wifi Connected [ SSID:SKY56M0P MAC:* IP:* Active:Yes ]

Day: Sat


Enter: Do Not Disturb On (8)
A1: Do Not Disturb [ Mode:Alarms ]
A2: Media Volume [ Level:7 Display:Off Sound:Off ]


LOG


20171125 11.44.22 M Restart ID0:0.0 Monitor
20171125 11.44.22 P Active ID3 Do Not Disturb Weekdays
20171125 11.44.22 E Start ID0:0.0 TaskService
20171125 11.44.22 T Running ID8 Do Not Disturb On
20171125 11.44.23 A OK ID8.1 Do Not Disturb On.Do Not Disturb
20171125 11.44.23 A OK ID8.2 Do Not Disturb On.Media Volume
20171125 11.44.23 T ExitOK ID8 Do Not Disturb On
20171125 11.44.23 E Stop ID0:0.0 TaskService
20171125 11.54.00 P Inactive ID3 Do Not Disturb Weekdays
20171125 11.54.00 E Start ID0:0.0 TaskService
20171125 11.54.00 T Running ID-15 System
20171125 11.54.00 A OK ID-15.1 Anon.Do Not Disturb
20171125 11.54.00 A OK ID-15.2 Anon.Media Volume
20171125 11.54.00 T ExitOK ID-15 System
20171125 11.54.00 E Stop ID0:0.0 TaskService

Rich D

unread,
Nov 25, 2017, 11:02:28 AM11/25/17
to Tasker Google Groups Post

 maybe it's when it gets to the next day is where the problem occurs?

I should have picked up on this sooner. It is the day context that is the issue. you should  have gotten this warning when you first made the profile. Unfortunately the warning only shows once. I have asked Pent before to put something in the guide about this so I will ask again. I did recently help another user with this issue but his was more complex and took a
"bit" of work. You can read about the ordeal here.



Give it a read. it should start you in the right direction. the other user was looking for every other week so it got a bit more complex. Let me know if you can not extract a working profile for your use and I will try to put something together for you. All my tests indicate the final version worked but again this included the every other week option. 



Rich D

unread,
Nov 25, 2017, 11:05:08 AM11/25/17
to Tasker Google Groups Post
forgot the warning..
Screenshot_20171125-094027.png

Matt

unread,
Nov 25, 2017, 1:59:54 PM11/25/17
to Tasker
Hmmm I have never seen that warning when using Tasker.

So basically what I need to do is to create multiple profiles which will turn it on and off at certain times? I think I'm going to need some time to see if I can work this out, looks very involved :)

I will let you know how I get one Rich, again thanks for all your help with this :)

Scott Miller

unread,
Nov 25, 2017, 2:59:29 PM11/25/17
to tas...@googlegroups.com
Try this. Add your own task as the enter task in the Main Profile. Keep in mind that time contexts are active until the end of the minute selected. And they don't cross over midnight, which you are now aware of.

Profile: First Day (159)
Time: From 10:00PM Till 11:59PM
Day: Sun
Enter: StopTaskTime (163)
A1: Stop [ With Error:Off Task: ] 

Profile: All Week (161)
Time: From 10:00PM Till  8:30AM
Day: Mon, Tue, Wed or Thu
Enter: StopTaskTime (163)
A1: Stop [ With Error:Off Task: ] 

Profile: Last Day (160)
Time: From 12:00AM Till  8:30AM
Day: Fri
Enter: StopTaskTime (163)
A1: Stop [ With Error:Off Task: ] 

Profile: Main Profile (162)
State: Profile Active [ Name:First DAY/All Week/Last Day ]
Enter: YourTaskHere (163)
A1: Stop [ With Error:Off Task: ] 


Scott M.

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Rich D

unread,
Nov 25, 2017, 3:33:17 PM11/25/17
to Tasker Google Groups Post

Try this. Add your own task as the enter task in the Main Profile.


Interesting approach. Do you use this?


. And they don't cross over midnight, which you are now aware of.

The whole idea is to get them to cross over midnight with a day context. How would you use this for what the OP is looking for?
 

Matt

unread,
Nov 25, 2017, 3:41:54 PM11/25/17
to Tasker
Thanks Scott, I have tried to add this to Tasker, have I done this correctly?

TASK:

StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb On ]

FIRST DAY PROFILE:

Profile: First Day (18)
Time: From 22:00 Till 23:59
State: Wifi Connected [ SSID:SKY56M0P MAC:* IP:* Active:Yes ]
Day: Sun
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb On ]

ALL WEEK:

Profile: All Week (20)
Time: From 22:00 Till 08:45
State: Wifi Connected [ SSID:SKY56M0P MAC:* IP:* Active:Yes ]
Day: Mon, Tue, Wed or Thu
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb On ]

LAST DAY:

Profile: Last Day (21)
Time: From 00:00 Till 08:45
Day: Fri
State: Wifi Connected [ SSID:SKY56M0P MAC:* IP:* Active:Yes ]
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb On ]

MAIN PROFILE:

 Profile: Main Profile (22)
State: Profile Active [ Name:First Day/All Week/Last Day ]

Scott Miller

unread,
Nov 25, 2017, 4:01:56 PM11/25/17
to tas...@googlegroups.com
Don't modify the the three profiles with the time contexts. Only modify the profile with the active profile context.

Scott M.

Scott Miller

unread,
Nov 25, 2017, 4:04:28 PM11/25/17
to tas...@googlegroups.com
I don't currently use this approach, but I have. My comment about not crossing midnight refers to the individual time context. If you don't select specific days, it appears that it does cross over. But when selecting specific days, the time contexts stops at midnight of the last day selected. This is what Pent's warning is referring to.

Scott M.

Matt

unread,
Nov 25, 2017, 4:07:55 PM11/25/17
to Tasker
Sorry Scott, I'm not sure what you mean, do you mean I should only have the time on the Main Profile and not the other three? Or to change it back to 08:30am?

Thanks :)

Scott Miller

unread,
Nov 25, 2017, 4:21:54 PM11/25/17
to tas...@googlegroups.com
No. Add your Wi-Fi connected context to the Main Profile, not to the other three. The only thing in the other three profiles should be the time and day contexts, for the profile activation, and the stop task. The main profile will detect if any of the other three are active, and when combined with your Wi-Fi connected context, will activate your do not disturb task.

Scott M.

On Nov 25, 2017 4:08 PM, "Matt" <mattm...@gmail.com> wrote:
Sorry Scott, I'm not sure what you mean, do you mean I should only have the time on the Main Profile and not the other three? Or to change it back to 08:30am?

Thanks :)

Matt

unread,
Nov 25, 2017, 4:29:10 PM11/25/17
to Tasker
Ah! That makes sense :)

I will report back if it works tomorrow :) fingers crossed.

Thanks for helping out :)

Matt

unread,
Nov 25, 2017, 5:07:30 PM11/25/17
to Tasker
Hi All,

Sorry I should have said that Monday - Friday I would like it to activate Do Not Disturb from 10pm until 08:45am and then on Saturday and Sunday activate Do Not Disturb at 10pm until 10:30am.

Again, I'm sorry guys - would it be easy to adjust the one Scott posted for this to work or is it a lot more involved like the one Rich posted a few hours ago?

Thanks

Matt

Scott Miller

unread,
Nov 25, 2017, 6:16:30 PM11/25/17
to tas...@googlegroups.com
You should be able to adjust what I suggested. You might need more profiles with time contexts to cover the situation, but that's all. Put your requirements on a calendar. It might help to visualize what you need. Just keep in mind, for example,  that when the profile starts at 10:00 PM on Saturday it ends at 10:30 on Sunday. The day changes at midnight, and that is significant to this approach. Any given day is midnight AM until 11:59 PM. Give it a shot, then post what you came up with.

Scott M.

Rich D

unread,
Nov 25, 2017, 6:17:09 PM11/25/17
to Tasker Google Groups Post


Sorry I should have said that Monday - Friday I would like it to activate Do Not Disturb from 10pm until 08:45am and then on Saturday and Sunday activate Do Not Disturb at 10pm until 10:30am.


I think it is obvious but just for clarity you would want 
active on Fri at 10 pm 
Inactive on Sat 10:30 am
Active Sat 10:00pm
Inactive sun 10:30 am
Active sun 10:00pm
Inactive Mon 8:45 am

Correct.





Again, I'm sorry guys - would it be easy to adjust the one Scott posted for this to work or is it a lot more involved like the one Rich posted a few hours ago?

Adjusting Scott's approach should not be difficult. 

Matt

unread,
Nov 26, 2017, 8:21:00 AM11/26/17
to Tasker
Thanks Rich and Scott, I will see if I can get a grip on what Scott's idea is doing at the moment and adjust it for my needs.

I'll report back with my workings.

Thanks again guys.

Matt

unread,
Nov 26, 2017, 11:23:37 AM11/26/17
to Tasker
So I have given this a go and I must be doing something wrong as it has activated Do Not Disturb already. Here's what my profiles and tasks look like - is there anything obviously wrong with this?

TASKS:

StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb ]

Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

PROFILES:

Profile: Sunday Off (18)
Time: From 10:45 Till 21:59


Day: Sun
Enter: StopTaskTime (19)

A1: Stop [ With Error:Off Task:Do Not Disturb ]

Profile: Sunday On (7)
Time: From 22:00
Day: Sun
Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Profile: Monday Off (9)
Time: From 08:45
Day: Mon
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb ]

Profile: Monday On (10)
Time: From 22:00
Day: Mon
Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Profile: Tuesday Off (11)
Time: From 08:45
Day: Tue
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb ]

Profile: Tuesday On (12)
Time: From 22:00
Day: Tue
Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Profile: Wednesday Off (13)
Time: From 08:45
Day: Wed
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb ]

Profile: Wednesday On (14)
Time: From 22:00
Day: Wed
Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Profile: Thursday Off (15)
Time: From 08:45
Day: Thu
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb ]

Profile: Thursday On (16)
Time: From 22:00
Day: Thu
Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Profile: Friday Off (17)
Time: From 08:45
Day: Fri
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb ]

Profile: Friday On (20)
Time: From 22:00
Day: Fri
Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Profile: Saturday Off (21)
Time: From 10:45 Till 21:59
Day: Sat
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb ]

Profile: Saturday On (23)
Time: From 22:00
Day: Sat
Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Profile: Main Profile (22)
State: Profile Active [ Name:Friday Off/Friday On/Monday Off/Monday On/Saturday Off/Saturday On/Sunday Off/Sunday On/Thursday Off/Thursday On/Tuesday Off/Tuesday On/Wednesday Off/Wednesday On ]


State: Wifi Connected [ SSID:SKY56M0P MAC:* IP:* Active:Yes ]

Enter: Do Not Disturb (24)


A1: Do Not Disturb [ Mode:Alarms ]

A2: Media Volume [ Level:6 Display:Off Sound:Off ]

Thanks

Matt

Scott Miller

unread,
Nov 26, 2017, 1:17:31 PM11/26/17
to tas...@googlegroups.com
Yeah, you're way off here. You don't need both on and off profiles, for starters. And you need to specify both a begin time and an end time, otherwise the time context is an event, not a state. And do not place your "do not disturb" tasks in any of the time profiles. It should only be in the "main profile" profile. And you don't need to have individual time profiles for each day unless the time for that day is different than other days. I think you can probably do this with two time profiles and the main profile.

The "main profile" profile that you are showing would be active always, because you included both your "on" time profiles and your "off" time profiles. You only want the "on" profiles. You do not need the "off" profiles at all.

Scott M. 

Rich D

unread,
Nov 26, 2017, 1:17:32 PM11/26/17
to Tasker Google Groups Post


So I have given this a go and I must be doing something wrong as it has activated Do Not Disturb already. Here's what my profiles and tasks look like - is there anything obviously wrong with this?


WHOOOOAAAA.. Way to many profiles. It should look almost identical to Scott's posted approach. You just need the one profile for all the week days and your dnd task just goes in the Main profile not any of the day profiles. You will just need to change the the first day and last day profiles a bit. But this all depends on you answer to my previous unanswered  question.


I think it is obvious but just for clarity you would want 
active on Fri at 10 pm 
Inactive on Sat 10:30 am
Active Sat 10:00pm
Inactive sun 10:30 am
Active sun 10:00pm
Inactive Mon 8:45 am

Correct?




Matt

unread,
Nov 26, 2017, 1:39:39 PM11/26/17
to Tasker
Ooo sorry Rich, I read it more a rhetorical question as thought you were showing me what I need to do in the profiles. You are correct with the times you posted and Monday would be the same as Tuesday, Wednesday, Thursday and Friday.

What I don't understand in the one you done Scott is on the 'All Week' profile you have a time of 22:00 til 08:45 but I thought that the time context doesn't recognise when it goes on to the next day?

Scott Miller

unread,
Nov 26, 2017, 2:02:22 PM11/26/17
to tas...@googlegroups.com
It doesn't. That means the state is active on a given day, say Tuesday, from midnight to 8:30am, then again at 10:00 pm until midnight. When you put multiple days on the profile, it simply appears to cross over midnight, but in reality that is a different day. 

Find an appointment calendar that has the birds of the day on it, from midnight to midnight. Draw a line on a given day that matches the time you want the state to be active. This would diagram the idea. If you put multiple days together, it appears to be continuous but it's not.

Scott M.

On Nov 26, 2017 1:39 PM, "Matt" <mattm...@gmail.com> wrote:
Ooo sorry Rich, I read it more a rhetorical question as thought you were showing me what I need to do in the profiles. You are correct with the times you posted and Monday would be the same as Tuesday, Wednesday, Thursday and Friday.

What I don't understand in the one you done Scott is on the 'All Week' profile you have a time of 22:00 til 08:45 but I thought that the time context doesn't recognise when it goes on to the next day?

Scott Miller

unread,
Nov 26, 2017, 2:23:50 PM11/26/17
to tas...@googlegroups.com
I hate spell check on these devices. That was supposed to be hours, not birds.

Scott M.

Matt

unread,
Nov 26, 2017, 2:33:20 PM11/26/17
to Tasker
Ahhh so what you mean is if the time is from 10pm until 10am that is the 24 hours and it's not reset at midnight?

If that is the case I shall try and have a go at editing your profiles and post my results.

Matt

unread,
Nov 26, 2017, 3:47:23 PM11/26/17
to Tasker
What I'm also having trouble getting to grips with is this profile...

Profile: All Week (25)


Time: From 22:00 Till 08:45

Day: Mon, Tue, Wed or Thu
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task:Do Not Disturb On ]

Why does this say on Monday, Tuesday, Wednesday and Thursday between 10pm and 8:45am turn off Do Not Disturb? This is when I want DND on.

I'm struggling to understand how the profile works and what I need to change for it to work how I want with the weekends at a different time.

Scott Miller

unread,
Nov 26, 2017, 5:04:30 PM11/26/17
to tas...@googlegroups.com
First, my post was an example, not a solution.It requires adjusting to work exactly how you want. You need to look at the entire example, not just a piece of it, to understand the process. My example did not include weekends, because you originally did not mention that. Friday was specified in a separate profile, as was Sunday. As for why the do not disturb is in there, I don't know. That's not how I posted it. It should not be in that step, because doing so indicates you want to stop that task. When nothing is specified, it means to stop the current task. Go back and look at my original post in this thread.

Once again, the time based profiles should not have any of your do not disturb actions included. None. Zero. The only purpose of those profiles is to notify the Main profile that an appropriate time of day has been reached. The main profile uses the fact that one of the other profiles is active combined with your Wi-Fi connected state to activate your do not disturb task. 

Scott M.

Matt

unread,
Nov 26, 2017, 5:53:26 PM11/26/17
to Tasker
Ah I didn't realise it wasn't a working solution for what I presiously stated, also I wasn't aware that having the stop without entering a task stopped the current task, this is why I entered my task.

I've got pretty much everything how you put it down with the addition of the WiFi Connected but when it says A1 on the Main Profile, I'm not too sure how to add this one as well or is it meant to be an Exit Task?


Profile: Main Profile (162)
State: Profile Active [ Name:First DAY/All Week/Last Day ]
Enter: YourTaskHere (163)
A1: Stop [ With Error:Off Task: ]

This is what I currently have without the addition of the Weekends which I will try and work on when I have got this one working.

Profile: All Week (25)
Time: From 22:00 Till 08:45
Day: Mon, Tue, Wed or Thu
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task: ]

Profile: First Day (27)
Time: From 22:00 Till 23:59
Day: Sun
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task: ]

Profile: Last Day (28)
Time: From 00:00 Till 08:45
Day: Fri
Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task: ]

Profile: Main Profile (26)

State: Profile Active [ Name:First Day/All Week/Last Day ]
State: Wifi Connected [ SSID:SKY56M0P MAC:* IP:* Active:Yes ]
Enter: Do Not Disturb On (8)

A1: Do Not Disturb [ Mode:Alarms ]
A2: Media Volume [ Level:7 Display:Off Sound:Off ]

Does this look right as it's currently not activating Do Not Disturb.

P.S - Sorry for being such a dumbass when it comes to this, I just need to get my head around how this all works properly.

Thanks

Matt

Scott Miller

unread,
Nov 26, 2017, 7:00:37 PM11/26/17
to tas...@googlegroups.com
In my example, the A1 task in the Main Profile was simply a place holder. You correctly replaced that task in your version. As far as I can see, the version you provided here looks correct. As for why it's not activating do not disturb, I don't know what time zone you are in. Where I am, it's not 10:00 PM (Sunday, 22:00) yet, so it should not be activated.

I'll give you a hint about adding the weekend profiles. It's actually simpler to solve when you include that. It only needs two time profiles, not three, in addition to the main profile.


Scott

Rich D

unread,
Nov 26, 2017, 7:17:45 PM11/26/17
to Tasker Google Groups Post

Does this look right as it's currently not activating Do Not Disturb.

All looks good to me. It should activate dnd at 10:00 pm tonight, correct ?







P.S - Sorry for being such a dumbass when it comes to this, I just need to get my head around how this all works properly.

No problem, This is the best way to learn. I would suggest going back and re-reading the warning I posted very early in the thread. It explains exactly how the time context works (that tries to span midnight) when there is a day context as well. Read and understand that then follow the profile activation and deactivation times through the week and you should be able to grasp the way things are working and figure out the weekend times. It is important to remember that if the times do not try to span midnight then the time context will work as usual. IE  in the first day profile the times are 22:00-23:59 so this will work as usual but the all week profile tries to span midnight (22:00- 8:45am(the following day)) so this will work as described in the warning. 

Matt

unread,
Nov 27, 2017, 7:53:19 AM11/27/17
to Tasker
Hi Rich/Scott,

I'll have to play around with it when I have finished work and see what I can come up with especially as it's a lot more simpler with the weekend included :)

I'm in the UK so at the time of writing this it is currently 12:52pm - the profile didn't activate at 10pm which was strange as everything was copied correctly from what I can see but I will be editing it for the weekends as well so will see if it works later when I have had a play around.

I will also look at the screenshot again Rich and see if that helps me more :)

Thanks for all the help you have given me so far guys.

Matt

Matt

unread,
Nov 27, 2017, 9:34:23 AM11/27/17
to Tasker
I just done a test with this one and changed my phones time back to Saturday and Sunday just gone and it turned DND on at 10pm and off at 10:45am - does this look like it should work to you guys?

Profile: All Week (25)
Time: From 22:00 Till 08:45

Day: Mon, Tue, Wed, Thu or Fri


Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task: ]

Profile: Weekends (27)
Time: From 22:00 Till 10:45
Day: Sun or Sat


Enter: StopTaskTime (19)
A1: Stop [ With Error:Off Task: ]

Profile: Main Profile (26)
State: Profile Active [ Name:All Week/Weekends ]

Scott Miller

unread,
Nov 27, 2017, 9:45:40 AM11/27/17
to tas...@googlegroups.com
Yes, that looks correct to me.

Scott

Matt

unread,
Nov 27, 2017, 10:17:01 AM11/27/17
to Tasker
Woohoo :) we got there in the end.

If there are any problems with it I will let you guys know.

Thanks so much Rich and Scott :)

Matt

Matt

unread,
Nov 28, 2017, 4:22:12 AM11/28/17
to Tasker
So today the Do Not Disturb option didn't turn off :'( it recognises it should stop any tasks but it hasn't turned DND off at 08:45am.

Here's a screenshot of the logs...

Rich D

unread,
Nov 28, 2017, 4:57:49 AM11/28/17
to Tasker Google Groups Post

So today the Do Not Disturb option didn't turn off :'( it recognises it should stop any tasks but it hasn't turned DND off at 08:45am.

The log shows Tasker restarting at 6:57.10  and this "restarted/ activated" the profile.

 Did you reboot your device?

At 8:46 you can see the media volume being reset (the negative ID number is a Tasker system task that does the restore settings) you should have seen the dnd being restored as well. It could be a bug within tasker but this all depends on exactly what happened with the device in the time period Tasker was not running. 

In my view what happened was the media volume was changed in this time period. Because if dnd was still 'on' when the profile was restarted, then it would try to restore dnd to 'on' when the profile went inactive and Tasker is smart enough to know it is already on so it does not run the action to restore it.  So if we assume Tasker is running as expected then the media volume must have changed in this time.

If you are fine with setting the media volume to a "preset" volume instead of restoring it to the volume it was before the profile ran then,  to avoid this in the future I think it would be wise for you to simply add  'set media volume' and the 'dnd off' actions to a exit task of the main profile. This will automatically stop Tasker from trying to 'restore' those settings and simply 'set' them when the profile goes inactive. This will avoid any issues with a reboot or Tasker getting killed by android. 

Matt

unread,
Nov 28, 2017, 5:36:09 AM11/28/17
to Tasker
Hi Rich,

I didn't reboot my device, I was fast asleep at that time and my phone was plugged into the charger so it wouldn't have turned off or restarted.

How would I do a task that sets Do Not Disturb off as the only options are None, Priotity, Alarms and All. I will remove all media volume tasks as this isn't a big deals to be honest, I can just turn the sound down when I need to for this :)

Thanks

Matt

Rich D

unread,
Nov 28, 2017, 6:20:35 AM11/28/17
to Tasker Google Groups Post
I didn't reboot my device, I was fast asleep at that time and my phone was plugged into the charger so it wouldn't have turned off or restarted.

So it must have been Android that killed Tasker. Do you have Tasker set to run in foreground in Tasker preferences?


How would I do a task that sets Do Not Disturb off as the only options are None, Priotity, Alarms and All. 

I would assume it would be none. But you should test to confirm that. 


I
will remove all media volume tasks as this isn't a big deals to be honest, I can just turn the sound down when I need to for this :)

There's really no problem leaving it in there if you want it set to a known volume on exit of the profile. 

Scott Miller

unread,
Nov 28, 2017, 6:41:57 AM11/28/17
to tas...@googlegroups.com
In addition to creating and using an exit task, because your profile activates and deactivates with your Wi-Fi connected state, make sure that you have the setting (in Android) Keep Wi-Fi on during sleep set to always. For testing purposes, you might want to remove the Wi-Fi connected state until you are certain things are working. 

You should also make sure that Tasker is not battery optimized, as well.

Scott M.

Matt

unread,
Nov 28, 2017, 7:42:14 AM11/28/17
to Tasker
So it must have been Android that killed Tasker. Do you have Tasker set to run in foreground in Tasker preferences?

I do have Tasker to run in the foreground in the preferences. 

I would assume it would be none. But you should test to confirm that. 

OK, I will set this to none and test it :)  

There's really no problem leaving it in there if you want it set to a known volume on exit of the profile.  

I have removed it just to make it easier. 

In addition to creating and using an exit task, because your profile activates and deactivates with your Wi-Fi connected state, make sure that you have the setting (in Android) Keep Wi-Fi on during sleep set to always. For testing purposes, you might want to remove the Wi-Fi connected state until you are certain things are working. 

I have just checked this setting and the WiFi is set to Always already so it couldn't have been the WiFi disconnecting either.

You should also make sure that Tasker is not battery optimized, as well.

If this means going into Settings -> Apps -> 3 dot menu -> Special Access -> Optimise Battery Usage -> turning off Tasker, then I have just disabled it.

----------------------

I will test with an exit task and see if it work tomorrow morning and get back to you to let you know the outcome :)

Thanks again guys.

Matt

Matt

unread,
Nov 29, 2017, 4:04:33 AM11/29/17
to Tasker
Unfortunately adding the exit task of Do Not Disturb set to None changes Do Not Disturb to Alarms muted and not turn it off :(.

Here's the log...
Screenshot_20171129-090109.jpg

Rich D

unread,
Nov 29, 2017, 4:56:02 AM11/29/17
to Tasker Google Groups Post

Unfortunately adding the exit task of Do Not Disturb set to None changes Do Not Disturb to Alarms muted and not turn it off :(.

Sorry, I do no use dnd so the 'none' setting was just a guess. When I said you should test I simply meant to run the task manually with the play button to make sure it sets dnd correctly (before waiting for the profile too fire the task :)  ). After testing on my device it looks like to turn "off" dnd you need to use the "all" option. 

When you are in the task edit screen there is a play button in the lower right. Check the userguide under 'task edit'. 

So to test just run the 'do not disturb on' task with the play button and check the android dnd settings then run the 'do not disturb off' task with the play button and check the android dnd settings again. 


The good news is the profiles did work as expected even though Tasker was killed again. 

 Something (most likely android)  seemed to kill Tasker again at 7:23 am.   Do you have any task  killing apps installed? Do you have any apps scheduled to do things at this time in the AM ? 

Matt

unread,
Nov 29, 2017, 5:19:38 AM11/29/17
to Tasker
Sorry, I do no use dnd so the 'none' setting was just a guess. When I said you should test I simply meant to run the task manually with the play button to make sure it sets dnd correctly (before waiting for the profile too fire the task :)  ). After testing on my device it looks like to turn "off" dnd you need to use the "all" option.

Ah, I wasn't aware that could be done. I have just tested both tasks with Do Not Disturb set to all and it looks like it has turned off Do Not Disturb, fingers crossed this will work correctly tomorrow morning.

The good news is the profiles did work as expected even though Tasker was killed again. 

 Something (most likely android)  seemed to kill Tasker again at 7:23 am.   Do you have any task  killing apps installed? Do you have any apps scheduled to do things at this time in the AM ?

I have no idea what could be killing Tasker as I have adjusted all the settings so Tasker doesn't get killed, I haven't got any apps that run around that time as I am usually in bed, the only thing that goes off is my alarm at 8:30am, I have started using AMDroid for that instead of the one that comes with Android due to the functions of being able to have off days such as bank holidays etc...

Not too sure if there's any way to find out what app is killing Tasker?

Thanks Rich

Matt

Rich D

unread,
Nov 29, 2017, 5:52:54 AM11/29/17
to Tasker Google Groups Post

Not too sure if there's any way to find out what app is killing Tasker?


The way I would suggest is to diligently  Google the issue. If you can not find a solution then post a new thread here with a appropriate subject title and ask for help. Be sure to include any relevant  info you found in your searches and the run log that shows Tasker restarting.  It is a 'Monitor start'  in the run log that indicates Tasker has just restarted. Not to be confused with a 'monitor restart'
 Wich is a normal thing to see in the run log. 

Matt

unread,
Nov 29, 2017, 6:13:59 AM11/29/17
to Tasker
The way I would suggest is to diligently  Google the issue. If you can not find a solution then post a new thread here with a appropriate subject title and ask for help. Be sure to include any relevant  info you found in your searches and the run log that shows Tasker restarting.  It is a 'Monitor start'  in the run log that indicates Tasker has just restarted. Not to be confused with a 'monitor restart'
 Wich is a normal thing to see in the run log. 

I will have a look to see if I can find anything but if not I suppose it's not a major deal that it's being closed as it opens up straight away so it's only closed for 1 second.

Rich B

unread,
Nov 29, 2017, 2:31:08 PM11/29/17
to Tasker
I had trouble figure out which DND option to select when I first started using DND instead of setting sounds manually. You might find my comments here helpful: https://groups.google.com/forum/#!topic/tasker/VBAyc-qemyE. I'll try to find the other thread I was involved in where each of the options was listed out.

Matt

unread,
Nov 29, 2017, 2:48:14 PM11/29/17
to Tasker
Thanks Rich :) How I have it set up seems to be working now and as I don't have any special requirements for vibrating or anything like you did mine is just a simple case of turning DND on and turning it off in the morning :)

Matt

unread,
Nov 30, 2017, 4:03:50 AM11/30/17
to Tasker
Hi Rich and Scott,

Just wanted to let you know that everything is now working as I wanted it to :)

Thanks so much for all of your help.

Matt

Reply all
Reply to author
Forward
0 new messages