toggle button - how to keep it showing the right state.

271 views
Skip to first unread message

fuzzywu...@gmail.com

unread,
Oct 21, 2024, 5:19:59 PM10/21/24
to Tasker
I have a scene with one of these and have noticed that if I destroy the scene and then reopen it:  the `toggle` state is not preserved.

Is there a way to make it so it remembers and so shows the previous state.

This is if I load the scene; toggle it; exit the scene then come back.
I want it to show the toggled  condition.

Possible?

Rich D

unread,
Oct 21, 2024, 7:14:10 PM10/21/24
to Tasker Google Groups Post

Possible?

Yes. You can do it with Element Depth. Use 2 toggle elements place one exactly over the other one. Tick the ON option in the first one.  In both "Changed" tab tasks  set the global variable %Toggle_scene TO: %new_val.  Then set up the show scene task like  so.. 





    Task: show test button
    
    A1: Flash [
         Text: %Toggle_scene
         Continue Task Immediately: On
         Dismiss On Click: On ]
    
    A2: Create Scene [
         Name: test button ]
    
    A3: Element Depth [
         Scene Name: test button
         Element: Toggle2
         Set Depth: 1 ]
        If  [ %Toggle_scene ~ on ]
    
    A4: Element Depth [
         Scene Name: test button
         Element: Toggle3
         Set Depth: 2 ]
    
    A5: Show Scene [
         Name: test button
         Display As: Overlay, Blocking
         Horizontal Position: 100
         Vertical Position: 100
         Animation: System
         Show Exit Button: On
         Show Over Keyguard: On
         Continue Task Immediately: On
         Allow Outside Boundaries: On
         Blocking Overlay +: On
         Overlay +: On ]
    
    A6: Wait [
         MS: 0
         Seconds: 10
         Minutes: 0
         Hours: 0
         Days: 0 ]
    
    A7: Destroy Scene [
         Name: test button ]
    
     

fuzzywu...@gmail.com

unread,
Oct 21, 2024, 8:25:49 PM10/21/24
to Tasker
Thanks.

(Not against you)
I'm not sure that is doing exactly what I meant, but....

That is going to take some time to understand.

I'm curious what this `element depth` is.
Though that is what you mentioned at the start of your reply.
I'll have to do some digging.
I'm an old fogie and am not good at handling this on my phone, so it isn't I can import it and see what it does.

fuzzywu...@gmail.com

unread,
Oct 21, 2024, 8:39:37 PM10/21/24
to Tasker
Which part of that do I need so I can import it to Tasker and see it running?
Do I need the Task: show test button line?
(And how do I import it in Tasker?)
(May be easier if I see a working version.)

Rich D

unread,
Oct 22, 2024, 5:29:00 AM10/22/24
to Tasker Google Groups Post

--
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/b1e5a4fa-5437-46c5-b6ec-d6391af70878n%40googlegroups.com.

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 5:44:47 AM10/22/24
to Tasker
Thanks, but as I explained:  I don't have the phone......  in this loop  for getting to the forum.
So I am not sure how I am going to get to the link from my phone.
(Yeah, my problem, not yours.)

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 5:53:15 AM10/22/24
to Tasker
I got it loaded - strangely.

Ok, error:

(This is painful)

gee the export is handy, but getting it from the phone to here is not fun.

Hang on and sorry for the pointless posts.
This stuff is really the wild west for me just now.

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 5:55:54 AM10/22/24
to Tasker
Painfully ported to here.

The error:

20.53.20/LicenseCheckerTasker Checking cached only
20.53.20/LicenseCheckerTasker cache validity left -12017277178
20.53.20/LicenseCheckerTasker Cached status: Licensed
20.53.20/LicenseCheckerTasker Cached only: Licensed
20.53.20/TD getStatic: Active load: true - ExecuteService
20.53.20/Scene deepCopy: sticky toggle
20.53.20/SM createScene: already have scene named sticky toggle
20.53.20/E Create Scene: failed to create scene sticky toggle
20.53.20/E result: stop task (error)
20.53.20/E Error: 1
20.53.20/MacroEdit action finished exeID 1 action no 0 code 46 status: Err next 0

Ok, reading it, I can see/read that it is complaining  about the name and it already existing.
Believe me, I don't have one with that name.   Somehow it is/or seems to be tripping over itself.

So I guess I need to close that scene....????   But it isn't visible.

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 6:00:51 AM10/22/24
to Tasker
Ok, update:

New error:

20.57.44/LicenseCheckerTasker Checking cached only
20.57.44/LicenseCheckerTasker cache validity left -12017541556
20.57.44/LicenseCheckerTasker Cached status: Licensed
20.57.44/LicenseCheckerTasker Cached only: Licensed
20.57.44/E Action requires accessibility but the accessibility service is disabled. Notification posted.
20.57.44/E result: stop task (error)
20.57.44/E Error: 1
20.57.44/MacroEdit action finished exeID 1 action no 3 code 47 status: Err next 3

Sorry.

Rich D

unread,
Oct 22, 2024, 6:01:05 AM10/22/24
to Tasker Google Groups Post
Yes.. I should have put a destroy scene action as the very first action in the task. 

You can manually run the destroy scene action from the task or..
 

If you open the scene for editing, that will destroy the task as well.

Rich D

unread,
Oct 22, 2024, 6:04:00 AM10/22/24
to Tasker Google Groups Post
In your Android settings under accessibility, you need to enable Tasker.. 

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 6:05:22 AM10/22/24
to Tasker
I copy the `destroy scene` (from the last line) and put it at the start also.

Run.

Error.

Back to this one:
(with all the other stuff too)
Action requires accessibility but the accessibility service is disabled. Notification posted.

Confused.

I do - kind of - appreciate all the new security stuff on the new phones, but gee it can be painful too.

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 6:09:25 AM10/22/24
to Tasker
This is weird.

I have OTHER scenes working.

AFAIK tasker is enabled.

When I follow the phone's offering for help I get a screen - yes:  ACCESSIBILITY, but ..... ..... confusion.


fuzzywu...@gmail.com

unread,
Oct 22, 2024, 6:12:12 AM10/22/24
to Tasker
Gee, that was fun.

(Not against you.)

Got it working.

Scene working.

I'll play with it and see what mess I can make.

THANKS!

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 7:04:30 AM10/22/24
to Tasker
Wow, that is confusing.   (Not against you)

I copied the two lines from your code and pasted them in mine.
Then I had the fun of changing all the names.   That was fun.

