Monday, July 27, 2015

[Tasker] Better battery save widget - "periodic internet": 1%/hr

It's been a while. But I'm back :) So sorry for not replying to all comments.

Many things changed... I updated my Note 3 to Lollipop (feels good, looks bad), bought a smartwatch (LG Watch R, great battery life due to the OLED display, but not really stable connection to the Google Watch software, but that should be Googles fault, still working on a fix for this). Lost my xposed framework functionality due to the new ART framework and my odexed official ROM, but thats off topic ^^

I really wonder, who needs a smartphone 7 mm thick with a battery life of 1 day, if one could have instead one, which is 1 cm thick, a little heavier, but a battery life of 3 days. I would hate it, if the new Note 5 would come without an exchangeable battery..... Anyway, as thinner means "better" for customers (grrrr) we have to deal with it. Here is my newest battery saving widget!

I know, there are programs like "Juice defender" out there. But I don't like overloaded software I have no full control of, running in the background, using RAM and CPU time.

It is much more stable (can run for hours and hours) then my previous approaches and I lose approximately 1% of battery per hour.

What will you get:
A small widget on your home screen, you click on. It will:
  • Wait 1,5 minute
  • Activate flight mode (or only deactivate data and wifi)
  • Wait 15 minuts
  • Deactivate airplane mode (or turn data and wifi on)
Thats it... It works better, then the previous approaches, because we will use the Tasker Timer option for repeating the task. That means, that it doesn't block other Tasker tasks while running.

This is how it will look like, look at the icon in the lower left corner (oh and hover the screenshot):

What do you need:
  • For the icons (optional): Ipack / Crystal Project HD and Ipack / Kyo-Tux Aeon HD
  • For turning airplane mode on and off (optional): Secure Settings if you have ROOT access (HowTo Root), if you don't have ROOT, you can still continue to read - instead of toggling airplane mode, you can toggle DATA and WIFI with Tasker, no need for Secure Settings, maybe you prefer this anyway, the benefit is, you can still be called while in energy saving mode.
  • Tasker
  • 20 minutes of life time (scroll down for direct downloads)
So lets start with the profile and the associated task:

Create a new profile in Tasker, call it "Periodic Internet Widget Off". This profile will be activated, if we click on the notification while the energy saving mode is running. It will deactivate the energy saving mode.

