HomeTaskerTasker Emergency Profile - When out and about!

Tasker Emergency Profile – When out and about!

Going out and about? Make sure someone knows where you are.

It’s all good until somebody gets hurt. As a keen cyclist, I have had a fair share of punctures, and few scraps with cars or near road obstacles. Fortunately, I came out of it unscathed. I’m also responsible for some of that grey hair my mum got, by not telling her where I am and when I will be back. Perhaps it is too little, too late for me, but you may be the right person to talk to. The Tasker Emergency Profile will let the designated person know your whereabouts without draining your battery. Perhaps it won’t prevent you from getting in troubles in the first place, but it could make saving your neck little easier.

Tasker Emergency Profile – not only for cycling

This profile is responsible for reporting. It will issue a text message (yes, good old fashion text in case you have no internet coverage) to the person of your choice when:

  • when you leave (it will let them know what time you should be back, and how to request your location)
  • when your battery is about to die (so, they wouldn’t get worried sick)
  • when you have changed your plans and you are running late (cause it makes sense to keep your close ones updated)
  • when you got safely home (so they would stop worry sick)
  • AND I hope that won’t happen when something happened, and you are not back home when you suppose to (so they could find your last location or request one)

GPS is an old debate. It uses a lot of battery power which is so precious when outside. Strava and other fitness trackers can share live location updates for the same purposes, but this will drain your battery considerably faster.  Tasker Emergency Profile will save you some juice by checking your location on request only. I see on forums that a lot of users still trying to toggle GPS, I left this out in this tutorial. Unless there are some privacy concerns, GPS and location reporting works well as it is.

Conditions

The Tasker Emergency Profile contains  5 contexts. These aren’t actually complicated, 3 of them, responsible for returning the location via SMS are linked to the same task, one to cancel the profile altogether. The last one makes sure we can send out a text message.

Low Battery Update

screenshot_20161020-120251


Because I want this profile to be active only when I’m cycling, I have created the variable %BikeRide this will be one of the conditions in my profiles. The second context is battery level which is set to 0-5. This should have enough juice to get the last location and send the SMS. I have picked bigger number instead of 2% just in case we are outside the network, and the SMS is pending to be sent for a while.

Text Location Update

screenshot_20161020-120255

While on the bike, any (or defined – up to you) contact can use a keyword to request your location. The text has to contain the exact word, but the word can be placed anywhere in your regular text. This remains active for the duration of your bike ride. After all – you may not always want to share your position. Just in case you wish to go for that quick drink after work.

Time Condition Update

screenshot_20161020-120300

If you are running late, this condition sends the text message unless an action is taken. Without some sensors running wildly and sucking in all the battery power you have left, it is hard to tell when you had an accident. If you have been involved in one, and you are not back on time, the profile will become active and sends a text message out.

Home – close on WiFi

screenshot_20161020-120308

Let’s face it, chances are that you will forget once or twice to turn this off in time. If you have a home area set up to enable the WIFI on your phone, this will disable the Tasker Emergency Profile when you have connected again to the home Wi-Fi.

Signal check

screenshot_20161020-120313

This is a simple profile that checks the signal strength. If a signal is present, variable %InRange is set to 1, otherwise, it is 0. This profile will be used with Wait Until action – to make sure that the SMS is sent when the signal is present.

Tasks

screenshot_20161020-123238

Tasks are kept fairly simple too. As you have seen in the contexts section Tasker Emergency Profile reuses Send Location profile multiple times. The entire project starts with the Start task. As the tasks are fairly simple please look at the bottom of the page for the action list.

Start

This is where we are going to create and display 1st scene (Bike 999). Later on, I have added a destroy scene as my 1st action to make sure I have an escape, should I close the scene via the back button.

Send Location

To get the location with a pin on google maps we have you query the coordinates. Fortunately, the location coordinates provided by Tasker (variable %LOCN) are formatted correctly and all we have to do is plug it in inside this URL:

https://maps.google.com/maps?q=loc:%LOCNz=12

The value of b is responsible for a zoom level when the link is opened. This link works with both Google Maps app and web interface. When the link is composed Wait Until action and %InRange variable sends the text message only when the networks allows us to do so. By default my text looks like this:

Currently about %LOCACC m away from %GoogleURL