I did one bit different.  Slightly I think.

On the TOGGLE thing on the CHANGE part:
(poor attempt to explain follows)
==============
IF  -------- %new_val ~ on
Default ringtone
Type ringer sound silent
notify title ringVolume
END IF

IF ---------- %new_val ~ off
Default rintone
Type ringer sound (my ringtone)
notify title ringVolume
END IF

Flash %new_val
Variable Set -- %ringMode to %new_val
==============

The %ringMode toggles if I press the button.
But if I exit the scene and come back it is not honoring  the value like yours does.

So I think I am missing something.

The code that makes the scene:
(again: poor effort)
======
Variable Set -- AltnotificationLevel to 4
(few more like this)
CreateScene ControlScene
Element Value Scene name Control Scene element Match  AutoReadName  to Value @AutoReadName
(and a couple more like this)
Then your two lines:
Element Depth ......
=============

Which - to me - is confusing.

The other ones that I did with `ELEMENT VALUE` work.

You are using `ELEMENT DEPTH`

No offense but I may try `ELEMENT VALUE`.

I'll let you know what happens.
Oh, that means I will only need one line of code.

fuzzywu...@gmail.com

unread,
Oct 22, 2024, 7:13:45 AM10/22/24
to Tasker
Oh, ok. Something else.

Your button name/s.....   Note the S.

You call your button, TOGGLE1

But in the ELEMENT DEPTH lines, there is/are TOGGLE1 and TOGGLE2.

Where is TOGGLE2 in the scheme of things?

I think that is where I got lost with your example.

Rich D

unread,
Oct 22, 2024, 7:08:24 PM10/22/24
to Tasker Google Groups Post

Your button name/s.....   Note the S.

You call your button, TOGGLE1

But in the ELEMENT DEPTH lines, there is/are TOGGLE1 and TOGGLE2.

Where is TOGGLE2 in the scheme of things?

Just to clarify..These are not button elements, they are Toggle Elements.

There are actually 2 Toggle elements. 

The Toggle2 element is hidden under the Toggle1 element.  They are the exact same size and placed on top of one another.  So which one is shown depends on the depth setting.  


So Toggle1 does not have the "ON' option set and Togggle2 does have the "ON" option set.  So the Global variable determines which Element is set to a depth of 1 which hides that particular element behind the other. 

fuzzywu...@gmail.com

unread,
Oct 23, 2024, 1:47:48 AM10/23/24
to Tasker
So if my `toggle` element is called RingMode I transposed your Toggle1 to RingMode, but was not sure what to call Toggle1's transposed name.

RingMode1 or 2?
And I'm sorry I said BUTTON and not TOGGLE.  My fault.

But I seem to lack the ability to completely reuse your code so I can make multiple instances of it.

Is that clearer?

Rich D

unread,
Oct 23, 2024, 4:58:29 AM10/23/24
to Tasker Google Groups Post

So if my `toggle` element is called RingMode I transposed your Toggle1 to RingMode, but was not sure what to call Toggle1's transposed name.

RingMode1 or 2?

You would need 2 Toggle elements called RingMode1  and Ringtone2.

You can link them to the same task in the "Change"  Tab within the Elements UI Edit mode. To do that you need to name that task.  To Name that Task you Select all your current actions in the task and tap "Copy" then in the upper right Tap the  - "Select Different Task"

Then at the top of that Menu there is a "New" option. Select that and name your task. Then long press the middle of the screen and Paste your actions into it. 

Then in the Ringtone2 you can now select that task as well. 

I have changed the project with your new names and a linked task for the Toggle elements. I also moved one of the elements to better show that there are 2 Toggle elements in this task. You can move one on top of the other so they will show as one just like the first version.

Try importing this again..


 Do use the APP 'Telegram'?   I have found that a much better way to with these back and forths to explain and show show examples. 

aa6vh

unread,
Oct 24, 2024, 10:20:34 AM10/24/24
to Tasker
I think you all are making this a lot harder than it needs to be.

Create a Tasker Global variable to store that element between the showing of the scene. In your "load Scene" task, set the element to the value of that Global Variable, using the "Element Text" or "Element Value" actions. In the scene, whenever that element is updated, save the updated value back into that Global.

Rich D

unread,
Oct 24, 2024, 4:17:14 PM10/24/24
to Tasker Google Groups Post
Well that's strange...  I know for certain I tested the Element Value action before replying..  

I tested with both one and zero and for some reason it did not work. 

The documents do not seem to list The toggle Element in Element value action., so I assumed it did not work. 😞 

After testing again, it does indeed work for setting the toggle element.. 

A value of one will turn it off and a value of zero will turn it on.

Thanks for the correction.... :)

fuzzywu...@gmail.com

unread,
Oct 25, 2024, 3:44:52 AM10/25/24
to Tasker
Rich D,

Your code works.  No problem.

But I can't see how/where you have the second button.
Although you explained it a couple of posts ago, I am still not understanding.   (My fault)

aa6vh,
Maybe I am making it harder than it needs.

But as I don't know the way to do it, I am trying to understand the workings.

I (stupidly) didn't realise the names and the associations on the SCENE and the TOGGLE.   But after a slap in the face a few times I saw it.
Alas that opened the can of worms where/how the second button is done.

I'll see if I can get what you suggested to work.

fuzzywu...@gmail.com

unread,
Oct 25, 2024, 3:51:41 AM10/25/24
to Tasker
(Sorry, all)

One TWIST  is the values and the text are very different.

The text shows the mode  and the value is the ring tone.

I'm not sure if I could save the mode to the global variable and have an external bit of code that then parses it for changes.

Again:  I don't often do this as I am buried in programming in other languages.

Rich D

unread,
Oct 26, 2024, 6:24:47 AM10/26/24
to Tasker Google Groups Post

Are you using the Element Value action  (Recommend) or are you still using the Element Depth method?


One TWIST  is the values and the text are very different.

The text shows the mode  and the value is the ring tone

Can you give more details?  What do you mean "value is the ring tone" ? 

aa6vh

unread,
Oct 26, 2024, 11:06:50 AM10/26/24
to Tasker
Remember guys, the "Element Text" action and the "Element Value" action do the same thing, but for different targets. Take a look at the Tasker Help for those actions.

"Element Text" is for Button, Text, and Edit elements only. "Element Value" is for Checkbox, Number, Picker, Slider., Spinner, and Toggle elements.

fuzzywu...@gmail.com

