Custom Component: here_travel_time

haha, yes, was afraid you’d say that… would be really cool though, so please consider it a feature request :wink:

Yes @Mariusthvdb this is the best custom component I have added in a long time. Made all the better because it can replace and IMHO improve on ones that are already pretty good!

I’m a big fan!

1 Like

Quick question.

Does anybody use the feature to define the origin/destination via the friendly name of a zone?

And if yes why does using zone.zonename not work?

Why the hell shall I do this ? :slight_smile:
I use zones for both, one time from home to work and the second time back.
It works great

  - platform: here_travel_time
    app_id: "id"
    app_code: "code"
    name: 'Yvonnes Arbeitsweg >'
    origin: zone.home
    destination: zone.intersnack
    traffic_mode: true
  - platform: here_travel_time
    app_id: "id"
    app_code: "code"
    name: 'Yvonnes Heimweg <'
    origin: zone.intersnack
    destination: zone.home
    traffic_mode: true

New Relase v2.0.0

This release prepares for the official integration of here_travel_time into homeassistant. The config option have changed to allow for better validation and the travel time attributes were aligned to the google_travel_time component.

Breaking Changes

  • Referencing a zone by its friendly name is no longer supported. You can still use its entity_id e.g. zone.home
  • origin is replaced by origin_latitude and origin_longitude when using coordinates or origin_entity_id when using device_tracker, zone, sensor and person. See the updated configuration instructions for more details.
  • destination is replaced by destination_latitude and destination_longitude when using coordinates or destination_entity_id when using device_tracker, zone, sensor and person. See the updated configuration instructions for more details.
  • The attribute duration now always returns the value of travel time without traffic
  • The attribute duration_without_traffic is removed
  • The attribute duration_in_traffic was added to be more in sync with the google_travel_time component

Changes

Features

Bugfixes


Please report any issues directly in the github repository: https://github.com/eifinger/here_travel_time/issues

Hi,
questions after update:
what does this attribute mean? attribution: null
The state now shows the duration or duration_in_traffic? expected in relation to the mode, right?

Attribution holds a string which the vendor of the api requires you to display. For example Waze requires you to display “Powered by Waze”. For HERE this is empty as it is not required.

  1. duration always shows the duration without traffic
  2. duration_in_traffic shows the duration in traffic if traffic_mode: True is used and mode is car or truck
  3. Otherwise duration_in_traffic shows the same as duration (duration without traffic)
  4. state shows the same as duration for traffic_mode: False
  5. state shows the same as duration_in_traffic for traffic_mode: True

EDIT: So basically, yes you are right!

1 Like

Hi,

as my car sensors work perfectly, I played around with the publicTransportTimeTable a little.
I always use the train when travelling to my office.
But, I got as result the minutes I need and the Line Number (Route)
No information about next starttime or arrivaltime or delays.
What is the use case for this?

@scstraus seems to have a use case for this.

I could add an additional attribute departure or public_departure which shows the departure time of the first(?) line. Arrival time would then be departure time + duration

There is also a transit api: https://developer.here.com/documentation/transit/topics/what-is.html

I could implement another component which behaves much like @cgtobi 's rmvtransport sensor

1 Like

That would be really great.
My use case: Between 06 and 10 alexa tells me. when the next departure from my station to cologne is more then 5 Minutes late. Then I have to fall in panic because my connecting train in cologne might be unarrivable :slight_smile:
there is a DB Sensor which provides the information


But this one is very slow and not very flexible. It causes warnings in HA Log because in needs more then 10 sec.

UPDATE: I restarted the container (not just HA) and it is now working. Not sure why that made a difference, but I actually had to go to Portainer and restart the HA container and now the sensor is working as expected.

If anyone is having issues similar to below, try restarting the container - not just HA.

Updating configuration for the 2.0.0 update… the origin_entity_id does not seem to be working.

Log Details (ERROR)

Fri Aug 16 2019 13:05:34 GMT-0400 (Eastern Daylight Time)

Invalid config for [sensor.here_travel_time]: [origin_entity_id] is an invalid option for [sensor.here_travel_time]. Check: sensor.here_travel_time->origin_entity_id. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.here_travel_time/ 
Invalid config for [sensor.here_travel_time]: [origin_entity_id] is an invalid option for [sensor.here_travel_time]. Check: sensor.here_travel_time->origin_entity_id. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.here_travel_time/

My configuration.yaml entry:

- platform: here_travel_time                                                         
    name: Work Short Route                                                             
    traffic_mode: true                                                                 
    route_mode: shortest                                                               
    app_id: !secret here_api_id                                                        
    app_code: !secret here_api_code                                                    
    origin_entity_id: zone.home                                                        
    destination_entity_id: zone.work

Not sure what I’ve got wrong… seems like it should be a simply change…

Cheers!
DeadEnd

1 Like

Just wondering - would it be possible to have something similar to incl_filter variable from Waze travel time which forces to calculate selected route through given street?

I realize that its a lot of work but that would be awesome. Universal component for public transport which works with all major cities around the wold would really benefit HA.

The HERE API does not support this directly but maybe there is a workaround.
Could you please open an issue for your feature request under https://github.com/eifinger/here_travel_time/issues ? thank you!

Totally agree. a big value add even we’re talking about an official integrated component later.

For me, I use it to tell which tram/train/bus will be the fastest at that moment, and also to detect outages. I don’t really need to know departure time, I just look at it when leaving the house and go to the one it says is the fastest.

Though departure time would be a nice addition for some people… I don’t need it for my use case though. As long as it’s giving me the fastest route, I know it’s giving me the walking time needed to get there.

@eifinger, i’m on beta 0.100.0b0 and all i had to do was to remove the integration from hacs.
Thanks for putting this to HA core.

Thank you for the kind feedback!

how do you do that … (sorry to be off topic, I’ve enabled the beta in system settings, but dont see an update signal ?)

I’ve seen it in the discord beta channel.