Post Reply

Tasker/TasGear samples

OP Brendo

19th February 2015, 08:44 AM   |  #121  
Junior Member
Thanks Meter: 11
 
25 posts
Join Date:Joined: Sep 2011
Here is another method for sending multiple variables to the gear without root or the use of run shell commands. In my previous example I've showed you how to send variables individually one at a time without erasing other variables in your gear set up. But what if you want to send a lot of variables at once? Run shell command still seems like the best way in this situation vs. sending many different sent intents in a row (even though you could with the previous example). Here is a second method I use, which I also use in conjunction with my first method...
Let's say you have 8 variables that you want to update on the gear at the same time:
%CURRENTTEMP
%TEMPHIGH
%TEMPLOW
%WEATHERCONDITION
%SUNRISETIME
%SUNSETTIME
%WINDSPEED
%WINDDIRECTION

On the PHONE:
Set them all to one variable seperated by @'s, then sent intent that variable to the gear like so:

VARIABLE SET
%WEATHER
to %CURRENTTEMP@%TEMPHIGH@%TEMPLOW@%WEATHERCONDITION@ %SUNRISETIME@%SUNSETTIME@%WINDSPEED@%WINDDIRECTION

SEND INTENT
com.orbonis.gear.tasker.MESSAGE_GEAR
EXTRA:
PHONE_WEATHER: %WEATHER

On the GEAR:
Receive the intent and set local variable to a global variable. Then variable split it with splitter "@". You now have an array with 8 values that can be accessed individually.

VARIABLE SET
%P_WEATHER
To
%phone_weather
IF
%phone_weather SET

VARIABLE SPLIT
%P_WEATHER
Splitter: @
Delete Base
IF
%phone_weather SET

You now have:
%P_WEATHER1 = %CURRENTTEMP
%P_WEATHER2 = %TEMPHIGH
%P_WEATHER3 = %TEMPLOW
%P_WEATHER4 = %WEATHERCONDITION
%P_WEATHER5 = %SUNRISETIME
%P_WEATHER6 = %SUNSETTIME
%P_WEATHER7 = %WINDSPEED
%P_WEATHER8 = %WINDDIRECTION

Any of these array values can be used normally as a regular variable in a zooper configuration or whatever you wish to do with them.
The Following 2 Users Say Thank You to edwardsc005 For This Useful Post: [ View ]
Today, 10:14 AM   |  #122  
Junior Member
Thanks Meter: 11
 
25 posts
Join Date:Joined: Sep 2011
Full weather replacement for Gear
Here is my current weather replacement set up for the gear.
On the PHONE:

PROFILE 1 (pull weather data every hour)
Add Event>Date/Time>Repeat:every 1 Hour(s)
--->Task "Get Weather"
+
PROFILE 2 (pull weather data on sunrise/sunset times)
Add Event>State>Variables>Variable Value (Conditions: %DAY = %TIME (OR) %DARK = %TIME)
--->Task "Get Weather"

TASK "Get Weather" (Prompt for the Zip Code if one isn't set. Turn on internet if it's not on already and wait a few seconds to establish connection to avoid HTTP Get error...If internet is not working (poor signal) then skip to end of task. Otherwise get data, break it down, store it to a variable and send it to the gear, then turn off internet if it was off to begin with)

1. Show Scene>Name 'Get ZIP'>Display As 'Dialog, Dim Behind Heavy'>Show Exit Button>Continue Task Immediately 'unchecked'>IF %ZIPCODE Isn't Set
2. Test Net>Connection Type>Store Result In '%Test'
3. Mobile Data>Set On IF %TEST eq none
4. Wait>5 seconds IF %TEST eq none
5. HTTP Get>Server:Port 'xml.weather.yahoo.com/forecastrss?p=%ZIPCODE>Continue Task after error checked
6. Goto>Action Number 23 IF %err = 1
7. Variable Split>Name '%HTTPD'>Splitter 'chill='>Delete Base
8. Variable Split>Name '%HTTPD2'>Spliter '"'>Delete Base
9. Perform Task>Name '12HourTime'>Priority '%priority+1'
10. Variable Set>Name '%UPDATED' to 'Updated %12HRTIME'
11. Variable Section>Name '%HTTPD215' From 1 Length 5>Store Result In '%DAY'
12. Variable Section>Name '%HTTPD217' From 1 Length 5>Store Result In '%DARK'
13. Variable Split>Name '%DARK'>Splitter ':'>Delete Base
14. Variable Add>Name '%DARK'>Value 12
15. Variable Join>Name '%DARK'>Joiner '.'>Delete Parts
16. Variable Split>Name '%DAY'>Splitter ':'>Delete Base
17. Variable Join>Name '%DAY'>Joiner '.'>Delete Parts
18. Variable Set>Name '%SUN' to 'Sunrise: %HTTPD215' IF %TIME < %DAY (OR) %TIME > %DARK (OR) %TIME = %DARK
19. Variable Set>Name '%SUN' to 'Sunset: %HTTPD217' IF %TIME = %DAY (OR) %TIME > %DAY (AND+) %TIME < %DARK
20. Variable Set>Name '%WEATHER' to '%HTTPD21@HTTPD23@HTTPD25@%SUN@%UPDATED@HTTPD219@H TTPD223@HTTPD237@HTTPD239@HTTPD241@HTTPD249@HTTPD2 51@HTTPD253@HTTPD261@HTTPD263@HTTPD265@HTTPD273@HT TPD275@HTTPD277@HTTPD285@HTTPD287@HTTPD289@HTTPD22 1@HTTPD243@HTTPD255@HTTPD267@HTTPD279@HTTPD291
21. Array Clear>Name '%HTTPD2'
22. Send Intent>Action 'com.orbonis.gear.tasker.MESSAGE_GEAR'>Extra 'PHONE_WEATHER:%WEATHER'
23. Mobile Data>Set Off IF %TEST eq none

TASK "12HourTime" (Converts the default Tasker time into something a little more readable since nobody uses military time...I was in the military and I don't even use it lol. Also tacks on the current date)
1. Variable Split>Name '%TIME'>Splitter '.'
2. Variable Set>Name '%TIME2' to 'PM'>Append Checked>IF %TIME1 > 11
3. Variable Set>Name '%TIME2' to 'AM'>Append Checked>IF %TIME1 < 12
4. Variable Section>Name '%TIME1' From 2 Length 1>IF %TIME1 < 10
5. Variable Subtract>Name '%TIME1' Value 12>IF %TIME1 >12
6. Variable Set>Name '%12HRTIME' to '%DATE, %TIME1:%TIME2'

SCENE "Get ZIP:378x364" (Prompt for Zip Code...if you want to bring up this prompt at any time just create a new task that calls for it and link that task to a zooper module shortcut or homescreen tasker shortcut)
Element Add>Text>Geometry (77,9)(226x99)>Text 'Zipcode'>Text Size 16
Element Add>Text Edit>MAIN TAB:Geometry (77,132)(226x99), Text Size 18>BACKGROUND TAB: Border Width 5>TEXT CHANGED TAB: 1. Variable Set>Name '%ZIPCODE' to '%new_val'
Element Add>Button>MAIN TAB:Geometry (101,256)(176x107), Label 'SET', Label Size '16'>TAP TAB: 1. Destroy Scene 'Get ZIP', 2. Flash Text 'Zipcode set to: %new_val'


On the GEAR
Include this as part of your Intent Recieved Profile Task (whatever you have called it). I'm assuming you already have a profile set up for receive intent (aka "Battery Example")
TASK 'Whatever'(Mine is 'Phone Updates')
1. IF %phone_weather SET
2. Variable Set>Name '%P_WEATHER' to '%phone_weather'
3. Perform Task>Name 'Weather Update'
4. END IF

TASK 'Weather Update'
1: Variable Split>Name '%P_WEATHER'>Splitter '@'>Delete Base
2: Zooper Widget Pro Variable [ Configuration:realfeal = %P_WEATHER1
3: Zooper Widget Pro Variable [ Configuration:winddir = %P_WEATHER2
4: Zooper Widget Pro Variable [ Configuration:windspeed = %P_WEATHER3
5: Zooper Widget Pro Variable [ Configuration:sun = %P_WEATHER4
6: Zooper Widget Pro Variable [ Configuration:updated = %P_WEATHER5
7: Zooper Widget Pro Variable [ Configuration:ccondition = %P_WEATHER6
8: Zooper Widget Pro Variable [ Configuration:ctemp = %P_WEATHER7
9: Zooper Widget Pro Variable [ Configuration:cdaylow = %P_WEATHER8
10: Zooper Widget Pro Variable [ Configuration:cdayhigh = %P_WEATHER9
11: Zooper Widget Pro Variable [ Configuration:cdcondition = %P_WEATHER10
12: Zooper Widget Pro Variable [ Configuration:tomlow = %P_WEATHER11
13: Zooper Widget Pro Variable [ Configuration:tomhigh = %P_WEATHER12
14: Zooper Widget Pro Variable [ Configuration:tomcondition = %P_WEATHER13
15: Zooper Widget Pro Variable [ Configuration:twodlow = %P_WEATHER14
16: Zooper Widget Pro Variable [ Configuration:twodhigh = %P_WEATHER15
17: Zooper Widget Pro Variable [ Configuration:twodcond = %P_WEATHER16
18: Zooper Widget Pro Variable [ Configuration:threedlow = %P_WEATHER17
19: Zooper Widget Pro Variable [ Configuration:threedhigh = %P_WEATHER18
20: Zooper Widget Pro Variable [ Configuration:threedcond = %P_WEATHER19
21: Zooper Widget Pro Variable [ Configuration:fourdlow = %P_WEATHER20
22: Zooper Widget Pro Variable [ Configuration:fourdhigh = %P_WEATHER21
23: Zooper Widget Pro Variable [ Configuration:fourdcond = %P_WEATHER22
24: Zooper Widget Pro Variable [ Configuration:ctoday = %P_WEATHER23
25: Zooper Widget Pro Variable [ Configuration:today = %P_WEATHER24
26: Zooper Widget Pro Variable [ Configuration:tomorrow = %P_WEATHER25
27: Zooper Widget Pro Variable [ Configuration:twoday = %P_WEATHER26
28: Zooper Widget Pro Variable [ Configuration:threeday = %P_WEATHER27
29: Zooper Widget Pro Variable [ Configuration:fourday = %P_WEATHER28

These values should be pretty easy to decipher. Actions 25 through 29 are the yahoo weather codes. In order to get them to match up with zooper widget I had to make a new Bitmap Icon Set which I've attatched to this post. You can unzip it and replace the Icons in the folder with your own if you wish. Also change the name of them in the config file, then zip the folder and config file back together and place it in the ZooperWidget/IconSets folder on the SD Card. When setting up your zooper widget you add a new module>select Bitmap Icon Set>change the Iconset to 'ZW Tasker Weather Icons', and change the Iconset Mode to either: Current Weather, Today's Weather, Tomorrow's Weather, 2 Days Weather, 3 Days Weather, or 4 Days Weather. I've already edited the default config file to select the correct Icon based on the Yahoo weather codes from Tasker Zooper Configs 24 through 29 so all the hard work is done for you I suggest setting the Module On Tap for the 'Current Weather' Icon to a Popup Widgets shortcut (you need the app for that on your gear), and in the Popup Widget setup link that to another zooper widget showing the 5 day forecast like you see in my example pics attatched to the post. I had trouble getting popup widgets to work at first on the gear...you have to select in the options to use the Legacy widget picker or it won't work. I'll leave setting up the zooper widget layout up to you...but I'll give a few more tips on how mine is set up:

For the 5 Day forecast...
#DE# = TODAY
#W1DE# = TOMORROW
#W2DE# = 2 Days from Now
#W3DE# = 3 Days from Now
#W4DE# = 4 Days from Now

Converting the 360 degree wind directions to NorthEatSouthWest:
$#Twinddir#>0&&#Twinddir#<22,5?N$$#Twinddir#>22,5& &#Twinddir#<67,5?NE$$#Twinddir#>67,5&&#Twinddir#<1 12,5?E$$#Twinddir#>112,5&&#Twinddir#<157,5?SW$$#Tw inddir#>157,5&&#Twinddir#<202,5?S$$#Twinddir#>202, 5&&#Twinddir#<247,5?SW$$#Twinddir#>247,5&&#Twinddi r#<292,5?W$$#Twinddir#>292,5&&#Twinddir#<337,5?NW$ $#Twinddir#>337,5&&#Twinddir#<360?N$

Turning the Current Temperature BLUE if it's below 33 degrees (add to advanced parameters):
[c]$#Tctemp# <= 33 ? #728cd4$
$#Tctemp# >= 34 && #Tctemp# < 80 ? #ffffff$ $#Tctemp# >= 80 ? #ff0000$[/c]

One more thing i should add...if you want to update the weather from your gear you can. There is the obvious way of going into Tasgear and selecting the 'Get Weather' Task on your phone. Or
like on my setup I have a Module on Tap shortcut for the Updated Time (#Tupdated#) linked to a tasker task:
TASK 'Wupdate' (on the gear)
1. Vibrate Pattern>0,100
2. Variable Set>Name %GETW to 1
3. Send Intent>Action 'com.orbonis.gear.tasker.consumer.MESSAGE_HOST>Ext ra 'GEAR_GETW:%GETW'

On the PHONE: (include as part of your intent received profile if you already have one for the Gear Battery on your phone)
1. Perform Task 'Get Weather' IF %gear_getw SET

So that's it...this was my first real tasker project. I just starting learning this stuff about a month ago and the battery examples in this thread were my inspiration...so this takes it even further to show what's possible. As you can see from the pics attatched I'm almost finished with an SMS replacement setup to send and receive text messages with full popup previews (not the lame cutoff messages you get with the default). It even includes a counter to show current unread texts and everything. I'll post the example for that later after it's finished.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2015-03-01-00-23-35.png
Views:	12
Size:	79.1 KB
ID:	3190336   Click image for larger version

Name:	Screenshot_2015-03-01-13-30-32.png
Views:	10
Size:	55.0 KB
ID:	3190337  
Attached Files
File Type: zip ZW Tasker Icons(simple).zip - [Click for QR Code] (106.5 KB, 0 views)
Last edited by edwardsc005; Today at 10:51 AM.
The Following User Says Thank You to edwardsc005 For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes