Monday, June 10, 2013

Multi Tiered Menu for Pebble Tasker

I recently switched over to Android and have had lots of fun with integrating my Pebbles with the phone. One of the apps that is worth mentioning is Pebble tasker.

It is a great app created by Hernan Cosi which allows android users to integrate their Pebbles with the Tasker app.

One current limitation is that it only has 1 page with 3 task slots. In a recent update, the Tasker app is allowed to re-assign tasks that are displayed on the Pebble tasker watchapp.

I made some tweaks to this page in order to get a virtually tiered menu.

The general concept looks a little like that:














So here goes.












I created 3 tabs in the Tasker app to keep things organized.
Tab 1: Page management (The one with a Pebble Icon)
Tab 2: Contacts
Tab 3: Messages
(You can create a tab by tapping-and-holding the "Home' icon at the bottom of the screen and select "Add" when the menu pops up.)





In Tab 1 (Page Management), the following tasks are created:

Task 1:
Task name: Home Page
1. Variable Set
%PEBPAGE, 1

2. Variable Clear
%PTNUM

3. Variable Clear
%PEBCALL

4. Perform Task
Page Cycle

Task 2:
Task Name: Next Page
1. Variable Set
%PEBPAGE, 0
If %PEBPAGE !Set

2. Variable Add
%PEBPAGE, 1

3. Perform Task
Page Cycle

Task 3: (This task should be the last to be created, after everything else is done.)
Task Name: Page Cycle
1. Pebble Tasker //This is Page 1 of Tier 1 (Main Menu)
Change Tasks
If %PEBPAGE = 1
-
PebTask 1: Call Contact
PebTask 2: Send SMS
PebTask 3: Next Page
-

2. Pebble Tasker //This is Page 2 of Tier 1 (Main Menu)
Change Tasks
If %PEBPAGE = 2
-
PebTask 1: ID Song //You can find out how to create this task here
PebTask 2: Screen
PebTask 3: Home Page
-

3. Pebble Tasker //This is Page 1 of Tier 2 (Send SMS)
Change Tasks
If %PEBPAGE = 11
-
PebTask 1: Contact 1
PebTask 2: Contact 2
PebTask 3: Next Page
-

4. Pebble Tasker //This is Page 2 of Tier 2 (Send SMS)
Change Tasks
If %PEBPAGE = 12
-
PebTask 1: Contact 1
PebTask 2: Contact 2
PebTask 3: Home Page
-

5. Pebble Tasker //This is Page 1 of Tier 3 (Quick Messages)
Change Tasks
if %PEBPAGE = 21
-
PebTask 1: W R U?
PebTask 2: Message 2
PebTask 3: Next Page
-

6. Pebble Tasker //This is Page 2 of Tier 3 (Quick Messages)
Change Tasks
if %PEBPAGE = 22
-
PebTask 1: Message 3
PebTask 2: Message 4
PebTask 3: Home Page
-

//Note: You can add as many tiers as you like. I have set %PEBPAGE to increase by 10 when pressing "Next Page" so that I can have at least 9 pages per tier.

In Tab 2 (Contacts), the following tasks are created:

Task 1:
Task Name: Call Contact
1. Variable Set
%PEBCALL, 1

2. Variable Set
%PEBPAGE, 11

3. Perform Task
Page Cycle

Task 2:
Task Name: Send SMS
1. Variable Set
%PEBPAGE, 11

2. Perform Task
Page Cycle

Task 3:
Task Name: CallSMS
1. If %PEBCALL = 1
2. Variable Clear
%PEBCALL
3. Variable Set
%PEBPAGE, 1
4. Perform Task
Page Cycle
5. Call
%PTNUM
6. Variable Clear
%PTNUM

7. Else
8. Variable Set
%PEBPAGE, 11
9. Perform Task
Page Cycle

Task 4:
Task Name: SMS Notify
1. Pebble Notifier
Notification with title: "SMS Sent" and body: "SMS sending completed"
//This is just to send me an alert that my task has completed.

Task 5:
Task Name: Contact 1 //Replace with your contact's name.
1. Variable Set
%PTNUM, 123456789 //Replace the number with your actual contact's phone number :)

2. Perform Task
CallSMS

//Repeat Task 5 for all the contacts you want to create.

In Tab 3 (Message), the following tasks are created:

Task 1:
Task Name: W R U?
1. Send SMS
Number:  %PTNUM
Message:  Where are you?
If %PTNUM != 0

2. Variable Clear
%PTNUM

3. Variable Set
%PEBPAGE, 1

4. Perform Task
SMS Notify

5. Perform Task
Page Cycle

//Repeat Task 1 for all the messages you want to perform.

As of now, I'm waiting excitedly for the new update to arrive, given the hints of 'Press and Hold' functionality and such.

Currently, my tasker sequence has been written such that you have to scroll to the last page in order to cycle back to the home page. If you are in the second/third tier of the menu, you have to scroll to the last page of that tier to cycle back to the home page, otherwise 2 buttons will be used for navigation (Something i'm trying to avoid.)

With the 'Press and Hold', I can use the bottom button as full navigation, both forward and backwards.

For Example:
Hold >> Back one page.
Press once >> Forward one page.

Note: Each time you select a task, it should take about 3 seconds for the to load.

That should be all I have for now! Do feel free to ask any questions! :)