Lovelace: Travel Time Card

And yes you just confirmed I am a beginner. I didn’t do it through HACS. I thought you could just add the resource and add the card subsequently. Thank you for your quick response

Just a question: so for every third party card, i have to install it through HACS? Will this add the necessary resource automatically then?

You don’t have to use HACS but it is much easier to do so.

The necessary files will be copied, yes

I’ve not used the UI to add the resources but I guess try it and see if it works.

Don’t forget to try and do the reload and refreshes once its installed

1 Like

Hi, it works great!!
would there be a way to be able to choose the means of transport, such as car, bicycle, or pedestrian??2021-05-14 15-38-44
I had started something but it didn’t give me the distance, and I couldn’t extract the given for anything other than the car … :face_with_raised_eyebrow: :expressionless:

Hi to all, please, someone may direct me.
I have 4 waze sensors already configured. They are working with the regular entities card showing the time distance. At any case, the sensors work well, they have the distance and route included as I can see them in the “developer tools”.
The problem is that I include the four of them in a custom:travel-time-card as explained in this thread, but it only shows the header “Travel Times” with the column names, but no data. No error advice.
Does anybody know what can happen?
Thanks in advance.

post your code and maybe we can help

Hello,
I have the following error:

DevTools failed to load source map: Could not load content for https://url/hacsfiles/travel-time-card/travel-time-card.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Any idea? I can’t find anything on the web.
Thanks.
Florent

type: custom:travel-time-card
entities:
  - entity: sensor.work1
  - entity: sensor.work2
  - entity: sensor.home1
  - entity: sensor.home2

I am sorry, I was misremembering what I used. this is in my config https://github.com/royto/waze-card

and it looks quite the same

  - type: entities
    title: Dynamic Waze travels
    entities:
      - input_select.waze_origin
      - input_select.waze_destination
      - sensor.origin
      - sensor.destination
      - entity: script.update_waze_dynamic
        action_name: Update
      - type: custom:waze-card
        card_mod:
          style: |
            ha-card {
              box-shadow: none;
              margin: 0px -16px 0px -16px;
            }
        title: Travel time
        entities:
          - entity: sensor.route_planner

is it possible to get the walking time between two entities using some integration?

You can use the Here integration, select ‘pedestrian’

it seems like the Here integration is not working. I get the following error when I try to add it:

image

I am using it fine, did you get the API key ? or could you you not get that far ?

yes, i have an api key. I believe this is a known issue.

Strange, I have had an API key for a long time (old version) so maybe that’s why it still works for me. I’ve just tried adding a new integration and it works fine

Sorry for bumping an old thread, but how do I convert the minutes to HH:MM (hours and minutes?).

I’m aware of template sensors, but not sure how to incorporate the conversation into this card.

type: custom:travel-time-card
entities:
  - sensor.waze_travel_time_2
distance_units: miles

Hey,

is there a possibility to show the “last update” or “last changed” status for the entities?

@Mariusthvdb I know that this is an old link, but if you give me a few hints it would be greatly appreciated.

I would like to know how hthe sensor.origin, sensor.destination and the sensor.route_planner were created.

A sample of each code would really help.

Again thank you for all the help you have given me in the past.

sure, its a bit complex, but works well:

      - unique_id: here_destination
        state: >
          {% set select = states('input_select.destination') %}
          {% if select == 'Thuis'%} {% set destination = 'zone.home' %}
          {% elif select in ['Marijn','P2','P3','P4','P5','P6'] %}
            {% set destination = 'person.' ~ select|lower %}
          {% else %} {% set destination = 'zone.' ~ select|slugify %}
          {% endif %}
          {{destination}}
        picture: >
          {% set select = states('input_select.destination') %}
          {% if select in ['Marijn','P2','P3','P4','P5','P6'] %}
            {% set destination = 'person.' ~ select|lower %}
            {{state_attr(destination,'entity_picture')}}
          {% else %} /local/travel/destination.png
          {% endif %}
        attributes:
          latitude: >
            {% set select = states('input_select.destination') %}
            {% if select == 'Thuis'%} {% set result = 'zone.home' %}
            {% elif select in ['Marijn','P2','P3','P4','P5','P6'] %}
              {% set person = 'person.' ~ select|lower %}
              {% set result = 'zone.home' if states(person) == 'home' else
                'person.' ~ select|lower %}
            {% else %} {% set result = 'zone.' ~ select|slugify %}
            {% endif %}
            {% set lat = state_attr(result,'latitude') %}
            {{lat}}
          longitude: >
            {% set select = states('input_select.destination') %}
            {% if select == 'Thuis'%} {% set result = 'zone.home' %}
            {% elif select in ['Marijn','P2','P3','P4','P5','P6'] %}
              {% set person = 'person.' ~ select|lower %}
              {% set result = 'zone.home' if states(person) == 'home' else
                'person.' ~ select|lower %}
            {% else %} {% set result = 'zone.' ~ select|slugify %}
            {% endif %}
            {% set lon = state_attr(result,'longitude') %}
            {{lon}}

