FORUMS

[GUIDE][Difficulty: Intermediate] Entering Night Mode depending on alarm clock state

4,322 posts
Thanks Meter: 3,143
 
By Portgas D. Ace, Recognized Contributor on 10th March 2016, 08:07 AM
Post Reply Email Thread
On the portal news on 2016-03-11 (thanks to @MishaalRahman for this).

This profile requires AlarmPad (either free or Pro version) and will activate your own Night Mode by setting an alarm.

You have to go to work the next morning, are sleeping, dreaming of the ones/things you love and then – BEEEEEEP BEEEEEEP BEEEEEEP – getting woken up by some more or less (most likely less) funny message by one of your friends. Awesome, right? No way… But this comes to an end right now.

Use Alarm Pad in combination with Tasker to set up a Night Mode, where you won’t get disturbed by any loud notification anymore. Activating an alarm will automatically set your phone into silence mode during a specific time, only the alarm is allowed to wake you up. When you dismiss the alarm, the Night Mode will turn itself off automatically. Cool, eh?


So, what do we need? First of all, you have to install AlarmPad (which is a great and customizable alarm clock app with native Tasker integration). Download it by following the above inserted Play Store link and continue with Tasker. Let’s start.

1. First, set up a profile called “Alarm set”. This will set a variable %ALARM to true if the alarm has been set. We need this variable to determine whether an alarm is currently set or not.
Use Event -> Plugin -> AlarmPad and select the Edit button. Choose “Alarm set” and confirm it by clicking the check mark on top right (OPTIONAL: you can choose a specific alarm for this by selecting “Restrict alarm” and then choosing the desired alarm).
Create a new task and name it (for example) “Set Alarm VAR”. Create a new variable %ALARM and set it to true.
Add Audio->Alarm Volume and set it to your desired value (maximum, if you tend to sleep very deep).
Now you are done. You can optionally add a toast notification to verify that the task has been executed, for example Alert -> Flash -> Text “Alarm set”.

2. Create a new profile called “Alarm disabled”. This will set %ALARM to false if the alarm gets disabled manually.
Use Event -> Plugin -> AlarmPad and select the Edit button. Choose “Alarm disabled” and confirm it by clicking the check mark on top right.
Create a new task and name it (for example) “Reset Alarm VAR”. Set variable %ALARM to false.
Add Audio->Alarm Volume and set it to your desired default alarm value when being outside of your house.
Now you are done with it. You can optionally add a toast notification to verify that the task has been executed, for example Alert -> Flash -> Text “Alarm disabled”.

3. Create a new profile called “Alarm playing”. This will set %ALARM to false if the alarm is fired and manually disabled.
Use Event -> Plugin -> AlarmPad and select the Edit button. Choose “Alarm triggered” and confirm it by clicking the check mark on top right.
Create a new task and name it (for example) “Reset Alarm VAR”. Set variable %ALARM to false.
Add Audio->Alarm Volume and set it to your desired default alarm value when being outside of your house.
Now you are done with it.

4. Create a new profile “Night Mode”. This will set your device into silent mode during a specific time interval when an alarm is set.
Use State -> Variables -> Variable Value and enter %Alarm ~ true. Return to your profile and select a new task which you call “Night Mode on”.
Add Task -> Wait -> 1 minute. Return to the task menu.
Add Task -> If and select “%ALARM ~ true”. Return to the task menu.
Add Display -> Display Brightness and set it to 0. Return to the task menu.
Add Audio -> Notification Volume and set it to 0. Repeat the same for Media Volume and Ringer Volume. Add Audio -> Alarm Volume and set it to your desired value. This will ensure that no other profile which might be triggered between setting the alarm and starting the Night Mode task has reset your alarm volume.
At last, add Task -> End If.
That’s it.

5. OPTIONAL: Return to the profile screen and add a trigger event to the profile Night Mode: Time.
Here you can define when the Night Mode will start and when it will end, for example, you set your alarm at 8 p.m., but go to bed at 10 p.m. and don’t want to miss messages until 10 p.m. because of reasons. Then select 10 p.m. as start time and whatever end time you want, for example 10 a.m. (don’t worry, if the alarm is triggered before 10 a.m., the Night Mode will automatically being deactivated and you can receive audio notifications again).

6. Create a new exit task for the profile “Night Mode” and call it “Night Mode off”. This will reset your device from silent mode after the alarm is triggered or manually disabled.
Add Task -> Wait -> 1 minute. Return to the task menu.
Add Plugin ->AlarmPad and select AlarmPad perform Action” and select “Disable” (OPTIONAL: select the alarm that is to be disabled). Confirm and return to the task menu.
Add Display -> Display Brightness and set it to your default brightness. Return to the task menu.
Add Audio -> Notification Volume and set it to your default volume value. Repeat the same for Media Volume and Ringer Volume.
That’s it.

Now we have set up Tasker to toggle your own Night Mode automatically depending on your alarm’s status.

That’s all, folks. Have a nice dreaming
The Following 2 Users Say Thank You to Portgas D. Ace For This Useful Post: [ View ] Gift Portgas D. Ace Ad-Free
10th March 2016, 10:53 AM |#2  
Member
Thanks Meter: 0
 
More
I' not sure if i understand it very well. How can we set the audio volumes (notifications, ringer and media) in silence mode only at one specifit hore (21:00 pe). When i disable the alarm the volumes are set to the default configuration that we have on the phone? And how do they turn off (silent mode) again?
10th March 2016, 11:25 AM |#3  
Portgas D. Ace's Avatar
OP Recognized Contributor
Flag Bergisches Land
Thanks Meter: 3,143
 
More
Quote:
Originally Posted by joguirian

I' not sure if i understand it very well. How can we set the audio volumes (notifications, ringer and media) in silence mode only at one specifit hore (21:00 pe). When i disable the alarm the volumes are set to the default configuration that we have on the phone? And how do they turn off (silent mode) again?

Setting an alarm will trigger the Night Mode profile (and its related task Night Mode on, which sets all notification/media/ringer volumes to 0). If you have set up a time-trigger (for example between 10 p.m. and 10 a.m.) the task will only being executed within this time frame. For example, if you set your alarm at 8 p.m. and have the given time frame from 10 p.m. to 10 a.m., the Night Mode will only being executed if %ALARM is true and it is past 10 p.m. and before 10 a.m. of the following day.
Disabling the alarm will trigger the exit task (Night Mode off) of the Night Mode profile, thus all volumes are set back to their (pre-defined in exit task Night Mode off)volume level.

If you want to silence your phone at 9 p.m., just use a time trigger for the profile and set 9 p.m. as start and whatever you like as end time.
10th March 2016, 11:30 AM |#4  
Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by orville87

Setting an alarm will trigger the Night Mode profile (and its related task Night Mode on, which sets all notification/media/ringer volumes to 0). If you have set up a time-trigger (for example between 10 p.m. and 10 a.m.) the task will only being executed within this time frame. For example, if you set your alarm at 8 p.m. and have the given time frame from 10 p.m. to 10 a.m., the Night Mode will only being executed if %ALARM is true and it is past 10 p.m. and before 10 a.m. of the following day.
Disabling the alarm will trigger the exit task (Night Mode off) of the Night Mode profile, thus all volumes are set back to their (pre-defined in exit task Night Mode off)volume level.

If you want to silence your phone at 9 p.m., just use a time trigger for the profile and set 9 p.m. as start and whatever you like as end time.

ok, understood

Thanks
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