Page 1 of 1

Google Latitude Integration

PostPosted: Thu Jul 26, 2012 3:20 pm
by panghy
I am new to Indigo (new as in still on the trial license new :) ) but I just submitted my first plugin that integrates with Google Latitude, creating variables representing the distance (in kms), latitude and longitude of each user (you can define as many users as you want). You can find it on http://www.perceptiveautomation.com/filelib/index.php filed under Application Integration.

It requires registering and creating a unique URL on https://latitudebridge.appspot.com which allows you to have a single curl-able URL to fetch the current best location of a user (the app supports iPhone, Blackberry and Android at least, see http://www.google.com/mobile/latitude/).

Now, I can finally have it send me an email when the garage door is open while I am away. It also turns off unnecessary lights when I am away for an extended period of time. Technically, you can activate your vacation schedule when you are gone too. :)

P.S. The script has been updated to add some try .. end try blocks to prevent connectivity issues from killing the repeat loop. That should be up in a bit (pending the admins to update the page).

Re: Google Latitude Integration

PostPosted: Thu Jul 26, 2012 4:54 pm
by jay (support)
The new script is now available in the File Library.

Just to clarify - this isn't a plugin, it's an AppleScript (and I'll move this entire thread over to the User Contributions forum in a bit). Not a big deal, just want to set the right expectations.

Re: Google Latitude Integration

PostPosted: Wed Aug 15, 2012 12:55 pm
by MrJeffreyGee
Thanks for posting this. I've been looking for something like this for a while. I setup several geofences and it works well with them for arriving and leaving the fenced area.

When the applescript is running it works great, but it stops sometimes (I think) and nothing happens for a while. Not sure, if it stopped, failed updating, or is still going and didn't detect a change.

How often does this repeat loop run for? Is there a way to tell if this applescript is running or not? I see that there's a way to make repeat every xx seconds in the script... Is there a way to turn off the repeating in the script? If I can turn off the repeating in the script then I can schedule it to run every xx seconds within Indigo and that'll make it more predictable; as well as, know whether it's running or not.

Thanks again for this. I love it!

Re: Google Latitude Integration

PostPosted: Wed Aug 15, 2012 1:20 pm
by panghy
The script runs continuously (it has been on my machine for a couple of weeks already). are you sure you are running the latest version? it should update every 2 minutes.

If you see an error in the logs though, please post it here.

Re: Google Latitude Integration

PostPosted: Wed Aug 15, 2012 7:18 pm
by MrJeffreyGee
panghy wrote:
The script runs continuously (it has been on my machine for a couple of weeks already). are you sure you are running the latest version? it should update every 2 minutes.

If you see an error in the logs though, please post it here.



Not sure what version it is. I'm using the version posted at this link. http://www.perceptiveautomation.com/filelib/index.php

What version is that? Which log will the errors show up in (Indigo's Event Log, or some other log)?

Re: Google Latitude Integration

PostPosted: Wed Aug 15, 2012 7:30 pm
by panghy
That should be v1.1.

Errors would show up in red in the event log if there are failures. Another way is to run the app in AppleScript editor (open it up and hit play) and then see if it dies with an error after a while.

Re: Google Latitude Integration

PostPosted: Wed Aug 15, 2012 7:55 pm
by MrJeffreyGee
panghy wrote:
That should be v1.1.

Errors would show up in red in the event log if there are failures. Another way is to run the app in AppleScript editor (open it up and hit play) and then see if it dies with an error after a while.


Haven't seen any errors yet in Indigo's Event Log, but that's a huge log and I don't monitor it constantly. I've been starting it in Indigo by create an item in Action Groups. It doesn't auto-start when rebooting the Mac, so I'm thinking about adding it as a trigger for whenever Indigo starts up.

Re: Google Latitude Integration

PostPosted: Thu Aug 16, 2012 1:20 am
by panghy
You do need to add a trigger to start the script on Indigo start-up for sure.