{"id":21379063,"url":"https://github.com/faserf/ha-deutschebahn","last_synced_at":"2025-10-08T00:31:06.916Z","repository":{"id":58846670,"uuid":"534083455","full_name":"FaserF/ha-deutschebahn","owner":"FaserF","description":"Unofficial HA DB Integration, due to removal as of Home Assistant 2022.11","archived":false,"fork":false,"pushed_at":"2024-12-24T16:04:40.000Z","size":233,"stargazers_count":62,"open_issues_count":17,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-16T11:51:52.113Z","etag":null,"topics":["hacs-integration","homeassistant"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FaserF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"faserf","custom":"https://paypal.me/FaserF"}},"created_at":"2022-09-08T06:39:26.000Z","updated_at":"2025-01-11T11:17:36.000Z","dependencies_parsed_at":"2023-12-28T19:26:21.637Z","dependency_job_id":"1ef689b1-2577-4075-ad29-30812d19aa83","html_url":"https://github.com/FaserF/ha-deutschebahn","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaserF%2Fha-deutschebahn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaserF%2Fha-deutschebahn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaserF%2Fha-deutschebahn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaserF%2Fha-deutschebahn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FaserF","download_url":"https://codeload.github.com/FaserF/ha-deutschebahn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235665658,"owners_count":19026236,"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":["hacs-integration","homeassistant"],"created_at":"2024-11-22T10:16:56.603Z","updated_at":"2025-10-08T00:31:01.599Z","avatar_url":"https://github.com/FaserF.png","language":"Python","funding_links":["https://github.com/sponsors/faserf","https://paypal.me/FaserF"],"categories":[],"sub_categories":[],"readme":"[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration)\n\n# SUPERSEDED INFORMATION!\n[superior integration](https://github.com/FaserF/ha-db_infoscreen) has been released which brings similar functionality from a different and more reliable api source. \n\n# BREAKING WARNING!!!\nObsolete due to [superior integration](https://github.com/FaserF/ha-db_infoscreen).\n\nUnfortunatly bahn.de has shut down their websites that this integration used for web scraping. Therefore this integration wont work anymore since 15th december 2024. [More details](https://github.com/kennell/schiene/pull/36#issuecomment-2546101589) \u0026 [here](https://github.com/FaserF/ha-deutschebahn/issues/59#issuecomment-2546087237).\n\n# Deutsche Bahn Homeassistant Sensor\nThe `deutschebahn` sensor will give you the departure time of the next train for the given connection. In case of a delay, the delay is also shown. Additional details are used to inform about, e.g., the type of the train, price, and if it is on time.\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Db-bahn.svg/1280px-Db-bahn.svg.png\" alt=\"Deutsche Bahn\" width=\"300px\"\u003e\n\n\u003cimg src=\"images/sensor.png\" alt=\"Deutsche Bahn Sensor\" width=\"300px\"\u003e\n\n\nThe official Deutsche Bahn Homeassistant integration got removed with release 2022.11 - therefore this custom integration exists. It got removed due to cloud scraping, but still was fully functional.\n\nPlease note that I will only give limited support on this integration.\n\nThis integration is based on the formerly official HA DB integration, see [here](https://github.com/home-assistant/core/tree/c741d9d0452970c39397deca1c65766c8cb917da/homeassistant/components/deutsche_bahn).\n\nThis sensor stores a lot of attributes which can be accessed by other sensors, e.g., a [template sensor](https://www.home-assistant.io/integrations/template/).\n\nOld Homeassistant documentation can be found [here](https://github.com/home-assistant/home-assistant.io/blob/b38ab5e8bc745e8e751eb27c2c079de8a8e83d5e/source/_integrations/deutsche_bahn.markdown).\n\n## Installation\n### 1. Using HACS (recommended way)\n\nThis integration is a official HACS Integration.\n\nOpen HACS then install the \"Deutsche Bahn\" integration or use the link below.\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=FaserF\u0026repository=ha-deutschebahn\u0026category=integration)\n\nIf you use this method, your component will always update to the latest version.\n\n### 2. Manual\n\n- Download the latest zip release from [here](https://github.com/FaserF/ha-deutschebahn/releases/latest)\n- Extract the zip file\n- Copy the folder \"deutschebahn\" from within custom_components with all of its components to `\u003cconfig\u003e/custom_components/`\n\nwhere `\u003cconfig\u003e` is your Home Assistant configuration directory.\n\n\u003e__NOTE__: Do not download the file by using the link above directly, the status in the \"master\" branch can be in development and therefore is maybe not working.\n\n### Migrate from the old official HA integration or from this V1.X to 2.X Version\n1. Remove any deutschebahn (or deutsche_bahn) configuration from your configuration.yaml file\n2. Update the Integration to the latest release\n3. Restart Homeassistant\n4. Set up the integration from the UI\n\n## Configuration\n\nGo to Configuration -\u003e Integrations and click on \"add integration\". Then search for \"Deutsche Bahn\".\n\n[![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start/?domain=deutschebahn)\n\n### Configuration Variables\n- **from**: The name of the start station.\n- **to**: The name of the end/destination station.\n- **offset** (optional): Do not display departures leaving sooner than this number of seconds. Useful if you are a couple of minutes away from the stop. The formats \"HH:MM\" and \"HH:MM:SS\" are also supported.\n- **only direct** (optional - default is false): Only show direct connections.\n- **products to ignore** (optional - default is empty): Filter train types, that should be excluded\n- **maximum connections** (optional - default is 2): Specify how many next connections should be fetched\n- **scan interval** (optional - default is 2 minutes): Specify the refresh interval in minutes\n\n## Accessing the data\n\n### Automations\n```yaml\nautomation:\n  - alias: \"Notification for Train Delay\"\n    trigger:\n      platform: template\n      value_template: \"{{ state_attr('sensor.fromstation_to_station', 'departures')[0].delay | int \u003e 5 }}\"\n    action:\n      - service: notify.notify\n        data_template:\n          message: \u003e\n            The train departing at {{ states.sensor.fromstation_to_station.attributes.departures[0].departure_current }}\n            and arriving at {{ states.sensor.fromstation_to_station.attributes.departures[0].arrival_current }}\n            is delayed by {{ states.sensor.fromstation_to_station.attributes.departures[0].delay }}\n            minutes and costs {{ states.sensor.fromstation_to_station.attributes.departures[0].price }}.\n            Next train after that: {{ states.sensor.fromstation_to_station.attributes.departures[0].departure_current }}\n```\n\n### Custom sensor\nAdd a custom sensor in your configuration.yaml\n\n```yaml\nsensor:\n  - platform: template\n    sensors:\n      next_train_departure:\n        friendly_name: \"Next Train Departure\"\n        value_template: \"{{ state_attr('sensor.fromstation_to_station', 'connections')[0].departure }}\"\n        icon_template: mdi:train\n```\n\n### Lovelace Custom Card\n[silviokennecke](https://github.com/silviokennecke/) has created [this](https://github.com/silviokennecke/ha-custom-components/wiki/Components#public-transport-connection) great lovelace card for a better overview of the train departures. Be sure to check it out.\n\n## Bug reporting\nOpen an issue over at [github issues](https://github.com/FaserF/ha-deutschebahn/issues). Please prefer sending over a log with debugging enabled.\n\nTo enable debugging enter the following in your configuration.yaml\n\n```yaml\nlogger:\n    logs:\n        custom_components.deutschebahn: debug\n```\n\nYou can then find the log in the HA settings -\u003e System -\u003e Logs -\u003e Enter \"deutschebahn\" in the search bar -\u003e \"Load full logs\"\n\n## Thanks to\nHuge thanks to [@homeassistant](https://github.com/home-assistant/core/tree/c741d9d0452970c39397deca1c65766c8cb917da/homeassistant/components/deutsche_bahn) for the official old integration, where this one is based on!\nAlso to [@kennell](https://github.com/kennell/schiene) for the schiene python library that this integration is using.\n\nThe data is coming from the [bahn.de](https://www.bahn.de/p/view/index.shtml) website.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaserf%2Fha-deutschebahn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaserf%2Fha-deutschebahn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaserf%2Fha-deutschebahn/lists"}