However, if my battery is low, I’d like to send a slightly different message. This also allows me to have all three profiles using the same task:

My phone battery is low.  Just want to let you know where I am.  I went for a bike ride. Currently about %LOCACC m away from %GoogleURL. I’ll call you once I’m back home.

Extend

If I’m running late, I need to pull up a new scene (Extend) and pick new ETA for my return. This task cancels the notification and opens a new scene for me.

Got Home

Once I’m back home, I have to close the profile and let the person know I’m OK. Both manual deactivation and the Wi-F- context is linked to this task. It will deactivate the needed profiles, cancels the notification, sends the message out that I’m safe and then clears the %Bike* variables.

InRange+/-

As discussed in the Signal check condition.

Scenes

Bike 999

screenshot_20161020-125009


All interactive elements (apart from the OK button) do the same thing. They set a value  %new_val to a specific variable. So for number pickers its %BikeHour and %BikeMinute. For the text entry, it is %EmergencyContact and for the checkbox it is %EmergencySend. These are assigned when changed, and the OK button is dealing with the default values and processing the text message.

Few things to discuss here.
A1-A5 – obvious.
A6 – assign the default contact number
A7-A8 – assign the defaults for number pickers
A9 – A10 – Create a variable which will format the time correctly for the SMS. If values are <10 additional zeros are added.
A11 – This variable is used in the Time contexts, needs no zeros but requires a ‘.‘ to work in the context
A12 – notification contains two actions – Extend and End
A16:

Hey!  I’m going on a bike ride.  I should be back at %ReturnTime.  You can always look up my location via text.  Use LOCATION in your text to receive the update. Is im not back by the time listed give me a call.

Message with instructions which is sent if tick box was selected.

Extend


This scene was made as a copy of Bike 999 one. Then other elements were removed and the OK button has been modified a little. Save yourself the trouble and finish the 1st scene first and you will notice that there are only a few things to change.
Remove the actions that don’t belong to this list.  then change your text message to reflect the action:

It’s taking little longer.  I should be back by %ReturnTime

And you are pretty much done here.

Conclusion

Tasker Emergency Profile can have more than one use. Whether you are going for a long bike ride or just a crazy night this profile could increase your safety. Perhaps you are still young and it could be an additional argument presented to your parents to let you go out for longer, or a hiking trip. I think I covered most common scenarios, but the project is not limited to these uses.

Low Battery UpdateTime Condition CheckSignal CheckText Location UpdateHome - Close on WIFI
Profile: Low Battery Update
	State: Battery Level [ From:0 To:5 ]
	State: Variable Value [ %BikeRide ~ 1 ]
Enter: Send Location 
	A1: Get Location [ Source:Any Timeout (Seconds):40
            Continue Task Immediately:Off Keep Tracking:Off ] 
	A2: Variable Set [ Name:%GoogleURL 
            To:https://maps.google.com/maps?q=loc:%LOCN&z=12 
            Recurse Variables:Off Do Maths:Off Append:Off ] 
	A3: Wait Until [ MS:0 Seconds:5 Minutes:0
            Hours:0 Days:0 ] If [ %InRange ~ 1 ]
	A4: Send SMS [ Number:%SMSRF Message:Currently about
            %LOCACC m away from %GoogleURL 
            Store In Messaging App:Off ] If [ %BATT > 5 ]
	A5: Send SMS [ Number:%SMSRF Message:My phone battery is low.  
            Just want to let you know where I am.  
            I went for a bike ride. Currently about %LOCACC m away 
            from %GoogleURL. 
            I'll call you once I'm back home. 
            Store In Messaging App:Off ] If [ %BATT < 6 ]
Profile: Time Condition Update
	Time: From %BikeTime Till %BikeTime
	State: Variable Value [ %BikeRide ~ 1 ]