and the same for

      - unique_id: here_origin
        state: >
          {% set select = states('input_select.origin') %}
          {% if select == 'Thuis'%} {% set origin = 'zone.home' %}
          {% elif select in ['Marijn','P2','P3','P4','P5','P6'] %}
            {% set origin = 'person.' ~ select|lower %}
          {% else %} {% set origin = 'zone.' ~ select|slugify %}
          {% endif %}
          {{origin}}
etcetc

so this relies on having those input_select’s, and person device_trackers with lat/long (which I have also set as possible from/to options in the input_select). Got to realize that person trackers in zone home do Not have a lat/long, so that is a reason I base those off the custom component Composite, which always sets the lat/long correctly, even when in zone home.

the final Here sensors are made by the integration,

and I have a script that updates the entities, so it doesnt have to poll constantly

script:

  update_routeplanner_dynamic:
    sequence:
      service: homeassistant.update_entity
      target:
        entity_id:
          - sensor.here_route_planner_distance
          - sensor.here_route_planner_duration

and I can push the button in the dashboard.

originally, I had the route (itinerary below in the commented section) I the map, but that has been taken from us… and never replaced by anything alike.

crd now is this:

type: entities
title: Routeplanner
card_mod:
  class: class-header-margin
entities:
  - input_select.origin
  - input_select.destination
  - entity: script.update_routeplanner_dynamic
    action_name: Hernieuw

  - type: custom:fold-entity-row
    head:
      type: section
      label: Routebeschrijving
      card_mod: &label
        style: |
          .label {
            margin-left: 0px !important;
          }
    padding: 0
    entities:
      - type: custom:hui-element
        card_type: markdown
        card_mod:
          style: |
            ha-card {
              box-shadow: none;
              margin: 0px -16px;
            }
        content: >
          {% set duur = states('sensor.here_route_planner_duration') %}
          {% set afstand = states('sensor.here_route_planner_distance') %}
          Van: {{states('input_select.origin')}} Naar: {{states('input_select.destination')}}

          Duur: {{duur}} minuten,  Afstand: {{afstand}} km.

  - type: custom:fold-entity-row
    head:
      type: section
      label: op Kaart
      card_mod: *label
    padding: 0
    card_mod:
      style: |
        div#items {
          margin: 16px -16px -16px -16px;
        }
    entities:
      - type: custom:hui-element
        card_type: map
        card_mod:
          style: |
            ha-card {
              box-shadow: none;
            }
        entities:
           - sensor.here_origin
           - sensor.here_destination

  - type: custom:fold-entity-row
    head:
      type: section
      label: Details
      card_mod: *label
    padding: 0
    entities:
      - entity: sensor.here_origin
        name: Van
      - entity: sensor.here_destination
        name: Naar
#       - sensor.here_route_planner_route
      - entity: automation.update_travel_sensors
        secondary_info: last-triggered
        state_color: true
      - entity: automation.update_travel_options
        secondary_info: last-triggered
        state_color: true

 # - type: custom:fold-entity-row
#    head:
#      type: section
#      label: Itinerary
#    padding: 0
#    entities:
#      - type: custom:waze-card
#        card_mod:
#          style: |
#            ha-card {
#              box-shadow: none;
#            }
#        title: ''
#        entities:
#          - entity: sensor.here_route_planner

Thank you for all the information, you went way above what I had suspected.
Also thank you for your generous time in explaining this.

I copied the info to my text editor and will start to piece it together.

1 Like

sure, and feel free to ask, you’re most welcome!