Google Maps card won't display mobile users' locations
See original GitHub issueI know there’s a breaking change in 2022.9 for latitude and longitude. However, I didn’t see a respective solution for how to display mobile user locations in the Google Maps card like I had with all previous versions of Home Assistant mobile. I have temporarily reverted back Home Assistant mobile on all our phones to 2022.8 until I know how to display users’ locations in the Google Maps card again.
Could someone please assist me to fix the still image URL below to use respective longitude/latitude of each user? I currently have the still image URL in configuration.yaml; as, I don’t see a place to enter the URL in the Google Maps lovelace card.
Thank you so much for your help!
- platform: generic
name: 'Google Maps'
still_image_url: https://maps.googleapis.com/maps/api/staticmap?size=800x800&maptype=hybrid&markers=color:red|label:A|{{ states.sensor.sm_g781v_2_geocoded_location.attributes.latitude }},{{ states.sensor.sm_g781v_2_geocoded_location.attributes.longitude }}&markers=color:purple|label:A|{{ states.sensor.sm_g781v_geocoded_location.attributes.latitude }},{{ states.sensor.sm_g781v_geocoded_location.attributes.longitude }}&markers=color:yellow|label:M|{{ states.device_tracker.kftrwi.attributes.latitude }},{{ states.device_tracker.kftrwi.attributes.longitude }}&markers=color:blue|label:M|{{ states.sensor.sm_n960u_geocoded_location.attributes.latitude }},{{ states.sensor.sm_n960u_geocoded_location.attributes.longitude }}&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
limit_refetch_to_url_change: true
Home Assistant Android version: 2022.9
Android version: Android 12
Phone model: Samsung Note
Home Assistant version: 2022.9.4
Last working Home Assistant release (if known): 2022.8
Description of problem: Google Maps card no longer displays location of Home Assistant mobile users
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
Screenshot of problem:
Additional information:
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Dan your previous comments gave me the clue to resolving this issue! Thank you!!!
You were right, for whatever reason, the spaces in the URL will cause an error in Google’s API. I tried again your suggestion to render the URL without spaces in Developer Tools > Templates and then visit that URL in the browser… it worked in the browser! That’s when I suspected the issue would go away if I just remove the spaces from the URL in the configuration.yaml file.
I really appreciate your help. You’re a life-saver!
what happens if you render the URL in Developer Tools > Templates and then visit that URL in teh browser? does it work? Sorry thats about as far as I can take it. Hopefully someone helps out.