Waze Live map how does it work?

Hi, Is there anyone who has the waze live map working? I am curious how this works.
I manage to place the map in an iframe but it is not a live map but just a map, is it possible at all to use live tracking?

Why do you want this? If your answer is “for travel times, duh”, then use the travel time integration.

I would like to have an live map so i can see traffic information around me depending on where i am at that moment. The live map suggests that it is possible but i was looking for examples because i cant find any documentation on how to do this. The link in your post to the travel time intergration is the same as mine, at the bottom of that page you can see a small paragraph about the live map with a link to the Waze API. So in short: I want to know if it is even possible, and if it is possible, how?

1 Like

Yes it’s possible, here are the development docs. You just have to build the URL.

https://developers.google.com/waze/iframe

Parameter Required? Description
desc Optional Set this parameter to any value to display a descriptive text block in the Live Map. Broadcasters use this text to provide up-to-date information for Wazers, with no need for manual updates to their stations’ websites. All text is created by Waze ensuring the content is correct.
lat Required The latitude of the map’s center point.
lon Required The longitude of the map’s center point.
pin Optional Set to 1 to place a pin to the center of the map. For example: <iframe src="https://embed.waze.com/iframe? zoom=12&lat=45.6906304&lon=-120.810983& **pin=1** " width="300" height="400"></iframe>
zoom Required The level of magnification of the map when it is opened. The minimum value is 3 (least magnification). The maximum value is 17 (most magnification).

Yes, Thanks @petro I managed to build on a URL in NODE-Red. I pass on the link as state to a custom sensor in Home Assistant and it works

https://embed.waze.com/nl/iframe?zoom={{zoom}}&lat={{data.attributes.latitude}}&lon={{data.attributes.longitude}}&pin=1&desc=1

I now try to put the URL as variable in the Lovelace ui config but cannot find how to do this. something like

        cards:
          - type: iframe
            url: {{states('sensor.location_waze')}}
            aspect_ratio: 75%

You need to get a custom card that support templating. There are 2 in HACS that I know of. I use

You should also consider Card Templater because it works just as I expect templates to work.

maybe you can try the generic camera integration

Sorry, I personally like js better than jinja because it’s more powerful.

Thanks so far, i tried both template plugin cards but i cant get it to work.
I get to see the homepage again in the iframe


custom:config-template-card:

          - type: "custom:config-template-card"
            variables:
              - states['sensor.location_waze'].state
            entities:
              - sensor.location_waze
            card:
              type: iframe
              url: "{{ states.sensor.location_waze }}"

custom:card-templater:

          - type: 'custom:card-templater'
            card:
              type: iframe
              url:
                - entity: sensor.location_waze
                  state_template: >-
                    {{ states.sensor.location_waze }}
            entities:
              - sensor.location_waze
          - type: "custom:config-template-card"
            variables:
              - states['sensor.location_waze'].state
            entities:
              - sensor.location_waze
            card:
              type: iframe
              url: "{{ states.sensor.location_waze }}"

should be

          - type: "custom:config-template-card"
            variables:
              - states['sensor.location_waze'].state
            entities:
              - sensor.location_waze
            card:
              type: iframe
              url: "${ vars[0] }"
1 Like

Thanks so much! @petro It is working now!

Now i have a live waze map with traffic information at my location with lat & lon data from life360. Also added zoom variable depending on GPS speed.

2 Likes

What’s the whole thing look like? Seems interesting!

Have you shared your configs anywhere? Can I do this without Node Red?

I will share my configs and Node-RED export (hopefully this week) as a project and share the link here.

@StefanOJ i think this is also possible without Node-RED but dont know how. may I ask why you do not want to use Node-RED

You can do it without node red. All you need is a person and you can extract the lat and lon into a sensor.template attribute that builds a URL. The gps speed is the tricky part, which is what I was wondering about.

binary_sensor:
- platform: template
  sensors:
    person_xxx_url:
      value_template: "{{ state_attr('person.xxx', 'latitude') and state_attr('person.xxx', 'longitude') }}"
      attribute_templates:
        url: >
          {% set lat = state_attr('person.xxx', 'latitude') %}
          {% set lon = state_attr('person.xxx', 'longitude') %}
          {% set zoom = 3 %}
          https://embed.waze.com/nl/iframe?zoom={{ zoom }}&lat={{ lat }}&lon={{ lon }}&pin=1&desc=1

then in lovelace using iantrich’s card…

          - type: "custom:config-template-card"
            variables:
              - states['binary_sensor.person_xxx_url'].attributes.url
            entities:
              - binary_sensor.person_xxx_url
            card:
              type: iframe
              url: "${ vars[0] }"
2 Likes

Well, the GPS speed doesn’t work much different than the Lat / Longtitude variables. If you are using Life360 or any other app it that gives you your GPS speed you can use it also as variable. I use a kind of IF state switch in node red but this will also be possible without Node-RED. you get the idea



My entire page with information looks like this:

Iframe:

  • Waze live map, that alway showing your position. A nice extra is that you can see traffic information around you

entities:

  • first next work location and start date & time from google calendar

  • Start time (in my case work starttime)

  • How much time is left until the next appointment (work branch / location)

  • Travel time to that location from the waze time travel integration

  • The route to that location also from the waze time travel integration (with a conditional card)

  • When i am at the location from my google calender then it shows the travel time and route to Home, i do this with a conditional card. “state_not: home”

How you get the ‘sensor.location_waze’?

Thats something that @coen17st had in his setup. If you read this post here:

Waze Live map how does it work?

You can use any device_tracker or person.

:ok_hand: :pray: