[Q] llama app make it speak current time - General Questions and Answers

Hi
I am using llama and trying to write event whose one part need to speak the current time
I understand we can use llama variable make it speak its value (##variable name##) so want to get current time in string format in llama variable
llama doesnt have built in variables like tasker (http://tasker.dinglisch.net/userguide/en/variables.html)
so I was trying android intent and using system class of android but still not able to do it
any idea pls

can anyone answer ppl

ashishshevale said:
Hi
I am using llama and trying to write event whose one part need to speak the current time
I understand we can use llama variable make it speak its value (##variable name##) so want to get current time in string format in llama variable
llama doesnt have built in variables like tasker (http://tasker.dinglisch.net/userguide/en/variables.html)
so I was trying android intent and using system class of android but still not able to do it
any idea pls
Click to expand...
Click to collapse
Did you ever get an answer to this question as I would like to do the same.

got busy with something else
didnt got the answer
If u r a developer cant help but you want it as feature there are many such app available

ashishshevale said:
Hi
I am using llama and trying to write event whose one part need to speak the current time
I understand we can use llama variable make it speak its value (##variable name##) so want to get current time in string format in llama variable
llama doesnt have built in variables like tasker ()
so I was trying android intent and using system class of android but still not able to do it
any idea pls
Click to expand...
Click to collapse
I looked for android intents but couldn't figure it out. Even if you could get an intent to work, I don't think you can have the return value set a value for a Llama variable, it's one-way? Otherwise I'd write a background service to just translate a formatted string with SimpleDateFormat.
I use the following solution that uses Llama only, no outside apps or intents I put all the tasks into a 'time' category.
There are four variables used, one for each numeric position in a time string:
hr: hour
m1: first position of the minute count
m2: second position of the minute count
pd: period (am/pm)
Think of it as a manual digital clock. Each variable is initialized at 1:00 AM and repeats according to the appropriate frequency:
Tasks to initialize variables:
begin_hr: Between 1:00 AM and 1:01 PM - set Llama variable 'hr' to '0' every 12 hours
begin_m1: Between 1:00 AM and 12:01 AM - set Llama variable 'm1' to '-1' every 1 hour
begin_m2: Between 1:00 AM and 12:51 AM - set Llama variable 'm2' to '-1' every 10 minutes
begin_pd_am: Between 12:00 AM and 11:59 AM - set Llama variable 'pd' to 'a.m.'
begin_pd_pm: Between 12:00 AM and 11:59 AM - set Llama variable 'pd' to 'p.m.'
Tasks to increment variables:
incr_hr: Between 1:00 AM and 12:01 AM - increment Llama variable 'hr' every 1 hour
incr_m1: Between 1:00 AM and 12:51 AM - increment Llama variable 'm1' every 10 minutes
incr_m2: Between 1:00 AM and 12:59 AM - increment Llama variable 'm2' every 1 minute
At 1:00 AM, all the begin tasks run, so the variable string equals:
##hr##:##m1####m2## ##pd## = 0:-1-1 a.m.
The incr tasks are alphabetically after the begin tasks, so they run afterwards, also at 1:00 AM, so then the string equals:
##hr##:##m1####m2## ##pd## = 1:00 a.m.
Then after 1 minute, incr_m2 will repeat, making:
##hr##:##m1####m2## ##pd## = 1:01 a.m.
I usually wake up at 6:40 a.m. and I want my phone to tell me the time every 5 minutes after my alarm goes off until I leave my house so I can know if I need to pick up the pace to make it to work on time. My next tasks to do this were:
alarmed: When the next alarm is due - set Llama variable 'alarmed' to 'true'
alarmed_off: When not at Home - set Llama variable 'alarmed' to 'false'
time_check: When 'alarmed' has a value of 'true' - queue an event named 'time_say' every 5 minutes ->
time_say: When 'alarmed' has a value of 'true' and [when 'm2' has a value of '0' or when 'm2' has a value of '5'] - say '##hr##:##m1####m2## ##pd##'
alarmed 'When the next alarm is due' will only fire once, at the moment the alarm goes off, so it needs to trigger another event that will repeat, since it can't repeat because the condition will be false. I only wanted the phone to tell me the time every 5 minutes when the second place of the minutes was 0 or 5, so it wouldn't say '6:51' or '7:03'. It would sometimes start at 6:40, then repeat at 6:46, and then be off by a minute for whatever reason, maybe because of the time it took to perform the actual 'say'. That's why time_check does a queue instead of the say.
Also, I tried using the newest Google TTS high quality voices, but often the event would take minutes long because apparently it was trying to connect to a Google server to parse the text/generate the audio, so it would say '7:05 a.m.' at like 7:12. This is a problem with TTS, not Llama's 'say' action. I changed the TTS to the lower quality and it has helped.
This is such a hack... I wish Llama had some built-in variables that could translate to the SimpleDateFormat current date/time, so I could get ##h##:##mm## ##a##
Not to mention this really fills up the task history with incr_m2 running every minute.
But Llama is free, so no complaining

Related

[GUIDE] Tasker

Tasker is a very powerful program for Android devices that lets users have complete control over the automation of their phones.
I have seen a lot of fragmented threads about different profiles and requests for help. So I have decided to make a thread to collect profiles and advice for people from different devices to use (hopefully in an easy to understand English!). Also, I'm not a huge Tasker wiz! I just hope that everyone can contribute in one place for everyone at xda. So please send me/the contributor a PM if you see a post that is wrong.
Contents:
Post #2 - Links to submitted guides/profiles
Post #3 - Basics of Tasker
*Disclaimer*
I do not have ownership (whole or part thereof) of the Tasker Android Application. This guide is for educational purposes only. I, or any contributor to the guide, is not responsible for any faults (software or hardware) resulting from following the instructions set out in this guide.
Tasker is available from the Android Market or in trial form from the website
Admins: If this thread is unnecessary please delete and let me know, thanks.
Submission of Profiles:
If you have a profile that you would like to share, please put it into this standard form so that people can more easily understand what to do:
##(example 1)##
Profile: "Wifi at home"
Context:
Variable "HOME" [matches] "1"
Wifi-near [(SSID of home/work/school wireless network)]
Activity:
Wifi [ON]
Mobile Data [OFF]
Mobile APN Enabled [OFF]
Exit Activity (if any):
Wifi [TOGGLE]
Mobile Data [ON]
Mobile APN Enabled [ON]
##(end example 1)##
OR if you want to submit a walk-through as well:
##(example 2)##
Tap Context
Add
Application
Google Maps
...etc
##(end example 2)##
Absolute Beginners:
If you are completely new to Tasker, you need to check out the Tasker website and wiki.
The program may seem unwieldy and complicated at first for those who do not have programming experience - I certainly found it a little intimidating at first - but once you play around with it, it helps a lot. The guides on the wiki and on the website are a little confusing, so hopefully this thread will help decode some of the settings/profiles into plain English.
The wiki is worth checking out for the walkthroughs and downloadable profiles - so take your time to check it out!
duckredbeard has also pointed out that there is a google group for Tasker which is supported by the developer himself. So if you need some trouble shooting, check that out too.
Turning GPS on only for GPS apps and then turning them off again
Automagically switching wifi on and off
...slowly building more. post to contribute!
Here are some basics that every beginner needs to know (or if you just need reminding).
Profile:
Not much explanation needed. A profile contains all the required settings for a particular purpose - it is usually recommended that you give your profile a name that makes sense (e.g.: "Wifi at home" for turning on/off your wifi when you are near your house). A profile has:
Contexts
Tasks
Exit Tasks (not always)
Contexts:
A Context is basically an on/off switch for your Tasker profile - something that tells Tasker that a certain thing has happened/is happening and so Tasker should do something about it. When you tap "new" in Tasker and have given your profile a name, you will be given some choices for your Context. A Context can be:
Application (profile is activated by the opening of an app)
Time (this can be through a time interval or a set time frame)
Day (profile activation based on which day/month you are on)
Location
State (of your phone)
Event (something that has happened to the phone)
Tasks:
Once your profile has been triggered by your Context, you want it to do something - this can be switching on Wifi, or locking your phone, or turning on the GPS, launch an application, etc. You have amazing control over what your phone does! You will need to explore the different options in order to understand the kind of control you have.
Exit Tasks:
An exit task tells Tasker what to do once your Context is no longer true (e.g.: you are no longer near your wifi network). You can tell Tasker to switch things back on that you might have turned off (or vice versa). You do not need to have an exit task, but sometimes it is useful. You CANNOT have an Exit Task if your Context is an Event.
Monitoring your context:
Some contexts (like "Location") require Tasker to recognise when it is in a certain area or not - this is how Tasker does it.
To find a wifi network using the "Wifi-Near" context, Tasker switches on your wifi briefly (specified in "Menu -> Preferences -> Monitor -> Wifi Timeout Seconds") and scans the wifi networks available. After the specified amount of seconds has passed, Tasker will then switch off the Wifi scanning. Tasker begins scanning for wifi networks again after another time interval (specified in "Menu -> Preferences -> Monitor -> Wifi Scan Seconds"). Obviously the more you scan the more battery you use, but also the more responsive Tasker will be. And obviously the shorter amount of time you spend scanning for networks, the more battery you save, but you also have a lower chance of connecting to a network. Tasker can only do this wifi-scanning if you have set your Wifi to [TOGGLE] or [ON] - it will not do it if you have set your Wifi to [OFF].
GPS is a much more accurate way to find your location, but obviously much more battery intensive. Settings are much the same as the Wifi ones and are found in "Menu -> Preferences -> Monitor". Tasker can only update your GPS location if you have set your GPS to [TOGGLE] or [ON] - it will not do it if you have set your GPS to [OFF].
Network Location is the least battery intensive, but also the least accurate. Tasker checks your network location according to the time specified in "Menu -> Preferences -> Monitor -> Network Location Check Seconds".
...more to come.
--just in case--
Using GPS only when needed:
In normal use, apps like Weather, Places, Latitude, etc, only need to know which suburb/cell tower you are using. If you have your GPS switched on, then it becomes a huge waste of battery. Here is how to set it so that your GPS switches on when you use a GPS app, and then to switch it off again when you exit that app.
Profile: "GPS on"
Context:
Application
Google Maps
Locations
Navigation
...etc
Tasks:
GPS [ON]
Exit Tasks:
GPS [OFF]
Automagically switching wifi on and off
The Easy Way:
Profile: "Wifi at home"
Context:
- Wifi-Near [(Set as your work/home/school/etc SSID and MAC address - do this by long-pressing on the dialog box for Tasker to scan for you)]
Tasks:
- Wifi [ON]
Exit Tasks:
- Wifi [OFF]
This method has Tasker checking for your wifi network according to the settings you placed in:
"(Tasker Home Screen) Menu -> Preferences -> Monitor"
However, this theoretically leads to more battery usage because Tasker is always checking for your wifi network even when you are nowhere near your wifi network. You could always have it check your location using your GPS, but this is even worse for your battery. A way to reduce this battery drain is to lower your "Wifi/GPS Timeout" setting and increase your "Wifi/GPS Scan" setting. This will cause Tasker to check for wifi networks/GPS location for a smaller duration and less frequently - the downside is that Tasker will be less responsive when you enter into your wifi network (eg: if you set Tasker to check once every 10 minutes, then you might have to wait 10 minutes before Tasker kicks this profile into gear)
Slightly more complicated way:
This requires 2 profiles.
Profile 1: "Home"
Contexts:
- Cell Near [(press 'scan' to let Tasker find out what cell towers are near you)]
Tasks:
- Set variable "%HOME" = [1] (this is a variable i defined myself)
- Wifi [TOGGLE]
Exit Tasks:
- Set variable "&HOME" = [0]
- Wifi [OFF]
Profile 2: "Wifi at home"
Contexts:
- Variable "%HOME" matches [1]
- Wifi-Near [(SSID of home/work/school/etc)]
Tasks:
- Wifi [ON]
- Mobile Data [OFF]
- Mobile APN Enabled [OFF]
Exit Tasks:
- Wifi [TOGGLE]
- Mobile Data [ON]
- Mobile APN Enabled [ON]
(you can also enable Auto-Sync if you wish)
Explanation:
This method can theoretically save battery and increase the responsiveness of Tasker. It does it by only enabling the Wifi-scanning when you are within a certain cell-tower(s) area. Since checking for your location via the mobile network does not require much battery (and also since your phone is automatically doing it for your weather app anyway), you can set your Network Scan time to something quite low (I have it at 15 seconds). Once you are in the general area, then Tasker begins to look for your wifi network. Because you are not always searching for the wifi network, you can increase the frequency of the searches and also increase the duration of the search.
This does require a bit of testing - I find that it works quite well, but that could just be my area. Have a go and see what you find.
dont mean to cut down your efforts here, but: http://tasker.wikidot.com/
It will be nice to use this thread as a helpful discussion area on programming tasker as their does not to be such a place on the tasker wiki site.
Maybe you can help to achieve this state.
Is it possible to have several IF variables?
Ie.
Between hours 21:00 - :06:30 Reduce phone ringer to 2
If Location (network operator) = Home
and Power is connected
and phone has been idle for 30mins.
I have been playing with Tasker but having no programing experience it is difficult for my brain to wrap around how I would achieve this.
any hints?
TopShelf10 said:
dont mean to cut down your efforts here, but: http://tasker.wikidot.com/
Click to expand...
Click to collapse
yeah, I'm aware of the wiki - but the wiki doesn't answer all the questions and I feel it isn't organised very well (not that this would be organised any better). Plus, a forum opens things up to discussion and sharing, which I'm sure a lot of people will appreciate. feel free to contribute!
Daft Templar said:
It will be nice to use this thread as a helpful discussion area on programming tasker as their does not to be such a place on the tasker wiki site.
Maybe you can help to achieve this state.
Is it possible to have several IF variables?
Ie.
Between hours 21:00 - :06:30 Reduce phone ringer to 2
If Location (network operator) = Home
and Power is connected
and phone has been idle for 30mins.
I have been playing with Tasker but having no programing experience it is difficult for my brain to wrap around how I would achieve this.
any hints?
Click to expand...
Click to collapse
I believe that if you put all of those 'variables' into one profile and make them all contexts, then you would be able to do that. But don't forget to set your task priorities properly!
Have you tried:
Code:
Profile: (profile name)
Contexts:
- Time [21:00-06:30]
- Wifi-Near [(your home SSID)] (also see my post about how to reduce wifi-searching to increase battery life)
- Power [Any/AC/USB]
Tasks:
- Ringer Volume [Level 2, (Sound, Display if you want as well - good for debug)]
Exit Tasks:
- Ringer Volume [(whatever you like your volume level to be at)]
I am not sure how to do your "Phone Idle" condition as I have never had to use it before - I suppose that you could always set another 2 profiles:
1 to countdown to 30 minutes which then sets a variable (say, "Timer") equal to 1 and has a context that tells it to run the profile every time "Timer" = 0; the other profile would have set "Timer" = 0 every time the Display turned on. You could then add a "Timer [matches 1]" context to your original profile, and that should work.
This seems like a rather roundabout way to do it, but that's what I can think of at this time. Let me know if you would like me to post up the instructions to do that though.
If anyone else has a better idea, let me know!
I think when using tasker (particularly with lots of profiles) It is important to keep things as simple and clean as possible. Otherwise if certain tasks start becoming too dependant on other tasks it will either reduce your ability to program new tasks or Things will start going pear shaped.
For Example. If I were to program the phone with Wifi-Near to Enter silent mode It will affect any other Tasks I have going with the Wifi, Either it being Turn wifi Off Or stop searching or Even If My network goes down. I think (if possible) it would be better to use a different more non varried method of location if you know what I mean. I think it would go for any other tasks you would want to program as well. Keep things simple and very direct, It will also help you too trace back and find problems if needed later down the track as well.
Daft Templar said:
I think when using tasker (particularly with lots of profiles) It is important to keep things as simple and clean as possible. Otherwise if certain tasks start becoming too dependant on other tasks it will either reduce your ability to program new tasks or Things will start going pear shaped.
For Example. If I were to program the phone with Wifi-Near to Enter silent mode It will affect any other Tasks I have going with the Wifi, Either it being Turn wifi Off Or stop searching or Even If My network goes down. I think (if possible) it would be better to use a different more non varried method of location if you know what I mean. I think it would go for any other tasks you would want to program as well. Keep things simple and very direct, It will also help you too trace back and find problems if needed later down the track as well.
Click to expand...
Click to collapse
whilst it is good to try and keep things simple, sometimes more complex profiles lead to more efficient use of battery. Or sometimes a simple task may need certain exceptions so that it fits around our lives. Remember that Tasker should be making our phones do what we want, how we want it - we want to try and avoid the "i'll get used to it" line as much as possible.
When using complex profiles (or even profiles that may end up conflicting each other), the use of priorities for your task is very important. For example - when my "wifi at home" profile gets switched off, it turns my wifi onto [TOGGLE]. BUT if I leave the cell-tower area near my house at the same time, it tells it to turn wifi onto [OFF]. Since these are conflicting tasks, I have given my wifi [OFF] a higher priority than [TOGGLE], and so Tasker does what I want. As with any programming, sometimes convolution is unavoiable - in those instances make sure that you keep your line of logic clear (some people like to use flowcharts for programming, but i think that's a bit excessive for Tasker - each to their own though!)
is there a way to tell when music is playing?
Sent from my HTC Vision using XDA App
I want to use Tasker to switch off data/wifi when the screen is switched off, then switch data/wifi back on again when the screen is on, but only if they were previously on. Is this possible?
skulk3r said:
Tasks:
GPS [ON]
Exit Tasks:
GPS [OFF]
Click to expand...
Click to collapse
The Exit Task is unneeded. For all On/Off toggles, Tasker returns them to their original state on exit automatically.
Michealtbh said:
I want to use Tasker to switch off data/wifi when the screen is switched off, then switch data/wifi back on again when the screen is on, but only if they were previously on. Is this possible?
Click to expand...
Click to collapse
As far as I know, your phone will automatically switch off your wifi when you have your screen off (unless you installed a mod/app that forces it to stay open). I believe that Tasker (by default) will switch it off unless you have put wifi to [TOGGLE]. However, if you wanted to be completely sure, you can always use variables.
ie: you can make a profile that sets a variable (say, "WifiON") to 1. and then when you make a "screen on" event profile, make it Wifi [ON] IF WifiON [matches 1].
Izkata said:
The Exit Task is unneeded. For all On/Off toggles, Tasker returns them to their original state on exit automatically.
Click to expand...
Click to collapse
Oh wow, I must have completely missed that! Thanks for the help =] Feel free to continue to share/post guides.
sundar2012 said:
is there a way to tell when music is playing?
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
I haven't found it on Tasker - but then, I don't really know Tasker as well as some other people here. You could always try to use the launching of the Music app as a context, or use the headphones plugged in event as a context?
If you haven't been to the google group for tasker, you should go NOW. It is moderated by the developer himself. He answers questions every day, including updates on what to expect on the next version. There are dozens of users on that group that can and will help you with the infinite number of things Tasker can do for you.
Head over to http://groups.google.com/group/tasker/topics?gvc=2 and read a few pages. It is likely that your questions have already been answered.
Whenever Ive previously tried Tasker it savages my battery...
All I had it doing was at a certain time turn on mobile data, open rss reader (so it updates) then play a beeping .mp3
Just wanted a flashy alarm clock to get to grips with it. but always see 25% less available battery with it installed than without...
duckredbeard said:
If you haven't been to the google group for tasker, you should go NOW. It is moderated by the developer himself. He answers questions every day, including updates on what to expect on the next version. There are dozens of users on that group that can and will help you with the infinite number of things Tasker can do for you.
Head over to http://groups.google.com/group/tasker/topics?gvc=2 and read a few pages. It is likely that your questions have already been answered.
Click to expand...
Click to collapse
oh wow. thanks for that. I'll chuck it up on the first few posts.
Would still like this to be a share-some-love discussion though!
Coedy said:
Whenever Ive previously tried Tasker it savages my battery...
All I had it doing was at a certain time turn on mobile data, open rss reader (so it updates) then play a beeping .mp3
Just wanted a flashy alarm clock to get to grips with it. but always see 25% less available battery with it installed than without...
Click to expand...
Click to collapse
what is your device? I have seen improved battery life with my HTC Desire Z - I usually only had about 30-40% battery at the end of the day with light texting, some calls and web surfing. Now i have about 60%! Although that's not completely Tasker - I do have SetCPU to underclock during screen off times.
Did you turn the mobile data back off?
Yep, had it to turn off mobile data and then enable wifi when I close the news app.
(I usually keep wifi on 24-7 if Im at home that day).
I say it took about 25% of my battery because I usually get 36 hours with everything on (except BT) and with tasker going I only got slightly over 24hours... (maybe like 26 or 28?)
Its a HTC Hero btw. Maybe ive just tuned it so that its at its optimum battery for me and my situation? I just think its weird that whenever I use Tasker within the next 2 days the battery has dived down to 20 something hours from around 35+

[Q][TASKER] Several Questions

I have a few questions.
I tried to make my own Juice Defender replacement:
Data Check -
Contexts:
Time
From 6:30
every 15 min
To 01:00
Power
Any
Inverted
Tasks:
Stop
if %SCREEN ~ ON
Stop
if %CELLSIG < 1
Mobile Data
On
Auto-Sync
On
Wait
2 min
Auto-Sync
Off
Mobile Data
Off
For some reason I can't set an end task, but I think I got around it. What this should do is when my screen is off and I have service it should check for any sort of notifications (facebook, mail), correct? Also, will I still get texts and calls instantly or does Mobile Data include these?
you shouldn't use the wait there as while tasker is waiting those 2 min nothing else can run.
I posted my tasks for this in another thread recently: http://forum.xda-developers.com/showpost.php?p=11097712&postcount=14
Is there anything else I can use instead of wait? I don't really want to make 4 profiles. Also I tried doing something else and it's not working. I attempted to make a Night Mode, however it doesn't turn on:
Nightenable:
Contexts:
From 1:00 Till 6:29
Tasks:
Variable Set %NIGHT, 1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Night Mode:
Contexts:
Variable Set %NIGHT, 1
Tasks:
Lower Volume, etc.
why don't you want to use 4 tasks? That's the most ellegant way to do it
for the night mode don't set the variable but set the stuff you want straight away
I would do it in one task except I also have this:
Power Mode:
Contexts:
Power On
Tasks: (Menu)
(Night Mode) Variable Set %NIGHT, 1
(Normal Mode) Variable Set %NIGHT, 0
Vulf said:
I have a few questions.
I tried to make my own Juice Defender replacement:
Data Check -
Contexts:
Time
From 6:30
every 15 min
To 01:00
...
...
For some reason I can't set an end task, but I think I got around it. What this should do is when my screen is off and I have service it should check for any sort of notifications (facebook, mail), correct? Also, will I still get texts and calls instantly or does Mobile Data include these?
Click to expand...
Click to collapse
How I do this:
Profile: Sleep
Time
From 23:00
un-checked
To 05:59
---------------------------------------
Tasks: Sleep
Notification Pulse
Off​Ringer Volume
5​Mobile data
Off​WiFi
Off​Bluetooth
Off​Auto-Sync
Off​Display Brightness
15​---------------------------------------
Exit Tasks: Awake
Notification Pulse
On​Ringer Volume
15​Auto Brightness
On​
I utilize a whole other Project with several Profiles to control the Wifi & Mobile Data usage. now working on a BT radio policy

[TUT] [Tasker] Create a widget that periodically cycles through different messages

Hey, guys. I've been looking to use Tasker for awhile now but, it's just been laying dormant in my app drawer because I was too overwhelmed by all the options. Anyway, I finally got around to using it when I discovered a Domo-kun wallpaper that I just had to use and customise. And what I've got is in this post.
http://forum.xda-developers.com/showpost.php?p=14898952&postcount=33983
In this tutorial we will be trying to understand how to use Tasker's Minimal Text Widget Plugin and Variables. So, let's get down to it.
Objectives
Get Domo-kun to "say" stuff based on various events on the phone.
Get Domo's messages to cycle based on a preset time period.
Variables
These are basically empty labels that you must direct Tasker to fill. You can fill them with a string of characters, or with numbers and you can also perform basic math functions on them.
Minimal Text Widget Plugin
This enables Tasker to display stuff via Minimal Text Widget.
What we need
We will need a way of keeping time, so that messages will change after a specified time.
We will need a way of setting a preset message that corresponds to the battery state.
We will need a way of setting a preset message that corresponds to the wifi state.
We will need a way to tell Minimal widget when to display a message.
We will need a way to tell Minimal Widget what message it should display.
Setting a timer that will change the message after preset time.
The context for this is obviously every 'x' minutes. So we start a new profile with a Time context, and set that to repeat every 'x' minutes.
Now, we need a variable that will change after every 'x' minutes(y+1), this will eventually tell our widget when it's time to change the message. So, this will be the action for this particular context. Add a new task to the context, select Variable>>Variable Set. Let's name our variable, I will call mine %SET. The necessary action after every 'x' minutes is '%SET + 1' so this is what we will put in the "To" field. Remember to check the box "Do Math", this will treat the variable as a number, and enable us to perform the required math on it.
Let's take a look at what will happen, when this profile is active.
Every 'x' minutes, the Variable %SET will be set to %SET + 1. So, if %SET starts at 0, after 'x' minutes it will be 0 + 1; it will be 1; after another 'x' minutes it will be set to %SET + 1, 1+1; it will be 2, and so on.
You now have a variable that changes every 'x' minutes.
Setting a preset message according to the battery state.
I want to make Domo tell me how my battery is doing when it's at four different states (100%-75%, 75%-50%, 50%-25%, 25%-0%).
So, now we have four different contexts(battery ranges) in which Tasker needs to perform certain actions(Domo will say something). Let's start creating them.
For the first context(battery level 75-100) we want to display "Your battery is good". So, we will first define the context. In this case the context is a "State" in which the phone is in. Therefore our required context is in the "State" category>>Battery level, choose the range, I will choose 75 - 100. Since the message changes based on the level, we will need to set a variable here. I will call mine %BATTSTAT, and set it to "Your battery is good".
We have to repeat the steps for the other 3 battery levels. So, we create new State>>battery level profiles but, we use the SAME Variable(%BATTSTAT) for the message.
(50-74) - set %BATTSTAT to "Your battery is OK"
(25-49) - set %BATTSTAT to "Your battery is low"
(0-24) - set %BATTSTAT to "Your battery is going to die"
What is going to happen when this profile is active?
When the battery level is between 75-100 the %BATTSTAT will be "Your battery is good", when battery level hits 74, %BATTSTAT will immediately change to "Your battery is OK", and so on.
We now have a variable(%BATTSTAT) that holds a message depending on the battery level.
Setting a preset message according to wifi state.
This is pretty much the same as setting the message for battery level. The only difference is we will use a an exit task for when wifi is not connected. An Enter Task are the actions that take place when a state is entered, an Exit Task are the actions that take place when a state is exited.
So, new profile, State>>Wifi Connected, set %WIFISTAT to "Your wifi is connected", now if we don't set the %WIFISTAT Variable to change when the wifi is disconnected, it will always hold the message "Your wifi is connected". So we set an exit task for the variable %WIFISTAT to say "Your wifi is disconnected".
Okay! We now have,
%SET - A Variable that increments every 'x' minutes
%BATTSTAT - A Variable that holds a message corresponding to the battery level
%WIFISTAT - A Variable that holds a message corresponding to the wifi status
Getting tasker to communicate with Minimalistic Text Widget
This is fairly simple, all we need to do is define a variable for MTW, and set to what we want to say, in this case the message within the tasker variables (%BATTSTAT or %WIFISTAT). So, the action would be within "Plugin">>Minimalistic Text Widget. You have a field for Minimalistic Text Widget's Variable and you have a to field.
Now, we need a way to send our messages to Minimal Text Widget at the right time.
We use our Time variable to tell us what's the time. If, %SET = 0 we will send %BATTSTAT to the widget, if(after 'x' minutes) %SET = 1, we will send %WIFISTAT to the widget. Now, our next context depends on the Variable %SET, so this will be the context we coose. Event>>Variable>>Variable Set, enter the Variable(%SET) in Name field and what it will be when we perform our action (sending data to MTW) in this case, '0'. The action to perform will be, Plugin>>MTW set a Variable %DISP to %BATTSTAT.
Now we repeat this for 'x' minutes later when %SET = 1, so a new Event context has to be made, where the variable %SET = 1, and here we will send the wifi status to MTW. So, Plugin>>MTW set Variable %DISP to %WIFISTAT.
What happens here is, when %SET = 0 (at the beginning of our cycle) Tasker will send the message within %BATTSTAT to %DISP. 'x' minutes later, when %SET = 1, Tasker will send the message within %WIFISTAT to %DISP. But, wait! What happens when 'x' minutes later our time variable increments(%SET + 1 ie. 1+1 = 2)? This is a problem because we have not made a profile for %SET = 2, in relaity we don't need one because there are only two kinds of messages we want to send to MTW.
We need to reset our counter. So, we make a new Event profile for when the variable %SET is greater than 1. All we need to do is set %SET to 0.
Displaying our messages on MTW
Create your Minimalistic Text Widget, within it's "Misc" tab find Local Variable and put in the name of your MTW Variable, in this case, it is %DISP. And you're done!
___________________________________________________
This is my first attempt at writing a tutorial and also I've only been using Tasker for a couple of days, so the above procedure might not be completely optimized. Maybe our Dev/Programmer friends can enlighted us. I tried to write this tutorial not so much as a hold your hand and give you a play by play but, more as a I hope you learn something about the way Tasker works and find better uses for it. I hope it was helpful. I don't think pictures are actually necessary if people get their feet wet with Tasker but, if people think it's absolutely necessary, I will post some.

[Help] Tasker & Brightness Script

Writing my first scripts for Tasker & looking for some help while I try to figure this out.
I'm trying to write 2 scripts. One is to increase brightness, and one is to decrease it.
I have tasker, and I have the Screen Filter app (which has a plug in for Tasker).
I'd like to make a shortcut (that I will be calling from yet another app) that will increase brightness from:
Screen Filter 40%, Screen 0
SF 0%, S 0
SF 0%, S 50
SF 0%, S 150
SF 0%, S 255
Then the opposite for decrease.
The idea was to set a variable called %Bright, and use a if-else-else-else-end if that checked the current level of the variable, and set the screen 1 brighter and set the variable to a new value. (ie, check current brightness then increase by 1 level).
Problem is if anything other then my shortcut changed the brightness, Tasker doesn't know about it. (Say if I use Quick Settings)
There any way to get Tasker to check the current state of the brightness (and screen filter)? There a better way to do this inside Tasker?
(btw, I am aware of other apps to control brightness. please don't mention them in this thread)
EDIT: Wrote the script out with no problems assuming variable is set. For now, using variable 1-5 (dimmest to brightest). If variable is not set, or anything else, then both my dim script & my bright script will just set it to 1 and go from there.

[Q] Tasker Profile for Notification if No SMS Has Been Received

Hello Folks,
I am new here, and found this thread while I was experimenting in Tasker. I would like to find a way to get me notified if a certain contact has not sent me an SMS for a definite period of time. For example, if Contact A has not sent me an SMS for about an hour.
A profile like this will really help me and my friends in a project that we are doing.
Thanks!
Sorry if this is too late, but off the top of my head you could make a task that increments a variable every, say, 1 minute (loop forever with a 60000ms delay at the beginning). Right after incrementing the variable, check to see if it is >= 60. If so, send an alert and rest the variable.
Now, every time a text arrives (I don't know how to tell who a text is from with tasker, but I believe there's a way), reset the variable back to 0. You could also have a variable array to hold multiple contacts.
Just my 2¢...

Categories

Resources