unread,
Oct 26, 2024, 11:47:04 PM10/26/24
to Tasker
The BUTTON (to call it) has the alternate text/s:  NORMAL and CONTACTS ONLY.
But it sets the phone's DEFAULT RINGTONE.
So it toggles that between CAR_HORN and SILENT.

So, normally when an unknown/non-contact calls me the CAR_HORN is the RINGTONE.
People who I know have a different one.

This will enable me to have the phone so if an unlisted number calls, the phone doesn't ring.
But if a contact calls, the phone works normally.

fuzzywu...@gmail.com

unread,
Oct 26, 2024, 11:58:54 PM10/26/24
to Tasker
> Remember guys, the "Element Text" action and the "Element Value" action do the same thing, but for different targets. Take a look at the Tasker Help for those actions.
>"Element Text" is for Button, Text, and Edit elements only. "Element Value" is for Checkbox, Number, Picker, Slider., Spinner, and Toggle elements.

Yes, and so I have a lot of lines in the code - now - turned OFF (they don't work and I'm anal).
I added a line:  ELEMENT TEXT
Scene:  ControlScene
Element: RingMode
Text: ringText

Pressed the button to apply.

Some error - sorry, I dismissed it too quickly.

THIS CAN'T BE DONE WITH THE TOGGLE OPTION....
Or words to that end.

So, sorry, how am I supposed to control the text shown on a TOGGLE button?

Please forgive the CAPS stuff....    Formatting here is painful and I don't know of an easy  way to identify the key parts/words so I capitalise them.

fuzzywu...@gmail.com

unread,
Oct 27, 2024, 12:02:32 AM10/27/24
to Tasker
If I wanted to post the CODE (now sure what to call it) on the phone, do I export it as:
XML to Clipboard
Description to Clipboard

and then paste it here?

(BTW, which ever way, it is going to be kinda painful for me)

Rich D

unread,
Oct 27, 2024, 8:42:43 AM10/27/24
to Tasker Google Groups Post

The BUTTON (to call it) has the alternate text/s:  NORMAL and CONTACTS ONLY.
But it sets the phone's DEFAULT RINGTONE.
So it toggles that between CAR_HORN and SILENT.

So, normally when an unknown/non-contact calls me the CAR_HORN is the RINGTONE.
People who I know have a different one.


Ok,  I believe I understand the issue.   Here is a updated link for what I believe you are looking for. 

Download this one and see if it works for you.  You will need to edit the Task > "Toggle Ringtone"  . Edit the "Default Ringtone"  actions to set them for your needs. 





    Project: sticky toggle Scene
    
    
    
    Tasks
        Task: show sticky toggle
        
        A1: Create Scene [
             Name: sticky toggle ]
        
        A2: Flash [
             Text: %Toggle_scene
             Dismiss On Click: On ]
        
        A3: Element Value [
             Scene Name: sticky toggle
             Element Match: Toggle1
             Value: 1 ]
            If  [ %Toggle_scene ~ on ]
        
        A4: Element Value [
             Scene Name: sticky toggle
             Element Match: Toggle1
             Value: 0 ]
            If  [ %Toggle_scene ~ off ]
        
        A5: Show Scene [
             Name: sticky toggle
             Display As: Overlay, Blocking
             Horizontal Position: 100
             Vertical Position: 100
             Animation: System
             Show Exit Button: On
             Show Over Keyguard: On
             Continue Task Immediately: On
             Allow Outside Boundaries: On
             Blocking Overlay +: On
             Overlay +: On ]
        
        A6: Wait [
             MS: 0
             Seconds: 15
             Minutes: 0
             Hours: 0
             Days: 0 ]
        
        A7: Destroy Scene [
             Name: sticky toggle ]
        
        
    
        Task: Toggle Ringtone
        Settings: Abort Existing Task
        
        A1: Variable Set [
             Name: %Toggle_scene
             To: %new_val
             Structure Output (JSON, etc): On ]
        
        A2: If [ %new_val ~ on ]
        
            A3: Flash [
                 Text: Set to CAR_HORN
                 Long: On
                 Tasker Layout: On
                 Continue Task Immediately: On
                 Dismiss On Click: On ]
        
            A4: Default Ringtone [
                 Type: Ringer
                 Sound: Silent ]
        
        A5: End If
        
        A6: If [ %new_val ~ off ]
        
            A7: Flash [
                 Text: Set to SILENT
                 Long: On
                 Tasker Layout: On
                 Continue Task Immediately: On
                 Dismiss On Click: On ]
        
            A8: Default Ringtone [
                 Type: Ringer
                 Sound: Silent ]
        
        A9: End If
        
        





aa6vh

unread,
Oct 27, 2024, 10:55:55 AM10/27/24
to Tasker
Now I have a better understanding of what you are trying to do.  And yes, there is no direct way in Tasker to effect the label of a toggle.

So what I do is make the toggle label blank, then place a label object next to that toggle (so that the new label is now appears to be the toggle's label), and just adjust that label.

fuzzywu...@gmail.com

unread,
Oct 27, 2024, 3:38:26 PM10/27/24
to Tasker
Thanks.

Just mentioning....

The code:   Toggle_Ringtone part 4.

That should be:
Sound: Car_Horn]

Yes?

NO big deal.  Ooops moment.

Shall try shortly.

fuzzywu...@gmail.com

unread,
Oct 27, 2024, 3:39:29 PM10/27/24
to Tasker
(ARGH)   Can't edit.

Ok I made a mistake there too..

Sound: CAR_HORN]

Yeah?

fuzzywu...@gmail.com

unread,
Oct 27, 2024, 3:42:11 PM10/27/24
to Tasker
(Argh again)

And......

Won't I need a global variable as it needs to survive the scene being closed/destroyed?

This was mentioned by aa6vh a few posts back.

Rich D

unread,
Oct 27, 2024, 10:16:23 PM10/27/24
to Tasker Google Groups Post

And......

Won't I need a global variable as it needs to survive the scene being closed/destroyed?

There is a global variable. 

%Toggle_scene

We're you able to set the Ringtone actions to the correct sound settings?


Can you describe what is not working?

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 1:08:12 AM10/28/24
to Tasker
Sorry Rich D.

My mistake.

Not yet.  Today has been busy for me and I am now trying to catch up on things.
My comments/posts were just from reading the code (text) you posted.

I'll get back to you with the results once I try it.

I am just ........ not sure it will help me if it is like the first one as I could not see how you got the Toggle2 part.

