[RELEASE] OwnTracks Presence

It's actually really easy, Load up the Google Maps iFrame driver and create a device with said driver.
Create a rule in RM to update the Google Maps lat and lon whenever a change in the OwnTracks lat (or lon) is detected. Here's my rule, you do need to create a local variable to get the second value into the Google driver. I trigger on a change from the OT driver, update the Google lat with the new value, then I move the lon value into a variable then into the Google driver (it can't go direct). Then I run the updateFrame() function, which is a custom function in the Google driver which re-centers the map on the new location. 'Location Mark' is the Google device in this rule.

Then obviously plop the Google device onto a dashboard. Now, the Google map has a lot of extra crap on it that covers up parts of the maps (links, Logo, etc). You can't 'remove' those items but I found that if you play with the CSS you can hack it a bit to keep them out of view. My tile is modified like below and the only thing visible is the map. Basically what you do is make the map huge but center the tile on your location, this pushes all the crap outside the tile viewing window. You have to play with the margin settings for your particular install because it is dependent on your tile size.

#tile-30 .tile-contents{
padding: 0;
overflow: hidden;
height: 300%;
width: 300%;
margin-top: -75%;
margin-right: -50%;
margin-bottom: -50%;
margin-left: -100%;
}

2 Likes