Profile: Periodic Internet Widget Off
 Event: Notification Click [ Owner Application:Tasker Title:Periodic internet Widget ]
 Enter: Periodic internet Widget Off
 Abort Existing Task

 A1: Stop [ With Error:Off Task:Periodic Internet ]
 A2: Secure Settings [ Configuration:Airplane Mode Disabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
 A3: Mobile Data [ Set:On ] If [ %MOBILDATA ~ 1 ]
 A4: WiFi [ Set:On ] If [ %WLANTMP ~ 1 ]
 A5: Notify Cancel [ Title:Periodic internet Widget Warn Not Exist:Off ]
 A6: Variable Set [ Name:%PERIRADIO To:0 Do Maths:Off Append:Off ]
 A7: Profile Status [ Name:Periodic Internet Widget Off Set:Off ]
 A8: Timer Widget Control [ Name:Periodic Internet Type:Reset ]
 A9: [X] Timer Widget Control [ Name:Periodic Internet Type:End ]
 A10: Set Widget Icon [ Name:Periodic Internet Icon:ipack:kyotuxaeonhd:network_offline_alt ]
 A11: Timer Widget Set [ Name:Periodic Internet Seconds:1 Minutes:0 Hours:0 Days:0 ] 

Now we nee a task to do the actual work. So create this task: 
Task name: Periodic internet Widget On
 Abort Existing Task

 A1: Variable Set [ Name:%PERIRADIO To:1 Do Maths:Off Append:Off ]
 A2: Variable Set [ Name:%MOBILDATA To:1 Do Maths:Off Append:Off ] If [ %AIR ~ off ]
 A3: Variable Set [ Name:%MOBILDATA To:0 Do Maths:Off Append:Off ] If [ %AIR !~ off ]
 A4: Variable Set [ Name:%WLANTMP To:1 Do Maths:Off Append:Off ] If [ %WIFII ~R CONNECTION ]
 A5: Variable Set [ Name:%WLANTMP To:0 Do Maths:Off Append:Off ] If [ %WIFII !~R CONNECTION ]
 A6: Variable Set [ Name:%noradio To:%MOBILDATA+%WLANTMP Do Maths:On Append:Off ]
 A7: If [ %noradio ~ 0 ]
 A8:   Stop [ With Error:Off Task: ]
 A9: End If
 A10: Timer Widget Set [ Name:Periodic Internet Seconds:0 Minutes:15 Hours:0 Days:0 ]
 A11: Timer Widget Control [ Name:Periodic Internet Type:Resume ] 

The last task looks like this:
Task name: Periodic Internet

 A1: Timer Widget Set [ Name:Periodic Internet Seconds:0 Minutes:15 Hours:0 Days:0 ]
 A2: Set Widget Icon [ Name:Periodic Internet Icon:android.resource:// ]
 A3: Notify [ Title:Periodic internet Widget Text: Icon:android.resource:// Number:%SCRON Permanent:On Priority:2 ]
 A4: Profile Status [ Name:Periodic Internet Widget Off Set:On ]
 A5: Secure Settings [ Configuration:Airplane Mode Disabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
 A6: Wait [ MS:0 Seconds:30 Minutes:0 Hours:0 Days:0 ]
 A7: WiFi [ Set:On ]
 A8: Mobile Data [ Set:On ]
 A9: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
 A10: Secure Settings [ Configuration:Airplane Mode Enabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] 

Add the red lines only, if you have ROOT and want to toggle airplane mode.

You can download and import the tasks directly without the hassle here:

Profile: Periodic Internet Widget Off
Task name: Periodic internet Widget On
Task name: Periodic Internet

To see how to import them, skim this article: How to import Tasker projects, profiles, tasks and scenes 

Now we need to create the widget to actually start our "periodic internet" mode.

  1.  Add a "Tasker Timer Task" to your home screen.
  2. As the task to run select: "Periodic Internet".
  3. Set the countdown to 0:0:0:1 (One second) and activate Repeat ON
The periodic internet mode should start immediately. Don't forget, it will take 1,5 minutes, until the wifi/data or airplane mode is activated for the first time.
To deactivate the "periodic internet" mode, you should click on the permanent notification in the notification bar.

Hope it helps You :)
Leave your opinion in the comments!

Friday, August 2, 2013

[Tasker] Extreme battery saving profile

The battery life of an android phone is not impressive and we got used to charge our phones every day. Nevertheless it can happen that one finds himself in a situation with no charger in reach and no battery left. This profile will help you to avoid this situation. This profile will fire when your battery level will drop under 8% automatically. It is a drastic step, think twice before using it.
This task will:
  • Put your phone into flight mode (I warned you, drastical steps ;)
  • Set the display brightness to deep Darth Vader like darkness
Yes, you won't be reachable. But you can switch off the flight mode whenever you wish and still send or receive the important messages you would miss otherwise. In my opinion it's better then finding your phone completely drained without any options left. The phone should last minimum another hour in this mode.
You will need:

This is what my profile looks like:
Profile: Extreme battery save (28)
     State: Battery Level [ From:0 To:8 ]
Enter: Extreme battery save (3)
     A1: Auto Brightness [ Set:Off ]
     A2: Display Brightness [ Level:0 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:On ]
     A3: Load App [ App:Screen Filter Data: Exclude From Recent Apps:Off ]
     A4: Airplane Mode [ Set:On ]
     A5: Notify LED [ Title:Battery low Text:Battery under %BATT percent!
          Will switch to battery saving mode. Icon:ipack:crystalhd:cache Number:%BATT Colour:Red Rate:1000 Priority:3 ]
     A6: Zoom Visibility [ Element:Extreme battery save.w / StateON Set:On ]

The normal mode profile could look like this and be activated when a power source is connected:
Profile: Power source connected (11)
     State: Power [ Source:Any ]
Enter: Energy save (17)
     B1: Notify Cancel [ Title:Battery low Warn Not Exist:Off ]
     B2: Airplane Mode [ Set:Off ]
     B3: Display Brightness [ Level:128 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:On ]
     B4: Auto Brightness [ Set:On ]
     B5: Zoom Visibility [ Element:Extreme battery save.w / StateON Set:Off ]
     B6: Run Shell [ Command:am force-stop com.haxor Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]

The line B6 kills the screen filter app if it is running and will do nothing if it's not running. To create it go to Script -> Run shell -> and enter the command am force-stop com.haxor :) The downside of this powerful command is, it needs root. Maybe you can get the same result by setting up the action App -> Kill App -> Screen filter. No guarantee on this.
You should have problems with creating lines A6 and B5 yet, as there is no Zoom widget yet. So... stay with me after the commercial break....

...your ads here...

Again there is a widget to switch this on and off from the home screen dynamically.
My widget looks like this, you will need two icon packs and the app Zoom to get the same result:

More information on Zoom and how to setup cool widgets can be found on google and here.
Import my Zoom profile by saving the following file as "Extreme_battery_save.w.ztl.xml" under sdcard/Zoom/templates. Then open Zoom and press menu key -> Browse Templates -> Import Directory -> Extreme_battery_save.w.ztl.xml. Now create this Zoom 1x1 widget on your home screen.
<class name="Template" index="">
 <name>Extreme battery save.w</name>
 <class name="Element" index="elements0">
  <class name="ImageElement" index="state0">
 <class name="Element" index="elements1">
  <class name="ImageElement" index="state0">
   <class name="TaskAction" index="onClick0">
    <name>Extreme battery save</name>
 <class name="Element" index="elements2">
  <class name="ImageElement" index="state0">
   <class name="TaskAction" index="onClick0">
    <name>Energy save</name>

[Tasker] How to force a loud alarm on SMS / emergency SMS

If an SMS which contains (notice the "*") the text WAKEUP! comes in, your phone will alert you - no matter what. It's pretty hard to turn this alert off too ^^", you will have to stop the task.

The profile description:
Profile: Emergency SMS (72)
 Event: Received Text [ Type:Any Sender:* Content:*WAKEUP!* ]
Enter: Alarm! (71)
 Run Both Together
 A1: Play Ringtone [ Type:Alarm Sound:Ticktac alarm Stream:4 ]

Please notice the type when selecting the ringtone, the stream must be set to Alarm. Here the same as a profile to import directly:
<TaskerData sr="" dvi="1" tv="4.1u3m">
 <Profile sr="prof72" ve="2">
  <nme>Emergency SMS</nme>
  <Event sr="con0" ve="2">
   <Int sr="arg0" val="0"/>
   <Str sr="arg1" ve="3"/>
   <Str sr="arg2" ve="3">WAKEUP!</Str>
 <Task sr="task71">
  <Action sr="act0" ve="3">
   <Int sr="arg0" val="0"/>
   <Str sr="arg1" ve="3">Ticktac alarm</Str>
   <Int sr="arg2" val="4"/>

[Tasker] Take pictures of intruders and send them per mail silently

This script will detect when someone enters the wrong unlock code or swipes the wrong pattern and sends a picture to an E-Mail address in the background, silently.
For some reason it works better with long patterns and even better with long pin codes. I don't know why. If you know it, let me know :)

Let's start, please get:
  • Tasker
  • Secure Settings (To setup a profile in Tasker which detects wrong unlock codes)
  • Python for Android (To run python code)
  • SL4A (To run the python script from Tasker)
  • The python script "" from the Tasker Wiki. (Send an E-Mails silently)
  • GoogleMail address
Open the Python for Android application, make sure it is not Python3. Press install button to install the Python runtime environment.
Open SL4A and run the "" script by tapping on it and selecting the leftmost terminal icon. Congratulations, you successfully installed Python and can run Python scripts from Tasker!

Here is my "" script. It has a small modification to the original file which is marked in red.
import os
import glob
import mimetypes 
from email import encoders
from import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

def attach_files(msg, attachements):
  for attachment in attachments:
    attachment = attachment.strip()
    for path in glob.glob(attachment):
      filename = os.path.basename(path)
      if not os.path.isfile(path):
      # Guess the content type based on the file's extension.  Encoding
      # will be ignored, although we should check for simple things like
      # gzip'd or compressed files.
      ctype, encoding = mimetypes.guess_type(path)
      if ctype is None or encoding is not None:
        # No guess could be made, or the file is encoded (compressed), so
        # use a generic bag-of-bits type.
        ctype = 'application/octet-stream'
      maintype, subtype = ctype.split('/', 1)
      if maintype == 'text':
        fp = open(path)
        # Note: we should handle calculating the charset
        part = MIMEText(, _subtype=subtype)
      elif maintype == 'image':
        fp = open(path, 'rb')
        part = MIMEImage(, _subtype=subtype)
      elif maintype == 'audio':
        fp = open(path, 'rb')
        part = MIMEAudio(, _subtype=subtype)
        fp = open(path, 'rb')
        part = MIMEBase(maintype, subtype)
        # Encode the payload using Base64
      # Set the filename parameter
      part.add_header('Content-Disposition', 'attachment', filename=filename)

def sendemail(email_name, email_user, email_pswd, mailto, subject, body, attachments):
  import smtplib

  # ...unless you're rewriting this script for your own SMTP server!
  smtp_server = ''
  smtp_port = 587

  # Build an SMTP compatible message
  msg = MIMEMultipart()
  msg['Subject'] = subject
  msg['To'] = mailto
  msg['From'] = email_name + " <" + email_user + ">"
  msg.attach(MIMEText(body, 'plain'))
  attach_files(msg, attachments)

  # Attempt to connect and send the email
    smtpObj = '' # Declare within this block.
    # Check for SMTP over SSL by port number and connect accordingly
    if( smtp_port == 465):
      smtpObj = smtplib.SMTP_SSL(smtp_server,smtp_port)
      smtpObj = smtplib.SMTP(smtp_server,smtp_port)
    # StartTLS if using the default TLS port number
    if(smtp_port == 587):
    # Login, send and close the connection.
    smtpObj.login(email_user, email_pswd)
    smtpObj.sendmail(email_user, mailto, msg.as_string())
    return 1  # Return 1 to denote success!
  except Exception, err:
    # Print error and return 0 on failure.
    print err
    return 0

import sys
import android

droid = android.Android()

  email_name = droid.getIntent().result[u'extras'][u'%EMAIL_NAME']
  email_name = ''
  email_user = droid.getIntent().result[u'extras'][u'%EMAIL_USER']
  droid.makeToast('EMAIL_USER missing')
  email_pswd = droid.getIntent().result[u'extras'][u'%mailp']
  droid.makeToast('EMAIL_PSWD missing')
  mailto = droid.getIntent().result[u'extras'][u'%EMAIL_TO']
  droid.makeToast('EMAIL_TO missing')
  subject = droid.getIntent().result[u'extras'][u'%EMAIL_SUBJECT']
  subject = ''
  body = droid.getIntent().result[u'extras'][u'%EMAIL_BODY']
  body = ''
  attachments = droid.getIntent().result[u'extras'][u'%EMAIL_ATTACH']
  attachments = attachments.split(',')
  attachments = ''

# Send email 
if (sendemail(email_name, email_user, email_pswd, mailto, subject, body, attachments)):
  # Exit with error if email is not sent successfully
  droid.makeToast('email failed')

Save this file to your internal SDCard in the SL4A scripts folder (f.e. SDCard\SL4A\Scripts).

The preparation is done, lets go to Tasker. Create a new profile name it "Security Glitch" or something less obvious. Goto State -> Plugin -> Secure Settings. Click on the Edit field near configuration and select the condition "Failed Login Attempts". Type in a low number, like two. Enable "Device Admin". Read and accept the dialog. Click on save in the lower left corner. Hit the back button and create a new Task, name it "Cheeeese" or similar.
Here is my Cheeeese task:
Cheeeeese (45)
 Stay Awake
 A1: Vibrate [ Time:200 ]
 A2: Mobile Data [ Set:On ]
 A3: WiFi [ Set:On ]
 A4: Variable Add [ Name:%PHOTONUMBER Value:1 Wrap Around:0 ]
 A5: Take Photo [ Camera:Front Filename:%PHOTONUMBER Naming Sequence:None Insert In Gallery:Off Discreet:On Resolution:320x240 Scene Mode:Auto White Balance:Auto Flash Mode:Auto ]
 A6: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
 A7: Load Image [ Source:/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg ]
 A8: Rotate Image [ Direction:Right Degrees:90 ]
 A9: Save Image [ File:/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg Image Quality:70 Delete From Memory After:On ]
 A10: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
 A11: Variable Set [ Name:%EMAIL_USER Do Maths:Off Append:Off ]
 A12: Variable Set [ Name:%EMAIL_P To:MyCleartextPassword Do Maths:Off Append:Off ]
 A13: Variable Convert [ Name:%EMAIL_P Function:Base64 Encode Store Result In:%EMAIL_P ]
 A13: Variable Convert [ Name:%EMAIL_P Function:Base64 Decode Store Result In:%mailp ]
 A14: Variable Set [ Name:%EMAIL_TO Do Maths:Off Append:Off ]
 A15: Variable Set [ Name:%EMAIL_ATTACH To:/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg Do Maths:Off Append:Off ]
 A16: Run SL4A Script [ Terminal:Off Pass Variables:%EMAIL_USER,%mailp,%EMAIL_TO,%EMAIL_ATTACH Continue Task After Error:On ]
 A17: Vibrate [ Time:616 ]

And here you can see the profile as an xml to directly import into Tasker, save it as SecurityGlitch.prf.xml.
<TaskerData sr="" dvi="1" tv="4.1u3m">
<Profile sr="prof44" ve="2">
<nme>Security Glitch</nme>
<State sr="con0">
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra.BLURB>Failed Login Attempts - Max: 2</com.intangibleobject.securesettings.plugin.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB>Failed Login Attempts - Max: 2</com.twofortyfouram.locale.intent.extra.BLURB>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Task sr="task45">
<Action sr="act0" ve="3">
<Int sr="arg0" val="200"/>
<Action sr="act1" ve="3">
<Int sr="arg0" val="1"/>
<Action sr="act10" ve="3">
<Str sr="arg0" ve="3">%EMAIL_USER</Str>
<Str sr="arg1" ve="3"></Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Action sr="act11" ve="3">
<Str sr="arg0" ve="3">%EMAIL_P</Str>
<Int sr="arg1" val="25"/>
<Str sr="arg2" ve="3">%email_p</Str>
<Action sr="act12" ve="3">
<Str sr="arg0" ve="3">%EMAIL_TO</Str>
<Str sr="arg1" ve="3"></Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Action sr="act13" ve="3">
<Str sr="arg0" ve="3">%EMAIL_ATTACH</Str>
<Str sr="arg1" ve="3">/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Action sr="act14" ve="3">
<Str sr="arg0" ve="3"></Str>
<Int sr="arg1" val="0"/>
<Str sr="arg2" ve="3">%EMAIL_USER,%email_p,%EMAIL_TO,%EMAIL_ATTACH</Str>
<Action sr="act15" ve="3">
<Int sr="arg0" val="616"/>
<Action sr="act2" ve="3">
<Int sr="arg0" val="1"/>
<Action sr="act3" ve="3">
<Str sr="arg0" ve="3">%PHOTONUMBER</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
<Action sr="act4" ve="3">
<Int sr="arg0" val="1"/>
<Str sr="arg1" ve="3">%PHOTONUMBER</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="1"/>
<Str sr="arg5" ve="3">320x240</Str>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
<Int sr="arg8" val="0"/>
<Action sr="act5" ve="3">
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="3"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Action sr="act6" ve="3">
<Img sr="arg0" ve="2">
<Action sr="act7" ve="3">
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Action sr="act8" ve="3">
<Str sr="arg0" ve="3">/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg</Str>
<Int sr="arg1" val="70"/>
<Int sr="arg2" val="1"/>
<Action sr="act9" ve="3">
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Img sr="icn" ve="2">

Please make sure the folder "/sdcard/DCIM/Tasker/" exists and you have the right information filled in in the purple fields. You can put a file named .nomedia into the DCIM/Tasker/ folder to make sure, it is not displayed in the gallery.
If you don't know how to setup a specific action, please google it. Line A16 is very important. To create this line goto Script -> RunSL4A Script -> in the name field select the "" file. Don't check the Terminal field, but fill in the Pass Variable field with %EMAIL_USER,%mailp,%EMAIL_TO,%EMAIL_ATTACH. The order is important. Check continue task after error.

You can delete the bright blue lines after running the Task once successfully. Please note, that your Google Mail password is stored as a global variable in Tasker Base64 encoded - but it is not a safe encryption! If you have suggestions on how to store the password encrypted n Tasker, please tell me!

Run the task a few time to check if your device vibrates twice (short vibrate at the beginning and a long vibrate at the end. Check your mails, don't forget to look into the spam folder. If you received a picture exit Tasker, lock your device, count to ten and check by entering the wrong unlock code/pattern a few time. Maybe you can make the profile run with a higher priority, not necessary. If everything went well and you received the beautiful pictures of yourself delete the bright blue lines.
Uninformatively there is an android limitation which will show the SL4A icon for a second in the notification bar when the email is send... I tried to make python run without SL4A, but was not successful yet. A workaround could be to make the icon transparent...

I wrote this down pretty fast, please forgive me if something is unclear. I will refresh this post soon.

Monday, July 29, 2013

[Tasker] Be informed about software progress

I got my phone repaired and started programming again.

Here my newest script result:

Its shows the progress of an automated measurement system (Done by me with AutoIt, but that's a different story, think of AutoIt as Tasker for Windows - give it a try and the developers and huge thanks :D ).

Why I need this?
I'm currently working with CMOS MAPS (Monolithic Active Pixel Sensors). They need to be programmed and we measure different parameters after setting a huge amount of settings... This takes a lot of time and effort. The runs take much time and if the system breaks down one looses expensive measurement time. So its a huge benefit to run the whole procedure automatically, as it should be running 24/7 and one needs to know as soon as possible, that something went wrong.

The system is called MABS  as it is a Mimosa Automation Bot System ;)

But that's not the point. The point is this tiny notification in your Android pulldown menu!

So basically your Android phone is capable of getting the progress and error/warning statuses of every software you programmed! The setup is very easy. I will post it here soon (this week)! Stay tuned and sorry for not posting in the last time. I promise to improve ;)

Monday, June 10, 2013

[Tasker] Todo list

 Which Tasker tasks I'm going to post soon:

  • React to content of WhatsApp messages in Tasker
  • Sync data between different android devices and display in one synced widget
  • Configure an emergency message which will force the phone to make a loud sound, even in silent mode
  • Boot computer when coming home
  • Less energy expensive accurate GSM based location checks
  • Extreme energy saving mode (only 1% battery usage per hour)
  • Extract information from different websites and display it compact in one scene
  • Force reconnection to automatically deactivated WiFi networks
  • Create a widget which displays the last WhatsApp an SMS messages of a chosen person
  • Create a slick widget which takes spy photos without any notification or other evidence
  • Make a Jarvis like assistant (Iron Man)

[Tasker] Make Tasker read aloud all incoming notifications and messages

Okay, this one is pretty simple, but still impressive. And that's how a good idea should be, right?
The title says it all, Tasker shall read aloud all the incoming notifications, including SMS, missed calls and if you followed my previous WhatsApp guide even complete incoming WhatsApp messages.

All you have to do is to create this profile and task:
Profile: Notification Read
 Event: Notification [ Owner Application:* Title:* ]
 State: Variable Value [ Name:%DRIVE Op:Matches Value:1 ]
Enter: Notification Read
 A1: Say [ Text:%NTITLE Engine:Voice:default:en Stream:3 Pitch:4 Speed:4 Continue Task Immediately:Off ] 

Thats it! After you set the global variable %DRIVE to 1 you have your own drive mode!
Of course you can place a beatiful widget on your homescreen to do so (hover me):


The On/Off widget

We need another Tasker task to set the global variable to 1 and 0. The task can look like this:
Driver Mode
 A1: If [ %DRIVE ~ 1 ]
  A2: Variable Set [ Name:%DRIVE To:0 Do Maths:Off Append:Off ] 
  A3: Zoom Element Visibility [ Element:Driver Mode.w / StateON Set:Off ] // You cannot create this yet! Wait till Zoom widget on homescreen. 
 A4: Else 
  A5: Variable Set [ Name:%DRIVE To:1 Do Maths:Off Append:Off ] 
  A6: Media Volume [ Level:10 Display:Off Sound:Off ] 
  A7: Zoom Element Visibility [ Element:Driver Mode.w / StateON Set:On ] // You cannot create this yet! Wait till Zoom widget on homescreen.
  A8: Say [ Text:Allright, notification-read loaded! Engine:Voice:default:en Stream:3 Pitch:4 Speed:4 Continue Task Immediately:Off ] 
 A9: End If 

Now we need the widget. Let's make this widget with Zoom. Create a widget like described in the previous post "Energy saving mode" in chapter The "periodic internet On/Off" widget. The only differences are the name of the widget, the Task to execute and the images to use. I named the widget and the task to execute Driver mode. Notice, that for ON and OFF we execute here the same task defined above. The adorable Pacman graphic can be found in the I Like Buttons HD icon pack. Use a lower alpha value, as described here, to get the transparent look when the driver mode is set to OFF. Add the Zoom widget to your home screen and don't forget to add lines A3 and A7 to your Driver mode task.

I'm still working on this driver mode and hopefully can present soon a solution to answer WhatsApp messages, SMS and phone calls hands free by using the Tasker Get speech action. Have fun!