Possible bug when restoring old values - Tasker Tips & Tricks

Hi,
recently I noticed this strange behavior in Tasker: after a certain profile exits, the volumes are NOT reset back to their old values.
I created a sample profile, which is triggered by a variable %Test. The enter task would set alarm volume to 1 (current volume is at 6). The restoration setting of the profile is on.
When %Test triggered, volume was set correctly. Then when I changed %Test, the profile exited as expected, restoration process kicked in, alarm volume was restored, however not to 6 but 5.
Looking carefully at the log and also the animation on the sound setting screen, I could notice 2 changes made. The volume was set to 6, THEN quicly to 5.
Why?! Enter task set it once, and exit task reset it twice - at you can clearly see at the top of the screenshot.
Anybody can shed some light here?
Thanks.

Related

Email notification sounds even when phone silent

I've noticed something weird since installing the newest version of advanced config (that might not even be the problem though) and it seems to still be present after uninstalling. But, when I have my phone set to silent (correct me if I'm going crazy), then no notification sounds would normally come through (this is even with the volume set at highest level). The only thing that would work would be system sounds (from videos, music and such). Since setting sound events through adv config now my notifications (only email, not text messaging for some reason) still sounds when my phone is set to silent. I'm sure that shouldn't be happening and the only thing I did was of course, change the sounds using advanced config. Am I losing it or has anyone else noticed the same behavior? One other minor detail. When I set the phone to just vibrate, then (like it should) I get no notification sounds...just vibrate. It's like the silent profile is screwed up somehow.
Think I found the problem and this may have been done by design to allow you to control each system sounds and it's volume separately. Apparently when you set the sounds using adv config it creates a key (InitVol which makes sense) for the volume level you want that particular sound setting to be at. With this key set, it overrides the system volume levels. The key is located at HKEY Current User\ControlPanel\Sounds. Each notification sound is listed in there. Just go into the one you dont want overridden by adv config and delete the InitVol key and all goes back to normal.
Hope this helps out others using the app!
Good tips man, thanks!

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

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 :good:
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?
joguirian said:
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?
Click to expand...
Click to collapse
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.
orville87 said:
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.
Click to expand...
Click to collapse
ok, understood
Thanks

Context/trigger when between a time and plugged in (charging)

I would like to create a task that silences my phone when it's plugged in between 9pm and 3am (when I go to bed I plug in my phone and it would be nice if the phone automatically silenced itself).
There are two problems with this:
1) While I have the ability to create a time based context or a USB connected context, I do not see how to create an "and" condition in your context such that you want your task to fire when both those conditions are met. How do you create a context that will trigger off multiple conditions?
Edit SOLVED: Tap the profile tab and tap on a profile you have until it shows the arrow view with a trigger on the left, a task on the right, and a green arrow between. Long press the trigger on the left of the green arrow and a plus icon will show up to add more triggers.
2) When I look at creating a task for silent mode, the only values available are to turn silent mode off or vibrate. I do not see an option for turning silent mode on. What am I missing? How do people turn the phone to silent using Tasker?
Turn volumes down with Tasker in the audio Section.
Sent from my SM-G930F using XDA-Developers mobile app
If you want it to act like a true silent mode by using the method mentioned by @Josh Smith10
What you could do is store the current volume levels, such as ring, media, alarm etc. Into a variable, then when it's time to exit the profile, just set your volume to those variables that you created. Then clear your custom variable after it has restored to that volume.
So this will restore the previous volume level before silent mode kicked in

How can I set alarm clock few minutes after profile active?

I set in profile task what At a specific time enable wifi and internet radio - that should wake me up.
But if radio don't wake me up I want that few minutes later set/on oryginal alarm clock (where i can set my ring tone or ex. set snooze for 5min/10min or off alarm if I wake up).
I randomly wake up so when i whant that radio wake me up i set time to ON only on tasker profile.
How i can add/what task add to this if I want Get the effect when radio will ON , 5min later clock alarm will ON
try this:
- in profile task, do math on current time, plus x min times 60,
- than convert the result back to normal time format
- do a variable split, splitter empty, to split it by space, to get time only
- you will have to trim possible preceding zero in hour
- than set alarm with the result time
Sorry but You write too complicated for me :|
Can You write this same but maybe on the example and write step by step what to do
Thank so much
Yeah that's far too complicated. Try this.
In your first profile, that turns on your alarm, set a variable %ALARMTIMERCOUNTDOWN =%TIMES+120 (%TIMES is the current time in seconds, and + 120 is two minutes after the current time
Then create a time context profile and click the little tag you change it from time, to variable, and enter %ALARMTIMERCOUNTDOWN as the time.
Then, when the current time=ALARMTIMERCOUNTDOWN the profile will trigger.
Now remember to clear the variable in both exit tasks so if you wake up, the variable will be empty and thus will never trigger
Can You write this step by step. Like this: Go to your profile that turns on your alarm -> in task what enable radio add new variable -> action ("+") -> variables -> add variable - here in "........." write "....... " -> then go to action variable and "set variable" -> ........
In profile I can add new time context and to start time set %ALARMTIMERCOUNTDOWN but i bust add task to this context - what task i should add?
"Now remember to clear the variable in both exit tasks" - I had add variable only on one task "In your first profile, that turns on your alarm, set a variable.... "
someone can help?
gonzolex said:
someone can help?
Click to expand...
Click to collapse
ok, here goes:
new profile1
- trigger: event/date-time/alarm clock: alarm info
- action: set variable %Trigger to %TIMES+120, do math
btw profile2
- trigger: state/variables/values: %TIMES eq %Trigger
- action: do your task

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

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.
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?
ktmom said:
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?
Click to expand...
Click to collapse
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?
I think which ever way gets you where you want to be is the way to go [emoji6]
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.
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.
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.
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?
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.
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.
StoneRyno said:
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.
Click to expand...
Click to collapse
What do you mean "2nd end condition"? A second context (condition) in the profile? Long press the first context.
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.

Categories

Resources