Custom Component: here_travel_time

Hi @eifinger. What do you think about the geocoder api?

I can think of retrieving an address of an event within the iCal component as an attribute, transforming the attribute to an entity_id (sensor.nextEventLocation) and providing the address information (street, number, City) to here_travel_time.

I could also extend the routing functionality of the base herepy lib so it can handle addresses. It would call the geocoder api internally.

That would be a wonderful feature for a great component.

Hi,
I always have this error:

Invalid config for [sensor.here_travel_time]: [app_id] is an invalid option for [sensor.here_travel_time]. Check: sensor.here_travel_time->app_id.
I tried both with and without quotes.

Thx!

app_id is not supported anymore
Check the latest documentation for information on api_key: https://www.home-assistant.io/integrations/here_travel_time/

Thank you for the quickness.
Iā€™ll try immediately.

I know it is a year since this was commented on butā€¦

I like this integration and still use it. Is there any chance of adding the option of using a person as the origin_entity_id?

I would change to use Waze but it seems like I need to add a separate instance for every one of the four routes I need to use.

Like this?

  - platform: here_travel_time
    api_key: !secret here_api_key
    name: Travel to Home
    origin_entity_id: person.david
    destination_entity_id : zone.home

Yes that is my actual config since foreverā€¦

2 Likes

Yes, exactly like that :wink:

Thanks, Iā€™ll check what I did wrong because mine didnā€™t work.

Make sure the person entity has a GPS location?

Not even that complicated but Iā€™m choosing to remain silent so as not to incriminate myself in the act of pure stupidity.

But thanks for making me look again and look closerā€¦
:blush:

2 Likes

most important sensor in my setup!

  - platform: here_travel_time
    entity_namespace: here
    api_key: !secret rest_here_api_key
    name: Lovebirds
    origin_entity_id: device_tracker.life360_me
    destination_entity_id: device_tracker.life360_she
    route_mode: fastest
    traffic_mode: true
1 Like

aware this is an old post, so please forgive me for revivingā€¦

trying to setup the current Here travel time integration with dynamic origin and destination, using sensors with lat/long based on an input select for origin and destination, like:

#    origin_entity_id: sensor.origin
#    destination_entity_id: sensor.destination
    origin_latitude: sensor.origin_lat_here
    origin_longitude: sensor.origin_long_here
    destination_latitude: sensor.destination_lat_here
    destination_longitude: sensor.destination_long_here

as you can see the top 2 are commented, they are template sensors returning lat/long in a single state, but that didnā€™t work, so I tried the verbose method. Doesnā€™t work either.

Cant this integration accept sensors like that? I had my hopes up because of HERE Travel Time - Home Assistant explicitly mentions sensor to be a valid input?

please have a look? thanks!

edit/update

yes it can! Ive made a mistake before where the lat/long were both in the state. Ive remade those sensors to have attributes for both, and that makes it happen. Way faster than the Waze travel time at that, and it includes great route information :wink:

1 Like

If the state of the template sensor was in the form of ā€œlat,lonā€(separated by a comma) it should have worked too :thinking:

yeah thats what I would have thought. I had this first:

      - unique_id: destination
        name: Destination
        state: >
          {% set select = states('input_select.destination') %}
          etc etc etc
          {% set lat = state_attr(result,'latitude') %}
          {% set lon = state_attr(result,'longitude') %}
          {{lat}}, {{lon}}

which didnt work, and now use:

      - unique_id: here_destination
        name: Here destination
        state: >
          {% set destination = states('input_select.destination') %}
          {{destination}}
        attributes:
          latitude: >
            {% set select = states('input_select.destination') %}
            etc etc
            {% set lat = state_attr(result,'latitude') %}
            {{lat}}
          longitude: >
            {% set select = states('input_select.destination') %}
            etc etc
            {% set lon = state_attr(result,'longitude') %}
            {{lon}}

which works perfectly

Since Waze is throwing issues, ive completely replaced that with the Here integration. Its showing even better itineraries .

We can use the Waze -card to display that :wink:

Thanks, I will add a testcase for the first example and try to get to the bottom of it.

1 Like

Is there a way to specify the route selection?

I take the highway to work everyday and want to be able get the travel time for only this route, in order to know if there is an incident and not to take it. Unfortunately this is not the shortest route according to here, so specifying the shortest route gives me a different route.

If not, Iā€™m sure I can work around it, everything works great.

Is it possible to dynamically update the scan_interval using a template of some sort? Maybe something like:

       state: >-
          {%- if is_state("sensor.time", "06:30:00")  -%}
            60
          {%- elif is_state("sensor.time", "07:30:00")  -%}
            600
          {%- else -%}
            300
          {%- endif %}

Basically, if its between 06:30 and 07:30, update every minute, otherwise, update every 10 minutes.

Hi @MelvinBungles. This is currently not possible but will be possible once I upgrade the integration to use the new v8 API. I have a few PRs open to get there, so maybe in Jan-Feb next year.

1 Like

Hi @snel6424 this is currently not possible.
You can set the update interval to a really high number and create an automation that will update on demand as described here: Google Maps Travel Time - Home Assistant