Though you did reply and did say what you did......   This end, it was not really something I could understand.
My problem, I know.

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 1:17:58 AM10/28/24
to Tasker
Ok, imported it and it seems to work.

Question:
When I run it, why does it take so long to display the scene?  It is like 3 seconds.

I get the FLASH message and it just sits there.   The scene does come up but .......

Anyway:  Good, it works.

Next PROBLEM  is that this is going to be difficult for me to read through and get the jist of to then duplicate it in my other ..... TASK  ?

And....  (you're going to love this)   I actually need this code as I need TWO of that kind of thing.  (The TOGGLE and changing things.)

The second one will put the phone into full SILENT mode.

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 1:22:26 AM10/28/24
to Tasker
AARRGGHH!!

Silly me....   That point I mentioned about the ringtone being set to SILENT.....

The code has that and so no matter what the button says, the phone ringtone is set to SILENT.

No big.   I can change that.

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 1:35:03 AM10/28/24
to Tasker
Where does TOGGLE RINGTONE get ..... invoked  ?
It is a separate task and they usually are called by a PROFILE.

Rich D

unread,
Oct 28, 2024, 4:40:51 AM10/28/24
to Tasker Google Groups Post
Question:
When I run it, why does it take so long to display the scene?  It is like 3 seconds.

I get the FLASH message and it just sits there.   The scene does come up but .......

That is the second action in the task. It is a flash action that has the 'Continue Task Immediately' option not selected.  You can simply delete that flash action. 

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 4:42:41 AM10/28/24
to Tasker
Thanks.

I did TURN IT OFF  (long click and the on/off button) for that line.

Working faster now.

Thanks.

Rich D

unread,
Oct 28, 2024, 4:51:00 AM10/28/24
to Tasker Google Groups Post
AARRGGHH!!

Silly me....   That point I mentioned about the ringtone being set to SILENT.....

The code has that and so no matter what the button says, the phone ringtone is set to SILENT.

No big.   I can change that.

Yes, as I mentioned in my previous post, I could not set that correctly as I do not have the same sound files as you. 

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 4:55:20 AM10/28/24
to Tasker
Rich D

Yeah, but setting both to SILENT was slightly confusing for me.

I appreciate these things happen.

Not a worry.

Where I'm stuck is where/how the second TASK is invoked - as there is no PROFILE listed.  TOGGLE RINGTONE
And how I can port  this code to my  TASK and use it.

I don't have a clear understanding of how it all works as a whole.

Rich D

unread,
Oct 28, 2024, 5:05:39 AM10/28/24
to Tasker Google Groups Post

Where does TOGGLE RINGTONE get ..... invoked  ?
It is a separate task

That is the task that is linked to the "Changed" Tab within the Toggle Scene Element.  You can see it there when you edit the Toggle scene element UI.  Usually those Tasks are anonymous and do not have a Task name. I Had to Name the task in so I could change the Collision property of it. That is why it is now showing in the Task Tab.

The collision property is set to 'Abort Existing Task' . This is so if you  tap the toggle very quickly and the entire task does not run before the next iteration of the task is started it will cancel the existing task and run the new iterations, so your Global variable will always have the correct value.

You can also delete or disable the flash actions in that task as they were ment for testing and to hopefully help you understand the flow. 

Rich D

unread,
Oct 28, 2024, 5:14:05 AM10/28/24
to Tasker Google Groups Post

Where I'm stuck is where/how the second TASK is invoked - as there is no PROFILE listed.  TOGGLE RINGTONE
And how I can port  this code to my  TASK and use it.

I don't have a clear understanding of how it all works as a whole.

So that task gets run every time you tap the Toggle button.  The local variable %new_val contains the current mode ,(value) of the toggle element. It will either be 

on   or    off

That value is tested and the Default Ringtone is set accordingly. 
The Global Variable is also set to this value to be used when cold starting the scene again. 

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 5:14:11 AM10/28/24
to Tasker
I am SO SO SO sorry that I am not getting this.

I open the SCENE, click the BUTTON (toggle bit) and look at the CHANGE.

If I open all the lines, I can not see any reference to that TASK.

The COLLISION part.....   and ABORT EXISTING TASK......

Sorry.   I'm in a huge forest and can't see any of the trees.  ;)

If only I could easily include a screen shot to show you.

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 5:16:14 AM10/28/24
to Tasker
Maybe this is the sticking point:

> So that task gets run every time you tap the Toggle button

Where can I see this?
How?

Rich D

unread,
Oct 28, 2024, 5:29:36 AM10/28/24
to Tasker Google Groups Post


I am SO SO SO sorry that I am not getting this.
No worries.. :)


I open the SCENE, click the BUTTON (toggle bit) and look at the CHANGE.

If I open all the lines, I can not see any reference to that TASK.



Look at the very top left.  You should see the Task name just under 'Element Edit'.  If you ever wanted  to link the Toggle button to a different task just tap the rotating arrow in the upper right.  The task (all of those actions) are the very same Task you see and edit in the Tasker Task Tab -> Toggle Ringtone



The COLLISION part.....   and ABORT EXISTING TASK......


That part is in the task properties. When viewing from the Tasker Task Tab you can see the Task properties by opening the task for editing and tap the cog icon in upper right. 




Sorry.   I'm in a huge forest and can't see any of the trees.  ;)

If only I could easily include a screen shot to show you.

If you use the App 'Telegram' on your android device we could post all of this much easier with screen shots.





On Monday, October 28, 2024 at 8:05:39 PM UTC+11 Rich D wrote:

Where does TOGGLE RINGTONE get ..... invoked  ?
It is a separate task

That is the task that is linked to the "Changed" Tab within the Toggle Scene Element.  You can see it there when you edit the Toggle scene element UI.  Usually those Tasks are anonymous and do not have a Task name. I Had to Name the task in so I could change the Collision property of it. That is why it is now showing in the Task Tab.

The collision property is set to 'Abort Existing Task' . This is so if you  tap the toggle very quickly and the entire task does not run before the next iteration of the task is started it will cancel the existing task and run the new iterations, so your Global variable will always have the correct value.

You can also delete or disable the flash actions in that task as they were ment for testing and to hopefully help you understand the flow. 





and they usually are called by a PROFILE.