Enter: Send Location
	A1: Get Location [ Source:Any Timeout (Seconds):40 
            Continue Task Immediately:Off Keep Tracking:Off ] 
	A2: Variable Set [ Name:%GoogleURL 
            To:https://maps.google.com/maps?q=loc:%LOCN&z=12 
            Recurse Variables:Off Do Maths:Off Append:Off ] 
	A3: Wait Until [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ] 
            If [ %InRange ~ 1 ]
	A4: Send SMS [ Number:%SMSRF Message:Currently about %LOCACC m 
            away from %GoogleURL Store In Messaging App:Off ]
            If [ %BATT > 5 ]
	A5: Send SMS [ Number:%SMSRF Message:My phone battery is low.
           Just want to let you know where I am. I went for a bike ride. 
           Currently about %LOCACC m away from %GoogleURL.
           I'll call you once I'm back home.
           Store In Messaging App:Off ] If [ %BATT < 6 ]
Profile: Signal Check 
	State: Signal Strength [ From:1 To:8 ]
Enter: In Range+ 
	A1: Variable Set [ Name:%InRange To:1 
            Recurse Variables:Off Do Maths:Off Append:Off ] 

Exit: In Range-
	A1: Variable Set [ Name:%InRange To:0
            Recurse Variables:Off Do Maths:Off Append:Off ] 
Profile: Text Location Update 
	Event: Received Text [ Type:SMS Sender:C:ANY Content:*LOCATION* ]
	State: Variable Value [ %BikeRide ~ 1 ]
Enter: Send Location 
	A1: Get Location [ Source:Any Timeout (Seconds):40 
            Continue Task Immediately:Off Keep Tracking:Off ] 
	A2: Variable Set [ Name:%GoogleURL
            To:https://maps.google.com/maps?q=loc:%LOCN&z=12 
            Recurse Variables:Off Do Maths:Off Append:Off ] 
	A3: Wait Until [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
            If [ %InRange ~ 1 ]
	A4: Send SMS [ Number:%SMSRF Message:Currently about %LOCACC m
            away from %GoogleURL Store In Messaging App:Off ]
            If [ %BATT > 5 ]
	A5: Send SMS [ Number:%SMSRF Message:My phone battery is low. 
            Just want to let you know where I am.  
            I went for a bike ride. Currently 
            about %LOCACC m away from %GoogleURL. 
            I'll call you once I'm back home.
            Store In Messaging App:Off ] If [ %BATT < 6 ]
Profile: Home -  Close On WIFI 
	State: Wifi Connected [ SSID:FASTBERRY MAC:* IP:* ]
	State: Variable Value [ %BikeRide ~ 1 ]
Enter: Got Home 
	A1: Profile Status [ Name:Low Battery Update Set:Off ] 
	A2: Profile Status [ Name:Text Location Update Set:Off ] 
	A3: Profile Status [ Name:Time Condition Update Set:Off ] 
	A4: Profile Status [ Name:Signal Check Set:Off ] 
	A5: Notify Cancel [ Title:Bike Profile Active Warn Not Exist:Off ] 
	A6: Wait Until [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
            If [ %InRange ~ 1 ]
	A7: Send SMS [ Number:%EmergencyContact
            Message:I'm back home now.  Thanks. Store In Messaging App:Off ] 
	A8: Variable Clear [ Name:%Bike* Pattern Matching:On ] 

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

New to Tasker?

Tasker Quick Start – Getting started with Tasker

0
From newb to not so newbie in 10 min

Best Tasker Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

How to wake on LAN computers and put it to sleep with Power Menu,...

0
How to Wake on LAN properly via Android, Alexa, Google Assistant and Web

7 awesome Bluetooth keyboard shortcuts for Android

0
7 unique Android shortcuts that you can add to any Bluetooth keyboard.

Smart overnight charging with Tasker

0
Still keeping your phone plugged in overnight? Try smarter overnight charging with this profile

One thing that Join app can’t do and how to fix it with Tasker

0
It's not possible to share the clipboard automatically between join accounts registered to 2 different emails. But you can fix this with tasker.

Essential Guides

Tasker: Seconds into DD:HH:MM:SS (dynamic)

0
It's time to.... ok it's a pun, but I will show you how to master time and convert seconds to DD:HH:MM:SS dynamically

4 ways to organise Tasker projects

0
Keep your Tasker tidy!

A better way to store Tasker credentials

0
The more clever way of managing credentials

Annoyed with dozens of AutoApps populating your app drawer? Here is a fix!

0
Clear your app drawer from the clutter in seconds

Putting AutoTools pie chart to a good use – SSID logger

0
Who wants a piece of the pie (chart)?