GithubHelp home page GithubHelp logo

migepatschen / ha-deutschebahn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from faserf/ha-deutschebahn

0.0 0.0 0.0 201 KB

Unofficial HA DB Integration, due to removal as of Home Assistant 2022.11

License: Apache License 2.0

Python 100.00%

ha-deutschebahn's Introduction

hacs_badge

Deutsche Bahn Homeassistant Sensor

The 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.

Deutsche Bahn

Deutsche Bahn Sensor

The 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.

Please note that I will only give limited support on this integration

This integration is based on the formerly officia HA DB integration, see here.

This sensor stores a lot of attributes which can be accessed by other sensors, e.g., a template sensor.

Old Homeassistant documentation can be found here.

Installation

1. Using HACS (recommended way)

This integration is a official HACS Integration.

Open HACS then install the "Deutsche Bahn" integration.

If you use this method, your component will always update to the latest version.

2. Manual

  • Download the latest zip release from here
  • Extract the zip file
  • Copy the folder "deutschebahn" from within custom_components with all of its components to <config>/custom_components/

where <config> is your Home Assistant configuration directory.

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.

Migrate from the old official HA integration or from this V1.X to 2.X Version

  1. Remove any deutschebahn (or deutsche_bahn) configuration from your configuration.yaml file
  2. Update the Integration to the latest release
  3. Restart Homeassistant
  4. Set up the integration from the UI

Configuration

Go to Configuration -> Integrations and click on "add integration". Then search for "Deutsche Bahn".

Configuration Variables

  • from: The name of the start station.
  • to: The name of the end/destination station.
  • 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.
  • only direct (optional - default is false): Only show direct connections.
  • products to ignore (optional - default is empty): Filter train types, that should be excluded

YAML Config

DEPRECATED, use the GUI setup instead! Only valid for Version 1.X

# Example configuration.yaml entry
sensor:
  - platform: deutschebahn
    from: NAME_OF_START_STATION
    to: NAME_OF_FINAL_STATION
# Example advanced configuration.yaml entry
sensor:
  - platform: deutschebahn
    from: NAME_OF_START_STATION
    to: NAME_OF_FINAL_STATION
    offset: 00:03:30
    only_direct: false

Lovelace Custom Card

silviokennecke has created this great lovelace card for a better overview of the train departures. Be sure to check it out.

Bug reporting

Open an issue over at github issues. Please prefer sending over a log with debugging enabled.

To enable debugging enter the following in your configuration.yaml

logger:
    logs:
        custom_components.deutschebahn: debug

You can then find the log in the HA settings -> System -> Logs -> Enter "deutschebahn" in the search bar -> "Load full logs"

Thanks to

Huge thanks to @homeassistant for the official old integration, where this one is based on! Also to @kennell for the schiene python library that this integration is using.

The data is coming from the bahn.de website.

ha-deutschebahn's People

Contributors

faserf avatar renovate[bot] avatar dev-stb avatar m-see avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.