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 mom got, by not telling here 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 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
Text Location Update
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
Home – close on WiFi
Signal check
Tasks
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:
[code]http://maps.google.com/maps?q=loc:%LOCNz=12[/code]
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
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, if I’m not back by the time listed give me a call.
Message with instructions which is sent if tick box was selected.
Extend
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.
[tabs tab1=”Low Batt Update” tab2=”Text Loc Update” tab3=”Time Condition Update” tab4=”Home” tab5=”Signal check”] [tabs] [tab id=1]
[code]Profile: Low Batt Update (12) State: Battery Level [ From:0 To:5 ] State: Variable Value [ %BikeRide ~ 1 ] Enter: Send Location (10) A1: Get Location [ Source:Any Timeout (Seconds):40 Continue Task Immediately:Off Keep Tracking:Off ] A2: Variable Set [ Name:%GoogleURL To:http://maps.google.com/maps?q=loc:%LOCN&z=12 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 ] [/code][/tab] [tab id=2]
[code]Profile: Text Loc Update (13) Event: Received Text [ Type:SMS Sender:C:ANY Content:*LOCATION* ] State: Variable Value [ %BikeRide ~ 1 ] Enter: Send Location (10) A1: Get Location [ Source:Any Timeout (Seconds):40 Continue Task Immediately:Off Keep Tracking:Off ] A2: Variable Set [ Name:%GoogleURL To:http://maps.google.com/maps?q=loc:%LOCN&z=12 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 ] [/code][/tab] [tab id=3]
[code]Profile: Time Condition Update (30) Time: From %BikeTime Till %BikeTime State: Variable Value [ %BikeRide ~ 1 ] Enter: Send Location (10) A1: Get Location [ Source:Any Timeout (Seconds):40 Continue Task Immediately:Off Keep Tracking:Off ] A2: Variable Set [ Name:%GoogleURL To:http://maps.google.com/maps?q=loc:%LOCN&z=12 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 ] [/code][/tab] [tab id=4]
[code]Profile: Home(44) State: Wifi Connected [ SSID:FASTBERRY MAC:* IP:* ] State: Variable Value [ %BikeRide ~ 1 ] Enter: Got Home (43) 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 ] [/code][/tab] [tab id=5]
[code]Profile: Signal Check (11) State: Signal Strength [ From:1 To:8 ] Enter: In Range+ (31) A1: Variable Set [ Name:%InRange To:1 Do Maths:Off Append:Off ] Exit: In Range- (40) A1: Variable Set [ Name:%InRange To:0 Do Maths:Off Append:Off ] [/code][/tab] [/tabs]