--
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 visit https://groups.google.com/d/msgid/tasker/3942191d-bd4f-4361-a22c-913f3900f4c9n%40googlegroups.com.

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 5:38:29 AM10/28/24
to Tasker
> Look at the very top left.  You should see the Task name just under 'Element Edit'.  If you ever wanted  to link the Toggle button to a different task just tap the rotating arrow in the upper right.  The task (all of those actions) are the very same Task you see 
> and edit in the Tasker Task Tab -> Toggle Ringtone

Thanks.
Only after closely looking I noticed it.

Thanks.

I'll see if I can get it working.

Checking:

In your main TASK, you CREATE SCENE, then ELEMENT VALUE then SHOW SCENE

In my (real) TASK, if I do it that way it throws an error.

I have to put the ......
Ooops.  Sorry.  Wrong.
Left here for honesty.

Ok, I'll give it a go now and see if I can get it working.

Still a bit stuck:
So when I select the TOGGLE in my SCENE......    How do I set the TASK to run when invoked?

Rich D

unread,
Oct 28, 2024, 5:43:42 AM10/28/24
to Tasker Google Groups Post

Still a bit stuck:
So when I select the TOGGLE in my SCENE......    How do I set the TASK to run when invoked?

When you are in the 'Changed' tab - tap the circle icon in the upper right. 

Rich D

unread,
Oct 28, 2024, 5:48:41 AM10/28/24
to Tasker Google Groups Post
I guess it looks more like a rotating arrow icon in the upper right

fuzzywu...@gmail.com

unread,
Oct 28, 2024, 6:17:04 AM10/28/24
to Tasker
HURRAY!

Got it working!

Sorry it took so long.

I got rid of the lines that I turned off 

Now I have to make another button/toggle to do something similar.   But different too.

If you are interested:
given some parts would be different (like sounds, etc) would you be interested in the WHOLE thing?

How would I export it?   (comments or XML?)

I can save it to the phone's memory, copy it here then post.

Rich D

unread,
Oct 28, 2024, 6:37:44 AM10/28/24
to Tasker Google Groups Post

How would I export it?   (comments or XML?)

I can save it to the phone's memory, copy it here then post.

Usually best just to export and post the 'Description to Clipboard'

Choose the Four Spaces option when asked.


fuzzywu...@gmail.com

unread,
Oct 28, 2024, 6:40:55 AM10/28/24
to Tasker
Ok, not sure I did it correctly.

