[Tasker Tips & Tricks] Portgas D. Ace:
On the portal news on 2016-03-11 (thanks to [MENTION=7050182]MishaalRahman[/MENTION] 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 :good: