Init variable location

Post your questions and help other users.

Moderator: Martin

Post Reply
jarlerb
Posts: 10
Joined: 19 Jun 2013 17:48

Init variable location

Post by jarlerb » 20 Jun 2013 22:56

In some of my flows I use Init variable location using GPS.
If I am indoor and can't get a GPS fix, the flow will exit. This action is within a loop and I would like the flow to continue. Is there any way to check for GPS signal before the action Init variable location? Eg. True - - > continue, False - - > try network instead. (there is a reason why I prefer GPS)

pat2net
Posts: 85
Joined: 01 May 2013 09:18

Re: Init variable location

Post by pat2net » 20 Jun 2013 23:08

If you use the exception action like in my exemple maybe it will work.

http://automagic4android.com/flow.php?i ... ba5f4e4d68

jarlerb
Posts: 10
Joined: 19 Jun 2013 17:48

Re: Init variable location

Post by jarlerb » 21 Jun 2013 12:22

It did. Thank you wery much. You opened a door for me :-)
Do someone know how to use the variables location_bearing, _altitude,_speed? I can't work with them as I can with location and I have problems finding info about the topic

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Init variable location

Post by Martin » 23 Jun 2013 08:45

Hi,

You can use the location-variables in a condition Expression or an action Script.

For example:
-trigger Periodic Location Update: every 10s (GPS)
-condition Expression: location_speed>20 (speed is in m/s)
-->true: action Notification on Screen: over 72km/h
-->false: action Notification on Screen: under 72km/h

Note that the variables are only available when using GPS and only when using trigger Periodic Location Update (the variables will be also available in action Init Variable Location starting with the next release).

Regards,
Martin

jarlerb
Posts: 10
Joined: 19 Jun 2013 17:48

Re: Init variable location

Post by jarlerb » 23 Jun 2013 11:26

Thank you for the info :-)
I'll wait for the update. The periodic update will drain my battery to fast, so I need a condition first (looking for the navigation app and external power) and then the action Init variable location.

Post Reply