Weekly "quiet time" schedule without too many profiles?

95 views
Skip to first unread message

Soudane GMTA

unread,
Sep 23, 2023, 9:55:16 AM9/23/23
to Tasker
I'm looking for a way for Tasker to manage a weekly "Quiet Time" schedule. During the specified hours on any given day, I want turn on and off phone ringing and notification sounds, and I want to modify a few other settings.

For example:
MondayQuiet:  00:00 to 09:00 and 22:00 to 23:59
TuesdayQuiet: 00:00 to 09:00 and 22:00 to 23:59
... etc. ...
SaturdayQuiet: 00:00 to 10:30
... etc. ...

I already know how to do this with multiple profiles, one for each day of the week and time period. However, I'm wondering if there is a simpler way to do this in Tasker without a large number of profiles ... or possibly using plugins or other 3rd party software in conjunction with Tasker.

Thank you in advance for any ideas and suggestions.

Soudane GMTA

unread,
Sep 23, 2023, 10:55:18 AM9/23/23
to Tasker
PS: Just to be clear ...

There could be multiple time periods per day where I want quiet time. For example:

WednesdayQuiet: (00:00 to 09:00) and (11:00 to 12:00) and (14:30 to 16:00) and (17:30 to 19:00) and (22:00 to 23:59)

Again, I know how to do this with multiple profiles, but is there a way to keep the number of profiles very low?

aa6vh

unread,
Sep 23, 2023, 11:01:13 AM9/23/23
to Tasker
You can use Tasker Global variables for the times, and just reset them appropriately for the next quiet time.

Variable Set %QUIETSTART to 22.00
Variable Set %QUIETEND to 23.59



Profile QuietTime
Start %QUIETSTSTART
End %QUIETEND

Soudane GMTA

unread,
Sep 23, 2023, 11:04:54 AM9/23/23
to Tasker

Thank you, and yes, I understand. But those variables need to change at least once a day, and maybe several times a day. How do I trigger the change of those variables multiple times during the week and sometimes multiple times during any given day, without having to utilize lots of profiles?

aa6vh

unread,
Sep 23, 2023, 11:16:40 AM9/23/23
to Tasker
Use the exit task of your QuietTime profile to set those variables to the next quiet time. You will have to come up with the logic yourself for that, of course.

aa6vh

unread,
Sep 23, 2023, 11:30:24 AM9/23/23
to Tasker
And there is a lots of ways of doing that:
 If today is Monday then
   If %TIME > morning time then evening times else morning times
elseIf today is Tuesday then ...

I would suggest using 6.00 vs 6:00 (Tasker accepts both for time), since 6.00 can be used in math comparisons.

aa6vh

unread,
Sep 23, 2023, 11:36:39 AM9/23/23
to Tasker
Perhaps a better way:
If today is Monday then
   if %TIME > evening time then Tuesday's morning times
   elseIf %TIME > morning time then evening times
   else morning times
elseIf today is Tuesday then ...

Soudane GMTA

unread,
Sep 23, 2023, 1:11:48 PM9/23/23
to Tasker
Oh, yes, I forgot about exit tasks. Thank you!

This will require a big nested "if" statement in the exit task, but at least that's better than a lot of profiles.

I know how to do this.

Soudane GMTA

unread,
Sep 23, 2023, 1:13:30 PM9/23/23
to Tasker
... and thank you for the further suggestions. Now that I remember about exit tasks, constructing the logic in that task is not a major challenge for me.

Soudane GMTA

unread,
Sep 23, 2023, 2:24:38 PM9/23/23
to Tasker
Just for the record ...

To get the current day of the week, it's in the %DAYW variable, and to get the current time in HH.MM format, all that needs to be done is to utilize the "Parse/Format Date Time" action with the format string "HH.mm".

aa6vh

unread,
Sep 23, 2023, 2:37:59 PM9/23/23
to Tasker
Yes, %DAYW. I can never remember either, so I just "flash" the variable to see what's in it.

%TIME returns HH.mm (period instead of colon), so you can just do that.

Soudane GMTA

unread,
Sep 23, 2023, 5:06:54 PM9/23/23
to Tasker
I forgot about %TIME using period as a separator. Thank you!

Rich D

unread,
Sep 23, 2023, 5:07:37 PM9/23/23
to Tasker Google Groups Post
Not to throw a wrench in the works but I honestly think for organizational ease, making profiles for each event time would be the easiest.  There is not much overhead involved in having additional profiles and you will end up with a very comprehensive list that is easy to view, edit and add or delete from. When viewing the list you will be able to see all the times and days.  You can link all these profiles to the same task.  So you would end up with 7 core profiles 1 for every day of the week. Each one would have a Time contex and a Day Contex.  To add another profile you can use the "Clone" option. Then you just need to adjust the time. That would be all that's involved in creating additional profiles for that day. Deleting is very easy as well.  So you can have a organized list by days all in one project tab.  This will be far easier to create and maintain than creating a massive amount of IF conditions. 


The other option is to get you calendar involved and set up all your times as calendar events, However the liner list of profiles would still be more comprehensive to manage...


Just my Humble opinion....  :)

Soudane GMTA

unread,
Sep 23, 2023, 5:14:03 PM9/23/23
to Tasker
I understand. But also, it's more than 7 profiles, because as I mentioned above, I want multiple quiet-time periods on certain days, such as is shown in this example ...


WednesdayQuiet: (00:00 to 09:00) and (11:00 to 12:00) and (14:30 to 16:00) and (17:30 to 19:00) and (22:00 to 23:59)

In total, there would be 12 to 15 separate profiles, because I want a few multiple-profile days.

Rich D

unread,
Sep 23, 2023, 5:24:04 PM9/23/23
to Tasker Google Groups Post
Yes, I realize that. But even that number of profiles is of no consequence to tasker.   You can literly create all these profiles in under 5 minutes. By using the clone option (long press profile name -> 3 dot menu -> Clone ) . Then just change a few parameters.  Tasker also allows you to use the same name for profiles so you could use "Monday" for all of your Monday profiles or if you want you can do 

Monday A
Monday B
Monday C


That way if you sort your profile list alphabetical they Will alway be in the correct otrder

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/6ca2be73-59ca-42e2-b813-02491a98e334n%40googlegroups.com.

Soudane GMTA

unread,
Sep 23, 2023, 9:12:34 PM9/23/23
to Tasker
I understand, and thank you.

I already knew I could do it this way, but I didn't want to have to manage that many profiles, and that's why I posted this question here to begin with.

If there is any kind of functionality or logic change, I would have to modify 12 or 15 profiles.

But the way I'm doing it, there is one profile, one entry task, and one exit task that I might have to modify.

The exit task has a long "if/else if/else if/else if/.../else/end if' block, and it's just as easy to clone the code between the if's and the else's as it is to clone a profile.

Rich D

unread,
Sep 23, 2023, 10:36:14 PM9/23/23
to Tasker Google Groups Post

If there is any kind of functionality or logic change, I would have to modify 12 or 15 profiles.

But the way I'm doing it, there is one profile, one entry task, and one exit task that I might have to modify.

I believe you would only being Modifying the one linked task and not the triggers. 




The exit task has a long "if/else if/else if/else if/.../else/end if' block, and it's just as easy to clone the code between the if's and the else's as it is to clone a profile.


I personally find it much easier and comprehensive to edit a profile Which just involves selecting options as apposed to actual coding that involves typing and changing IF blocks.

However I am not trying to change your mind, just wanted to point out the benefits of using multiple profiles linked to a single common task as opposed to one profile with many IF conditions .  I have been using Tasker for many years and have found it is always best to do as much contextually as possible.    

As noted before.. Just My Humble Opinion.....   :)





Soudane GMTA

unread,
Sep 24, 2023, 11:15:01 AM9/24/23
to Tasker
I know that you aren't trying to change my mind. To me, we are just having an interesting technical discussion, and I appreciate your comments.

One thing that I do is that for certain days/times, I perform additional tasks when I go in or out of "quiet time". It's easy for me to implement this as follows ...

In my entry task and my exit task, I perform common logic at the top of the task, and then within my "if/else-if/.../end-if" block, I can put the extra, special logic inside of the appropriate if/else blocks.

In order to accomplish this with multiple triggering profiles,. the entry and exit tasks would have to know which profile(s) did the actual triggering, and then perform the additional logic based upon that knowledge. Or I would need multiple entry and exit task versions, and I would have to use these within the appropriate profiles. This also leads to a proliferation of tasks in addition to the existence of lots of profiles.

Rich D

unread,
Sep 24, 2023, 2:07:55 PM9/24/23
to Tasker Google Groups Post

In order to accomplish this with multiple triggering profiles,. the entry and exit tasks would have to know which profile(s) did the actual triggering, and then perform the additional logic based upon that knowledge.


This is easily done with the %caller() array.  This contains details about  the execution order.  You can test for Which profile has called the task. You can even test if it is a Enter call or Exit Call. This allows you to use just one task for both Enter and Exit. I will mostly still use a exit task but it is nice to have that option. 




Or I would need multiple entry and exit task versions,


Definitely not necessary ... :)


Soudane GMTA

unread,
Sep 24, 2023, 7:23:21 PM9/24/23
to Tasker
It's good to learn about caller().  Thank you.

As for my own code, I got rid of my "if/else-if/.../end-if" and refactored it as follows ...

initial stuff
goto %DAYW
(anchor) Sunday
Sunday stuff goes here
goto Finish
(anchor) Monday
Monday stuff goes here
goto Finish
... etc. through Saturday ...
(anchor) Finish
final stuff

For some of the days, the code needs "if" clauses to handle the multiple quiet/non-quiet times for those days. But that's fine with me, because when viewing the code, all the decision-making logic concerning quiet times is in front of me in one place.

Rich D

unread,
Sep 24, 2023, 8:30:07 PM9/24/23
to Tasker Google Groups Post


It's good to learn about caller().  Thank you.

You also have the option oof using the Profiles Active variable  %PACTIVE . This is a comma separated list of all active Profiles.





As for my own code, I got rid of my "if/else-if/.../end-if" and refactored it as follows ...

initial stuff
goto %DAYW
(anchor) Sunday
Sunday stuff goes here
goto Finish
(anchor) Monday
Monday stuff goes here
goto Finish
... etc. through Saturday ...
(anchor) Finish
final stuff

Ahh  yes.. That is a good approach...



Reply all
Reply to author
Forward
0 new messages