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!

[Tasker] How to make accurate location checks without GPS or WiFi

Tasker has a nice option build in to check for locations. I found, that this method was not very reliable when no GPS was activated. Here I want to present an idea of location checks only with GSM cell info, no internet connection, WiFi or GPS needed. In my opinion it is the most energy conserving method possible.

Create a new profile, name it Home GSM for example. As the trigger select State -> Phone -> Cell Near. Press scan and take a walk inside you domesticity. Take your time, your phone scans for near GSM cells and measures there signal strength, this information is used to triangulate your position. When you think you are done, go back and create a new Task, name it Home On. Inside of it set a new variable %HOME to 1. Exit the newly created profile and add en exit task, name it Home Off and set the global variable %HOME to 0. You are done. Your profile should look like this:
Profile: Home GSM
 State: Cell Near [ Cell Tower / Last Signal:
      GSM:1234.56789 / 0
      GSM:1234.57719 / 2
      Ignore Cells:* ]
Enter: Home On
 A1: Variable Set [ Name:%HOME To:1 Do Maths:Off Append:Off ] 

Exit: Home Off
 A1: Variable Set [ Name:%HOME To:0 Do Maths:Off Append:Off ] 

Now we create a second profile, this one will check whether you are home for sure. Create a profile Check Home, it should be activated when the variable %HOME is set to 1. Create a new task, name it Check Home, inside of it place a wait for 1 or 2 minutes. After that place an if clause and check, whether the variable %HOME is still set to 1. If so, you are probably at home! To be even more sure, place another wait for 1 minute and afterwards another if to check if the cells near you match the pattern at your home. Make sure to set the collision handling of the task to Abort new Task and the cool down time to, lets say, 120 seconds in the Task Properties. Your finished task could look like this:
Profile: Check Home
 Priority: 5 CoolDown: 120
 Event: Variable Set [ Variable:%HOME Value:1 ]
Enter: Check Home
 A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ] 
 A2: If [ %HOME ~ 1 ]
  A3: Variable Set [ Name:%OUTSIDE To:0 Do Maths:Off Append:Off ] 
  A4: Notify Sound [ Title:Home sweet home! Text: Icon:ipack:iconedenthemeshd:twitter_8 Number:0 Sound File:/system/media/audio/notifications/S_Knock.ogg Priority:3 ] 
  A5: Perform Task [ Name:WiFi On Stop:Off Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ] 
  A6: Perform Task [ Name:LOG write Stop:Off Priority:5 Parameter 1 (%par1):Home Parameter 2 (%par2): Return Value Variable: ] 
  A7: Mobile Data [ Set:Off ]
  A8: Ringer Volume [ Level:5 Display:Off Sound:Off ] 
  A9: Variable Query [ Title:Start PC? Variable:%pcstart Input Type:Numeric / Integer Default:3665 Background Image:Pictures/Wallpaper/hi_tech_texture-wallpaper-1920x1200.jpg Layout:Question Yes No Timeout (Seconds):60 Show Over Keyguard:On ] If [ %WIFII ~R MyHomeWiFiSSID ]
  A10: If [ %pcstart ~ 3665 ]
   A11: WoL Wake On Lan Wan Settings[ Configuration:Home Package:com.benfinnigan.wol Name:WoL Wake On Lan Wan Settings]
  A12: End If 
 A3: End If 

As you can see I placed various other tasks I want to be run when I come home inside the if clause. For example I get asked to turn my computer on. I used the free app Wol Wake on Lan Wan from Brobble to do this, as it offers a Tasker plugin. In my actual Check home profile I placed all the got-home-goodness in a separate task I call within the Check home task. This way I can place a 15 minutes wait before asking about booting the computer without interfering with the original Check home task.

To learn more about Wake-On-Lan Packages and how you can use them to turn your computer on remotely please read one of the numerous guides on the internet, for example the short and nice guide HowTo Wake-On-Lan from Brobble and the very good article Access Your Computer Anytime and Save Energy with Wake-on-LAN on lifehacker from Adam Pash.

I hope some of you find this location check method useful and improve there android experience with this trick :) What tasks do you run automatically when you come home? Leave your ideas in the comments!