But here goes:

    Project: QuickQuiet
    
    Profiles
        Profile: Quick Quiet (Not Needed)
        Settings: Restore: yes
        State: Variable Value  [ %Quickquiet !~ OFF ]
        
        
        
        Enter Task: QuietSound
        A1: Flash [
             Text: %QQhours
             Long: On
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        A2: Flash [
             Text: %QQminutes
             Long: On
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        A3: Variable Set [
             Name: %SMS_Count
             To: 0 ]
        
        A4: Variable Set [
             Name: %Quickquiet
             To: ON ]
        
        A5: If [ %QQhours > 0 | %QQminutes > 0 ]
        
            A6: Notify [
                 Title: Quick Quiet
                 Text: %QQminutes
                 Number: 0
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0 ]
        
            A7: Vibrate Mode [
                 Mode: Vibrate ]
                If  [ %VibrateEnable eq 1 ]
        
            A8: Perform Task [
                 Name: SoundControl2
                 Priority: %priority+1
                 Parameter 1 (%par1): 0 ]
                If  [ %VibrateEnable = 0 ]
        
            A9: Flash [
                 Text: %QQhours  H  %QQminutes  M
                 Continue Task Immediately: On
                 Dismiss On Click: On ]
        
            A10: Wait [
                  MS: 0
                  Seconds: 0
                  Minutes: %QQminutes
                  Hours: %QQhours
                  Days: 0 ]
        
            A11: Vibrate Mode [
                  Mode: Off ]
        
            A12: Notify Cancel [
                  Title: Quick Quiet ]
        
            A13: Vibrate [
                  Time: 80 ]
        
        A14: End If
        
        A15: Variable Set [
              Name: %Quickquiet
              To: OFF ]
        
        A16: Notify Cancel [
              Title: Quick Quiet ]
        
        A17: Perform Task [
              Name: MissedSMSNotify
              Priority: %priority ]
            If  [ %SMS_Count > 0 ]
        
        
    
        Profile: Missed Call
        Settings: Restore: yes
        Event: Missed Call [ Caller:* ]
        
        
        
        Enter Task: YouHaveMissedCall
        
        A1: Say [
             Text: You have missed calls
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
        
        
    
        Profile: Missed SMS
        Settings: Restore: yes
        Event: Received Text [ Type:Any Sender:* Content:* SIM Card:* MMS Body:* ]
        
        
        
        Enter Task: Count_SMS
        
        A1: Variable Set [
             Name: %SMS_Count
             To: %SMS_Count+1
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        
    
        Profile: CancelQuieterMode
        Settings: Restore: yes
        Event: Shake [ Axis:Left-Right Sensitivity:Medium Duration:Short ]
        State: Variable Value  [ %TempVolLevel = 1 ]
        State: Display State [ Is:On ]
        State: Not Call [ Type:Any Number:* ]
        
        
        
        Enter Task: RestoreVolume
        
        A1: If [ %VOLR > 0 ]
        
            A2: Notification Volume [
                 Level: %Notificationvol ]
        
            A3: Ringer Volume [
                 Level: %Ring_volume ]
        
            A4: System Volume [
                 Level: %Sysvol ]
        
            A5: Variable Set [
                 Name: %TempVolLevel
                 To: 0
                 Do Maths: On
                 Max Rounding Digits: 0 ]
        
            A6: Vibrate [
                 Time: 144 ]
        
            A7: Notify Cancel [
                 Title: Reduced_Noise ]
        
        A8: End If
        
        
    
        Profile: DND Notification
        Settings: Restore: yes
        State: Variable Value  [ %DND = 1 ]
        
        
        
        Enter Task: DND Notification
        
        A1: If [ %DND = 1 ]
        
            A2: Notify [
                 Title: Do Not Disturb Active
                 Text: DO NOT DISTURB
                 Icon: cust_animal_hippo
                 Number: 0
                 Priority: 3
                 LED Colour: White
                 LED Rate: 182
                 Category: DND ]
        
        A3: End If
        
        A4: If [ %DND = 0 ]
        
            A5: Notify Cancel [
                 Title: Do Not Disturb Active ]
        
        A6: End If
        
        
        
        Exit Task: DND Notification
        
        A1: If [ %DND = 1 ]
        
            A2: Notify [
                 Title: Do Not Disturb Active
                 Text: DO NOT DISTURB
                 Icon: cust_animal_hippo
                 Number: 0
                 Priority: 3
                 LED Colour: White
                 LED Rate: 182
                 Category: DND ]
        
        A3: End If
        
        A4: If [ %DND = 0 ]
        
            A5: Notify Cancel [
                 Title: Do Not Disturb Active ]
        
        A6: End If
        
        
    
        Profile: DND Notification Clear
        Settings: Restore: yes
        State: Variable Value  [ %DND ~ 0 ]
        
        
        
        Enter Task: DND Notification
        
        A1: If [ %DND = 1 ]
        
            A2: Notify [
                 Title: Do Not Disturb Active
                 Text: DO NOT DISTURB
                 Icon: cust_animal_hippo
                 Number: 0
                 Priority: 3
                 LED Colour: White
                 LED Rate: 182
                 Category: DND ]
        
        A3: End If
        
        A4: If [ %DND = 0 ]
        
            A5: Notify Cancel [
                 Title: Do Not Disturb Active ]
        
        A6: End If
        
        
    
        Profile: Read SMS
        Settings: Restore: yes
        Event: Received Text [ Type:Any Sender:* Content:* SIM Card:* MMS Body:* ]
        State: Variable Value  [ %AutoReadSMS = 1 ]
        State: Orientation [ Is:Face Up ]
        
        
        
        Enter Task: Read SMS
        
        A1: Wait [
             MS: 0
             Seconds: 1
             Minutes: 0
             Hours: 0
             Days: 0 ]
        
        A2: Flash [
             Text: %SMSRF
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        A3: Flash [
             Text: %SMSRN
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        <try %SMSRN or F>
        A4: Variable Set [
             Name: %from
             To: %SMSRN ]
        
        A5: Say [
             Text: New S M S
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
        
        A6: Say [
             Text: From %from
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
            If  [ %AutoReadName = 1 ]
        
        A7: Say [
             Text: %SMSRB
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
        
        
    
        Profile: SMS Notification
        Settings: Restore: yes
        State: Variable Value  [ %AutoReadSMS = 1 ]
        
        
        
        Enter Task: SMS Notification
        
        A1: If [ %AutoReadSMS = 1 ]
        
            A2: Notify [
                 Title: Auto Read SMS
                 Icon: hd_social_chat
                 Number: 0
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0 ]
        
        A3: End If
        
        A4: If [ %AutoReadSMS = 0 ]
        
            A5: Notify Cancel [
                 Title: Auto Read SMS ]
        
        A6: End If
        
        
        
        Exit Task: SMS Notification
        
        A1: If [ %AutoReadSMS = 1 ]
        
            A2: Notify [
                 Title: Auto Read SMS
                 Icon: hd_social_chat
                 Number: 0
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0 ]
        
        A3: End If
        
        A4: If [ %AutoReadSMS = 0 ]
        
            A5: Notify Cancel [
                 Title: Auto Read SMS ]
        
        A6: End If
        
        
    
        Profile: SMS Notification Clear
        Settings: Restore: yes
        State: Variable Value  [ %AutoReadSMS ~ 0 ]
        
        
        
        Enter Task: SMS Notification
        
        A1: If [ %AutoReadSMS = 1 ]
        
            A2: Notify [
                 Title: Auto Read SMS
                 Icon: hd_social_chat
                 Number: 0
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0 ]
        
        A3: End If
        
        A4: If [ %AutoReadSMS = 0 ]
        
            A5: Notify Cancel [
                 Title: Auto Read SMS ]
        
        A6: End If
        
        
    
        Profile: Phone Face Up
        Settings: Restore: yes
        State: Orientation [ Is:Face Up ]
        State: Variable Value  [ %AutoReadSMS = 1 ]
        
        
        
        Enter Task: Face Up
        
        A1: Beep [
             Frequency: 2828
             Duration: 201
             Amplitude: 50
             Stream: 3 ]
        
        A2: Variable Set [
             Name: %Notificationvol
             To: %VOLN
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A3: Notification Volume [
             Level: 0 ]
        
        
        
        Exit Task: Face NotUp
        
        A1: Notification Volume [
             Level: %Notificationvol ]
        
        
    
        Profile: I/C Call2
        Settings: Restore: yes
        Event: Phone Ringing [ Caller:* ]
        State: Variable Value  [ %DND = 1 ]
        
        
        
        Enter Task: Busy
        
        A1: Notify [
             Title: Do Not Disturb Active
             Icon: cust_warning
             Number: 0
             Priority: 3
             LED Colour: Red
             LED Rate: 788 ]
        
        A2: If [ %CNAME neq %CNUM ]
        
            A3: [X] Variable Set [
                 Name: %number
                 To: %CNUM ]
        
            A4: If [ %CNUM ~ 04* ]
        
                <Message was text.  now variable.>
                A5: Send SMS [
                     Number: %CNUM
                     Message: %BusyMessage ]
        
            A6: End If
        
            A7: If [ %CNUM ~ +614* ]
        
                A8: Send SMS [
                     Number: %CNUM
                     Message: Can't talk ]
        
            A9: End If
        
        A10: End If
        
        
    
    Tasks
        Task: QuietTimeSet
        
        A1: Variable Set [
             Name: %QQhours
             To: 0 ]
        
        A2: Variable Set [
             Name: %QQminutes
             To: 10 ]
        
        A3: Variable Set [
             Name: %Sysvol
             To: %VOLS ]
        
        A4: Variable Set [
             Name: %Notificationvol
             To: %VOLN ]
        
        A5: Variable Set [
             Name: %Ringvol
             To: %VOLR ]
        
        A6: Variable Set [
             Name: %VibrateEnable
             To: 0 ]
        
        A7: Show Scene [
             Name: QuickQuietEdit
             Display As: Overlay, Blocking
             Horizontal Position: 100
             Vertical Position: 120
             Animation: System
             Show Exit Button: On
             Show Over Keyguard: On
             Allow Outside Boundaries: On ]
        
        A8: Perform Task [
             Name: QuietSound
             Priority: %priority+1
             Parameter 1 (%par1): %QQhours
             Parameter 2 (%par2): %QQminutes ]
        
        
    
        Task: QuietSound
        
        A1: Flash [
             Text: %QQhours
             Long: On
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        A2: Flash [
             Text: %QQminutes
             Long: On
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        A3: Variable Set [
             Name: %SMS_Count
             To: 0 ]
        
        A4: Variable Set [
             Name: %Quickquiet
             To: ON ]
        
        A5: If [ %QQhours > 0 | %QQminutes > 0 ]
        
            A6: Notify [
                 Title: Quick Quiet
                 Text: %QQminutes
                 Number: 0
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0 ]
        
            A7: Vibrate Mode [
                 Mode: Vibrate ]
                If  [ %VibrateEnable eq 1 ]
        
            A8: Perform Task [
                 Name: SoundControl2
                 Priority: %priority+1
                 Parameter 1 (%par1): 0 ]
                If  [ %VibrateEnable = 0 ]
        
            A9: Flash [
                 Text: %QQhours  H  %QQminutes  M
                 Continue Task Immediately: On
                 Dismiss On Click: On ]
        
            A10: Wait [
                  MS: 0
                  Seconds: 0
                  Minutes: %QQminutes
                  Hours: %QQhours
                  Days: 0 ]
        
            A11: Vibrate Mode [
                  Mode: Off ]
        
            A12: Notify Cancel [
                  Title: Quick Quiet ]
        
            A13: Vibrate [
                  Time: 80 ]
        
        A14: End If
        
        A15: Variable Set [
              Name: %Quickquiet
              To: OFF ]
        
        A16: Notify Cancel [
              Title: Quick Quiet ]
        
        A17: Perform Task [
              Name: MissedSMSNotify
              Priority: %priority ]
            If  [ %SMS_Count > 0 ]
        
        
    
        Task: destroyScene
        
        A1: Destroy Scene [
             Name: ControlScene ]
        
        
    
        Task: RingMode
        
        A1: Variable Set [
             Name: %ringMode
             To: %new_val
             Structure Output (JSON, etc): On ]
        
        A2: If [ %new_val ~ on ]
        
            A3: Default Ringtone [
                 Type: Ringer
                 Sound: Silent ]
        
            A4: Notify [
                 Title: RingMode
                 Text: contacts only
                 Icon: mw_action_supervisor_account
                 Number: 0
                 Permanent: On
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0
                 Category: ringVolume ]
        
        A5: End If
        
        A6: If [ %new_val ~ off ]
        
            A7: Default Ringtone [
                 Type: Ringer
                 Sound: WhocanitbenowRingtone ]
        
            A8: Notify Cancel [
                 Title: RingMode ]
        
        A9: End If
        
        
    
        Task: YouHaveMissedCall
        
        A1: Say [
             Text: You have missed calls
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
        
        
    
        Task: DND Config
        
        A1: Destroy Scene [
             Name: ControlScene ]
        
        A2: Variable Set [
             Name: %AltNotificationLevel
             To: 4
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A3: Variable Set [
             Name: %AltSystemLevel
             To: 3
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A4: Variable Set [
             Name: %AltRingLevel
             To: 3
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A5: Create Scene [
             Name: ControlScene ]
        
        A6: Element Value [
             Scene Name: ControlScene
             Element Match: AutoReadSMS
             Value: %AutoReadSMS ]
        
        A7: Element Value [
             Scene Name: ControlScene
             Element Match: DND
             Value: %DND ]
        
        A8: Element Value [
             Scene Name: ControlScene
             Element Match: AutoReadName
             Value: %AutoReadName ]
        
        A9: Element Value [
             Scene Name: ControlScene
             Element Match: RingMode
             Value: 1 ]
            If  [ %ringMode ~ on ]
        
        A10: Element Value [
              Scene Name: ControlScene
              Element Match: RingMode
              Value: 0 ]
            If  [ %ringMode ~ off ]
        
        A11: Show Scene [
              Name: ControlScene
              Display As: Overlay, Blocking
              Horizontal Position: 100
              Vertical Position: 100
              Animation: System
              Show Exit Button: On
              Show Over Keyguard: On ]
        
        
    
        Task: MissedSMSNotify
        
        A1: Wait [
             MS: 0
             Seconds: 1
             Minutes: 0
             Hours: 0
             Days: 0 ]
        
        A2: If [ %VOLN > 0 ]
        
            A3: Morse [
                 Text: SMS
                 Frequency: 4000
                 Speed: 80
                 Amplitude: 50
                 Stream: 5 ]
        
        A4: End If
        
        A5: If [ %MUSIC = 1 ]
        
            A6: In-Call Volume [
                 Level: 2 ]
        
            A7: Morse [
                 Text: SMS
                 Frequency: 4000
                 Speed: 80
                 Amplitude: 56
                 Stream: 0 ]
        
        A8: End If
        
        A9: Variable Set [
             Name: %MissedSMS
             To: 0
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A10: Variable Set [
              Name: %SMS_Count
              To: 0
              Do Maths: On
              Max Rounding Digits: 0 ]
        
        
    
        Task: Missed
        
        A1: Wait [
             MS: 0
             Seconds: 2
             Minutes: 0
             Hours: 0
             Days: 0 ]
        
        A2: Morse [
             Text: SMS
             Frequency: 4000
             Speed: 80
             Amplitude: 50
             Stream: 3 ]
            If  [ %PACTIVE ~ Missed Call ]
        
        
    
        Task: Busy
        
        A1: Notify [
             Title: Do Not Disturb Active
             Icon: cust_warning
             Number: 0
             Priority: 3
             LED Colour: Red
             LED Rate: 788 ]
        
        A2: If [ %CNAME neq %CNUM ]
        
            A3: [X] Variable Set [
                 Name: %number
                 To: %CNUM ]
        
            A4: If [ %CNUM ~ 04* ]
        
                <Message was text.  now variable.>
                A5: Send SMS [
                     Number: %CNUM
                     Message: %BusyMessage ]
        
            A6: End If
        
            A7: If [ %CNUM ~ +614* ]
        
                A8: Send SMS [
                     Number: %CNUM
                     Message: Can't talk ]
        
            A9: End If
        
        A10: End If
        
        
    
        Task: DND Notification
        
        A1: If [ %DND = 1 ]
        
            A2: Notify [
                 Title: Do Not Disturb Active
                 Text: DO NOT DISTURB
                 Icon: cust_animal_hippo
                 Number: 0
                 Priority: 3
                 LED Colour: White
                 LED Rate: 182
                 Category: DND ]
        
        A3: End If
        
        A4: If [ %DND = 0 ]
        
            A5: Notify Cancel [
                 Title: Do Not Disturb Active ]
        
        A6: End If
        
        
    
        Task: Face NotUp
        
        A1: Notification Volume [
             Level: %Notificationvol ]
        
        
    
        Task: Count_SMS
        
        A1: Variable Set [
             Name: %SMS_Count
             To: %SMS_Count+1
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        
    
        Task: SoundControl2
        
        A1: Flash [
             Text: %par1
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        <Set %mode to 0, 1, 2 for silent,vibrate and sound respectively.>
        A2: Variable Set [
             Name: %mode
             To: %par1
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A3: Java Function [
             Return: (AudioManager) audio_manager
             Class Or Object: CONTEXT
             Function: getSystemService
             {Object} (String)
             Param 1 (String): "audio" ]
        
        A4: Java Function [
             Class Or Object: audio_manager
             Function: setRingerMode
             {} (int)
             Param 1 (int): %mode ]
        
        
    
        Task: Read SMS
        
        A1: Wait [
             MS: 0
             Seconds: 1
             Minutes: 0
             Hours: 0
             Days: 0 ]
        
        A2: Flash [
             Text: %SMSRF
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        A3: Flash [
             Text: %SMSRN
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        <try %SMSRN or F>
        A4: Variable Set [
             Name: %from
             To: %SMSRN ]
        
        A5: Say [
             Text: New S M S
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
        
        A6: Say [
             Text: From %from
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
            If  [ %AutoReadName = 1 ]
        
        A7: Say [
             Text: %SMSRB
             Engine:Voice: default:default
             Stream: 3
             Pitch: 5
             Speed: 5
             Respect Audio Focus: On ]
        
        
    
        Task: RestoreVolume
        
        A1: If [ %VOLR > 0 ]
        
            A2: Notification Volume [
                 Level: %Notificationvol ]
        
            A3: Ringer Volume [
                 Level: %Ring_volume ]
        
            A4: System Volume [
                 Level: %Sysvol ]
        
            A5: Variable Set [
                 Name: %TempVolLevel
                 To: 0
                 Do Maths: On
                 Max Rounding Digits: 0 ]
        
            A6: Vibrate [
                 Time: 144 ]
        
            A7: Notify Cancel [
                 Title: Reduced_Noise ]
        
        A8: End If
        
        
    
        Task: RingToggle
        
        A1: [X] Flash [
             Text: total silence
             Long: On
             Continue Task Immediately: On
             Dismiss On Click: On ]
        
        A2: Variable Set [
             Name: %RingMode
             To: %new_val
             Structure Output (JSON, etc): On ]
        
        A3: If [ %new_val ~ on ]
        
            A4: Sound Mode [
                 Mode: Mute ]
        
            A5: [X] Default Ringtone [
                 Type: Ringer
                 Sound: Silent ]
        
            A6: Notify [
                 Title: RingMode
                 Text: contacts only
                 Icon: mw_action_supervisor_account
                 Number: 0
                 Permanent: On
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0
                 Category: ringVolume ]
        
        A7: End If
        
        A8: If [ %new_val ~ off ]
        
            A9: Sound Mode [
                 Mode: Sound ]
        
            A10: [X] Default Ringtone [
                  Type: Ringer
                  Sound: WhocanitbenowRingtone ]
        
            A11: Notify Cancel [
                  Title: RingMode ]
        
        A12: End If
        
        
    
        Task: SMS Notification
        
        A1: If [ %AutoReadSMS = 1 ]
        
            A2: Notify [
                 Title: Auto Read SMS
                 Icon: hd_social_chat
                 Number: 0
                 Priority: 3
                 LED Colour: Red
                 LED Rate: 0 ]
        
        A3: End If
        
        A4: If [ %AutoReadSMS = 0 ]
        
            A5: Notify Cancel [
                 Title: Auto Read SMS ]
        
        A6: End If
        
        
    
        Task: QuieterMode
        
        A1: Variable Set [
             Name: %Ring_volume
             To: %VOLR ]
        
        A2: Variable Set [
             Name: %Notificationvol
             To: %VOLN ]
        
        A3: Variable Set [
             Name: %Sysvol
             To: %VOLS ]
        
        A4: System Volume [
             Level: %AltSystemLevel ]
        
        A5: Ringer Volume [
             Level: %AltRingLevel ]
        
        A6: Notification Volume [
             Level: %AltNotificationLevel ]
        
        A7: Variable Set [
             Name: %TempVolLevel
             To: 1
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A8: Notify [
             Title: Reduced_Noise
             Text: Reduced Noise
             Icon: cust_animal_hippo
             Number: 0
             Priority: 3
             LED Colour: Red
             LED Rate: 0
             Category: RestMode ]
        
        A9: Destroy Scene [
             Name: ControlScene ]
        
        
    
        Task: Face Up
        
        A1: Beep [
             Frequency: 2828
             Duration: 201
             Amplitude: 50
             Stream: 3 ]
        
        A2: Variable Set [
             Name: %Notificationvol
             To: %VOLN
             Do Maths: On
             Max Rounding Digits: 0 ]
        
        A3: Notification Volume [
             Level: 0 ]
        
        
    
        Task: Show Diagnostics
        
        A1: Show Scene [
             Name: Show Data
             Display As: Overlay, Blocking
             Horizontal Position: 100
             Vertical Position: 0
             Animation: System
             Show Exit Button: On
             Show Over Keyguard: On
             Continue Task Immediately: On
             Allow Outside Boundaries: On ]
        
        




fuzzywu...@gmail.com

unread,
Oct 28, 2024, 6:47:43 AM10/28/24
to Tasker
Overview of what it does:

Top middle.
the last time/date the code was modified.

If you want to lower the volumes, you can activate REST MODE.
That will lower all volumes to a set value.

This is adjustable if you LONG PRESS that button.

To TURN IT OFF  While the screen is on, shake the phone gently.
It will shake and you know it is off.  There is also an icon that will go away.

QUICK QUITE is a bit buggy.  Not sure it works.

DND is handy if you are going to be busy and want to keep your mates in the loop.
If active, and someone calls you - AND THEY ARE KNOWN - they are sent a message.
NON LISTED numbers will not be sent a message.

The message is set by the popup list (bottom left)
This is not perfect and the message isn't kept between scene closure and reopening.
Though usually you wouldn't close the scene anyway.

AUTO READ SMS and AUTO SAY NAME:

Handy to read SMS with with or without the name.

EXIT.
(Guess)





Reply all
Reply to author
Forward
0 new messages