We have moved at community.getvera.com

Author Topic: IPhoneLocator and Google Map  (Read 1001 times)

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
IPhoneLocator and Google Map
« on: September 18, 2018, 04:21:12 pm »
In June 2018 google changed the billing model for their map and distancematrix API service. depending on your region you may have been impacted at different times. you will see that if you get persistent google quota exceeded messages or a grey background map display with a "for development only" message.

IPhoneLocator v2.48 (soon published on app store) introduces a new variable GoogleMapKey which must be initialized with your own google map api key value that you can get from the google map page https://cloud.google.com/maps-platform/.  This key is needed to allow the API calls to DistanceMatrix and Geocode API as part of each "refresh" loop call and to display the map in the settings tab.

Depending on your usage patterns and number of iCloud devices you may have more or less consumptions of the google api and this could have a cost if the total exceed 200$ ( the first 200$ are not charged by google )

so Please before using this, read the Google map key section in the document http://code.mios.com/svn/mios_iphone-detector/trunk/iPhoneLocator/Another%20UI7%20Install%20doc.pdf or https://github.com/amg0/IPhoneLocator to understand and estimate the cost consequences and have an example of an average use ( mine )

please be mindful about these informations and eventually set a maximum quota in google cloud console if you have doubts as IPhoneLocator cannot be hold responsable for unforeseen costs.
« Last Edit: September 20, 2018, 05:17:05 pm by amg0 »

Offline jimmyhtz

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +2/-2
Re: IPhoneLocator and Google Map
« Reply #1 on: October 19, 2018, 05:09:13 pm »
Hi Amg0
Thank you for your hard work keeping up with all the changes with Apple/Google.

I updated to v2.48, and went to Google to get my API key.
I can't find where to put it in your App.

My wife has an iPhone on a separate account.   Do I need to set up a separate API for her?

Also, what Polling settings do you recommend that will give your app maximum efficiency without getting charged?

Jim

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: IPhoneLocator and Google Map
« Reply #2 on: October 19, 2018, 08:35:33 pm »
Hi Amg0
Thank you for your hard work keeping up with all the changes with Apple/Google.

I updated to v2.48, and went to Google to get my API key.
I can't find where to put it in your App.

My wife has an iPhone on a separate account.   Do I need to set up a separate API for her?

Also, what Polling settings do you recommend that will give your app maximum efficiency without getting charged?

Jim

Variable GoogleMapKey in device iPhonelocator.
I have 3 instanc3s on three different iCloud accounts, I use the same apikey and seems below the max free tier every month, but I mute the devices during the night and unmute them when the entry door of the house is opened.

Offline deboy69

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: IPhoneLocator and Google Map
« Reply #3 on: November 28, 2018, 10:27:32 am »
day one of this setup.

what would you recommend the quota cap be so google doesnt charge me when i reach the $200. Dont think i will based on what im seeing in the last few minutes of it being set up.

Do you recommend any "Application Restrictions" though google? Its asking me to secure it more

Thanks

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: IPhoneLocator and Google Map
« Reply #4 on: November 28, 2018, 05:05:14 pm »
day one of this setup.

what would you recommend the quota cap be so google doesnt charge me when i reach the $200. Dont think i will based on what im seeing in the last few minutes of it being set up.

Do you recommend any "Application Restrictions" though google? Its asking me to secure it more

Thanks

aside managing budget and alerts in the google cloud console, I am not aware of other means to control it
I recommend you keep an eye and have a MUTE strategy during the night for instance
https://console.cloud.google.com/billing

Offline deboy69

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: IPhoneLocator and Google Map
« Reply #5 on: November 28, 2018, 06:37:25 pm »
thanks
« Last Edit: November 28, 2018, 10:07:17 pm by deboy69 »

Offline twiseva

  • Sr. Newbie
  • *
  • Posts: 26
  • Karma: +0/-0
Re: IPhoneLocator and Google Map
« Reply #6 on: December 17, 2018, 08:03:15 pm »
Hi, so thanks for getting this working again. Just signed up for the google APIs and it seems to work ok. Some basic things I learnt in setting this up:

1. The APIs the iphone locator uses SEEM to be Geocoding API and MAPS Java Script API. I think the last is for the built in map in the settings.
2. I set up a specific Vera Project in the Google setup -- so I can restrict it as much as possible. The API key is in this project.
3. For restrictions I enabled ONLY the above APIs. Note that it kept failing until I enabled the Geocoding API (disabled by default).
4. I also restricted the number of calls in EACH enabled API -- Click on the API to get details and then the Quota tab. Set the values as needed (they are initially unlimited).

Now to my question:

I am trying to restrict on IP access to the key -- so its ONLY my Vera that can use this. Anyone know WHAT this IP might be? I am behind a NAT'd Verizon router so I am ASSUMING its the Verizon router IP but am not 100% sure. Anyone know? I'll play some more and return here if I figure it out.

Offline agoodman82

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +1/-3
Re: IPhoneLocator and Google Map
« Reply #7 on: January 06, 2019, 12:54:58 pm »
I just set this up with an API key, entered it in the correct variable area and am getting "Google returned an error code" message in my iPhone device when I try to refresh the location. Any ideas??

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: IPhoneLocator and Google Map
« Reply #8 on: January 06, 2019, 01:19:01 pm »
I just set this up with an API key, entered it in the correct variable area and am getting "Google returned an error code" message in my iPhone device when I try to refresh the location. Any ideas??

have you enabled debug mode and checked the log ? if not that is probably the next step. it could be related to quota management if you did a lot of request or reload recently

Offline agoodman82

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +1/-3
Re: IPhoneLocator and Google Map
« Reply #9 on: January 06, 2019, 02:33:06 pm »
@amg0

I turned on debug mode, but being I've never used it, where do I go to check the logs? I just signed up for the API key so I don't think a request overload is the issue. When I look on the map in the iPhone device it does show the location of my iPhone but I'm still getting the error.

I've been having issues throughout the day with commands failing for my iPhone device and my wife's where I'm trying to mute/unmute and getting "command failed" errors, so I'm not sure if all this is related somehow.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: IPhoneLocator and Google Map
« Reply #10 on: January 06, 2019, 03:10:29 pm »
@amg0

I turned on debug mode, but being I've never used it, where do I go to check the logs? I just signed up for the API key so I don't think a request overload is the issue. When I look on the map in the iPhone device it does show the location of my iPhone but I'm still getting the error.

I've been having issues throughout the day with commands failing for my iPhone device and my wife's where I'm trying to mute/unmute and getting "command failed" errors, so I'm not sure if all this is related somehow.

it could be related if your vera has stability issues... log would tell.
how to get the logs is said in the FAQ post : http://forum.micasaverde.com/index.php/topic,18822.0.html