Waze Live map how does it work?

          - 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:

I tried following your example, but cannot get the card visible…
Here it is my code:

      - type: custom:config-template-card
        card:
          type: iframe
          aspect_ratio: 100%
          url: "${ vars[0] }"
          style: |
            ha-card {
            font-size: 14px;
            font-family: 'Georgia';
            font-weight: normal;
            border: solid 2px var(--primary-color);
            }     
        entities:
          - entity: binary_sensor.person_fha_url
            name: Fha
          - entity: binary_sensor.person_maurizio_url
            name: Maurizio
        variables:
          - states['binary_sensor.person_fha_url'].attribute.url
          - states['binary_sensor.person_maurizio_url'].attribute.url

The binary sensors are created and the attributes show the correct position in the map.
Why cannot see the card?

Thanks petro, I got it working.
Just a note, it should be states[‘binary_sensor.person_xxx_url’].attributes.url instead of attribute.
I appreciate the help!

Change .attribute. to .attributes.

1 Like

Thanks for that, i’ll update the post

I did the change, but still no iframe showed…
Maybe something wrong in my side about variables?
Do i need to add something in configuration to have the variables?

Post your binary sensors

Here they are @petro :

- platform: template
  sensors:
    person_fha_url:
      value_template: "{{ state_attr('person.fha', 'latitude') and state_attr('person.fha', 'longitude') }}"
      attribute_templates:
        url: >
          {% set lat = state_attr('person.fha', 'latitude') %}
          {% set lon = state_attr('person.fha', 'longitude') %}
          {% set zoom = 3 %}
          https://embed.waze.com/it/iframe?zoom={{ zoom }}&lat={{ lat }}&lon={{ lon }}&pin=1&desc=1" width="600" height="450"
    person_maurizio_url:
      value_template: "{{ state_attr('person.maurizio', 'latitude') and state_attr('person.maurizio', 'longitude') }}"
      attribute_templates:
        url: >
          {% set lat = state_attr('person.maurizio', 'latitude') %}
          {% set lon = state_attr('person.maurizio', 'longitude') %}
          {% set zoom = 3 %}
          https://embed.waze.com/it/iframe?zoom={{ zoom }}&lat={{ lat }}&lon={{ lon }}&pin=1&desc=1" width="600" height="450"

your problem is all that crap at the end of each URL

That’s not part of the URL in the table above. That’s part of the html. Don’t have that in your binary_sensors.

Hi all!

I have an issue with displaying Waze in Iframe in Google Chrome. There is just an empty space, though Waze is displayed in Iframe in Microsoft Edge. I’ve tried cleaning cache and reset settings in Google Chrome, but it didn’t help.

Could anyone suggest me a solution? Thanks!

No way… i put off those entries from the binary sensors, but still getting no card…
EDIT: I discovered if i put this line into the model editor:

value_template: "{{ state_attr('person.fha', 'latitude') and state_attr('person.fha', 'longitude') }}"

I get this:

Why only the longitude attribute is rendered?
That’s why i get no card in the frontend?
How to fix?