So I wanted to see if I could intigrate Google Maps as a replacement for the built in Maps feature.
I was looking for something a little more robust than the built in map, and while the static map cards are cool, they dont offer any of the features the Full Maps api does.
Yes, I do need an API key for this, but I figure 20k requests per day on the free setup is more than enough.
This is basically a simple .html file sitting in the www folder.
Im using the iframe function and pointing to https://mydomain.com/local/gmaps.html.
So he is the rub. I need to be able to pull the information from device tracking for the locations into this HTML, which Im pretty sure is not possible with this method, as the variables below dont actually get anything from HA.
{{ states.device_tracker.myphone.attributes.longitude }}
{{ states.device_tracker.myphone.attributes.latitude }}
Any ideas on getting this to work, or maybe another method to look at?
Here is the simple html file.
<!DOCTYPE html>
<html>
<head>
<title>HTML Iframes</title>
</head>
<body> {
margin: 0;
}
<iframe src="//www.google.com/maps/embed/v1/place?q={{ states.device_tracker.billphone_bill_phone.attributes.latitude }}%2C{{ states.device_tracker.billphone_bill_phone.attributes.longitude }}
&zoom=13
&attribution_source=Google+Maps+Embed+API
&attribution_web_url=https://developers.google.com/maps/documentation/embed/
&key=MYAPIKEY" allowfullscreen style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
</iframe>
</body>
</html>