{"id":18390773,"url":"https://github.com/eifinger/open_route_service","last_synced_at":"2025-04-07T02:35:21.776Z","repository":{"id":37859167,"uuid":"202322117","full_name":"eifinger/open_route_service","owner":"eifinger","description":"Custom Component for Homeassistant Providing Travel Time Information using openrouteservice.org","archived":true,"fork":false,"pushed_at":"2024-03-20T16:59:28.000Z","size":374,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T11:51:10.392Z","etag":null,"topics":["homeassistant","open-route-service","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eifinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-14T09:47:53.000Z","updated_at":"2025-03-14T14:55:47.000Z","dependencies_parsed_at":"2024-11-06T02:00:38.393Z","dependency_job_id":null,"html_url":"https://github.com/eifinger/open_route_service","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":"ludeeus/integration_blueprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fopen_route_service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fopen_route_service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fopen_route_service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fopen_route_service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eifinger","download_url":"https://codeload.github.com/eifinger/open_route_service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247583690,"owners_count":20962066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["homeassistant","open-route-service","python","python3"],"created_at":"2024-11-06T01:49:06.674Z","updated_at":"2025-04-07T02:35:16.768Z","avatar_url":"https://github.com/eifinger.png","language":"Python","funding_links":["https://www.buymeacoffee.com/eifinger"],"categories":[],"sub_categories":[],"readme":"# open_route_service\r\n\r\n## !!!! NO LONGER MAINTAINED !!!!\r\n\r\nI decided to longer maintain this component. I currently do not have enough free time I want to spend on it.\r\n\r\nMy decision is based on the fact, that I don't see an added benefit of this integration over [Waze](https://www.home-assistant.io/integrations/waze_travel_time/), [Google](https://www.home-assistant.io/integrations/google_travel_time/) or [HERE](https://www.home-assistant.io/integrations/here_travel_time/).\r\n\r\n- Has a higher entry barrier as `waze_travel_time` as it needs an account to generate an API key\r\n- Does not provide live-traffic data and going by [this](https://ask.openrouteservice.org/t/live-time-traffic/1756) post it will not have it in the near future\r\n\r\nI suggest to use the [HERE Traveltime Integration](https://www.home-assistant.io/integrations/here_travel_time/) as an alternative\r\n\r\n---\r\n\r\n[![GitHub Release][releases-shield]][releases]\r\n[![GitHub Activity][commits-shield]][commits]\r\n[![hacs][hacsbadge]][hacs]\r\n![HACS Installs][hacs-installs-shield]\r\n[![License][license-shield]](LICENSE.md)\r\n\r\n![Project Maintenance][maintenance-shield]\r\n[![BuyMeCoffee][buymecoffeebadge]][buymecoffee]\r\n\r\n[![Community Forum][forum-shield]][forum]\r\n\r\n_Homeassistant Custom Component sensor provides travel time from [https://maps.openrouteservice.org/](https://maps.openrouteservice.org/)._\r\n\r\n**This component will set up the following platforms.**\r\n\r\n| Platform | Description                          |\r\n| -------- | ------------------------------------ |\r\n| `sensor` | Show travel time between two places. |\r\n\r\n![example][exampleimg]\r\n\r\n## Installation\r\n\r\n### HACS\r\n\r\nThe easiest way to add this to your Homeassistant installation is using [HACS](https://custom-components.github.io/hacs/). And then follow the instructions under [Configuration](#configuration) below.\r\n\r\n### Manual\r\n\r\n1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`).\r\n2. If you do not have a `custom_components` directory (folder) there, you need to create it.\r\n3. In the `custom_components` directory (folder) create a new folder called `open_route_service`.\r\n4. Download _all_ the files from the `custom_components/open_route_service/` directory (folder) in this repository.\r\n5. Place the files you downloaded in the new directory (folder) you created.\r\n6. Follow the instructions under [Configuration](#configuration) below.\r\n\r\nUsing your HA configuration directory (folder) as a starting point you should now also have this:\r\n\r\n```text\r\ncustom_components/open_route_service/__init__.py\r\ncustom_components/open_route_service/manifest.json\r\ncustom_components/open_route_service/sensor.py\r\n```\r\n\r\n## Setup\r\n\r\nYou need to register for an API key [here](https://openrouteservice.org/dev).\r\n\r\nOpenroute Services offers a Free Plan which includes 1.000 free requests (For reverse geocoding) per day. More information can be found [here](https://openrouteservice.org/plans/)\r\n\r\n## Configuration\r\n\r\nTo enable the sensor, add the following lines to your `configuration.yaml` file:\r\n\r\n```yaml\r\n# Example entry for configuration.yaml\r\nsensor:\r\n  - platform: open_route_service\r\n    api_key: \"YOUR_API_KEY\"\r\n    origin_latitude: \"51.222975\"\r\n    origin_longitude: \"9.267577\"\r\n    destination_latitude: \"51.257430\"\r\n    destination_longitude: \"9.335892\"\r\n```\r\n\r\n## Configuration options\r\n\r\n| Key                                   | Type      | Required | Description                                                                                                                                                                       |\r\n| ------------------------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| `api_key`                             | `string`  | `true`   | Your application's API key (get one by following the instructions above).                                                                                                         |\r\n| `origin_latitude`                     | `string`  | `true`   | The starting latitude for calculating travel distance and time. Must be used in combination with origin_longitude. Cannot be used in combination with origin_entity_id            |\r\n| `origin_longitude`                    | `string`  | `true`   | The starting longitude for calculating travel distance and time. Must be used in combination with origin_latitude. Cannot be used in combination with origin_entity_id            |\r\n| `destination_latitude`                | `string`  | `true`   | The finishing latitude for calculating travel distance and time. Must be used in combination with destination_longitude. Cannot be used in combination with destination_entity_id |\r\n| `destination_longitude`               | `string`  | `true`   | The finishing longitude for calculating travel distance and time. Must be used in combination with destination_latitude. Cannot be used in combination with destination_entity_id |\r\n| `origin_entity_id`                    | `string`  | `true`   | The entity_id holding the starting point for calculating travel distance and time. Cannot be used in combination with origin_latitude / origin_longitude                          |\r\n| `destination_entity_id`               | `string`  | `true`   | The entity_id holding the finishing point for calculating travel distance and time. Cannot be used in combination with destination_latitude / destination_longitude               |\r\n| `name`                                | `string`  | `false`  | A name to display on the sensor. The default is \"HERE Travel Time\".                                                                                                               |\r\n| `mode`                                | `string`  | `false`  | You can choose between: `cycling-regular`, `driving-car` or `foot-walking`. The default is `driving-car`.                                                                         |\r\n| `route_mode`                          | `string`  | `false`  | You can choose between: `fastest`, or `shortest`. The default is `fastest`                                                                                                        |\r\n| `unit_system`                         | `string`  | `false`  | You can choose between `metric` or `imperial`. Defaults to `metric` or `imperial` based on the Home Assistant configuration.                                                      |\r\n| `scan_interval`                       | `integer` | `false`  | \"Defines the update interval of the sensor in seconds. Defaults to 300 (5 minutes).\"                                                                                              |\r\n| `origin_reverse_geocode_enabled`      | `boolean` | `false`  | \"Whether to resolve the origin coordinates to a geolocation(address). Defaults to true.\"                                                                                          |\r\n| `destination_reverse_geocode_enabled` | `boolean` | `false`  | \"Whether to resolve the destination coordinates to a geolocation(address). Defaults to true.\"                                                                                     |\r\n\r\n## Dynamic Configuration\r\n\r\nTracking can be set up to track entities of type `device_tracker`, `zone`, `sensor` and `person`. If an entity is placed in the origin or destination then every 5 minutes when the platform updates it will use the latest location of that entity.\r\n\r\n```yaml\r\n# Example entry for configuration.yaml\r\nsensor:\r\n  # Tracking entity to entity\r\n  - platform: open_route_service\r\n    api_key: \"YOUR_API_KEY\"\r\n    name: Phone To Home\r\n    origin_entity_id: device_tracker.mobile_phone\r\n    destination_entity_id: zone.home\r\n```\r\n\r\n## Entity Tracking\r\n\r\n- **device_tracker**\r\n  - If the state is a zone, then the zone location will be used\r\n  - If the state is not a zone, it will look for the longitude and latitude attributes\r\n- **zone**\r\n  - Uses the longitude and latitude attributes\r\n- **sensor**\r\n  - If the state is a zone, then will use the zone location\r\n  - All other states will be passed directly into the HERE API\r\n    - This includes all valid locations listed in the _Configuration Variables_\r\n\r\n## Updating sensors on-demand using Automation\r\n\r\nYou can also use the `homeassistant.update_entity` service to update the sensor on-demand. For example, if you want to update `sensor.morning_commute` every 2 minutes on weekday mornings, you can use the following automation:\r\n\r\n```yaml\r\nautomation:\r\n  - id: update_morning_commute_sensor\r\n    alias: \"Commute - Update morning commute sensor\"\r\n    initial_state: \"on\"\r\n    trigger:\r\n      - platform: time_pattern\r\n        minutes: \"/2\"\r\n    condition:\r\n      - condition: time\r\n        after: \"08:00:00\"\r\n        before: \"11:00:00\"\r\n      - condition: time\r\n        weekday:\r\n          - mon\r\n          - tue\r\n          - wed\r\n          - thu\r\n          - fri\r\n    action:\r\n      - service: homeassistant.update_entity\r\n        entity_id: sensor.morning_commute\r\n```\r\n\r\n\u003ca href=\"https://www.buymeacoffee.com/eifinger\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/black_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\u003cbr\u003e\r\n\r\n[buymecoffee]: https://www.buymeacoffee.com/eifinger\r\n[buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge\r\n[commits-shield]: https://img.shields.io/github/commit-activity/y/eifinger/open_route_service?style=for-the-badge\r\n[commits]: https://github.com/eifinger/open_route_service/commits/master\r\n[hacs]: https://github.com/hacs/integration\r\n[hacsbadge]: https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge\r\n[hacs-installs-shield]: https://img.shields.io/badge/dynamic/json?color=41BDF5\u0026logo=home-assistant\u0026label=installs\u0026style=for-the-badge\u0026cacheSeconds=15600\u0026url=https://analytics.home-assistant.io/custom_integrations.json\u0026query=$.open_route_services.total\r\n[exampleimg]: https://github.com/eifinger/open_route_service/blob/main/example.png?raw=true\r\n[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge\r\n[forum]: https://community.home-assistant.io/t/custom-component-open-route-service-travel-time/131941\r\n[license-shield]: https://img.shields.io/github/license/eifinger/open_route_service.svg?style=for-the-badge\r\n[maintenance-shield]: https://img.shields.io/badge/maintainer-Kevin%20Eifinger%20%40eifinger-blue.svg?style=for-the-badge\r\n[releases-shield]: https://img.shields.io/github/release/eifinger/open_route_service.svg?style=for-the-badge\r\n[releases]: https://github.com/eifinger/open_route_service/releases\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feifinger%2Fopen_route_service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feifinger%2Fopen_route_service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feifinger%2Fopen_route_service/lists"}