jonkristian / entur-card

Home Assistant Lovelace card card for the Entur public transport component.
MIT License
57 stars 6 forks source link
entur hacs home-assistant homeassistant lovelace transportation

Entur Card

hacs GitHub Release License Project Maintenance BuyMeCoffee

This card is made to work with the Entur public transport component. You will have to configure the Entur component before you can use this card. Click here to get stop id's for your setup.

Example

⚠️ Unfortunately there is currently no provided method to define a start and a stop station with entur. But you can add a whitelist of lines so that you can force only relevant results.

Features

Installation

HACS

Entur Card is available in HACS (Home Assistant Community Store).

  1. Install HACS if you don't have it already
  2. Open HACS in Home Assistant
  3. Go to "Frontend" section
  4. Click button with "+" icon
  5. Search for "Entur Card"

Manual

  1. Download entur-card.js file from the [latest-release].
  2. Put entur-card.js file into your config/www folder.
  3. Add reference to entur-card.js in Dashboard. There's two way to do that:
    • Using UI: SettingsDashboardsMore Options iconResourcesAdd Resource → Set Url as /local/entur-card.js → Set Resource type as JavaScript Module. Note: If you do not see the Resources menu, you will need to enable Advanced Mode in your User Profile
    • Using YAML: Add following code to lovelace section.
      resources:
      - url: /local/entur-card.js
       type: js

Card options

Field Type Description
custom:entur-card string(required)
name string Name of the card
divide_routes true/false Add a line divider between routes
display_time true/false Displays the time in the header
entities list(required) A list of entity IDs or entity objects, see below.

Entity options

Field Type Description
entity string(required) Home Assistant entity ID.
icon string Overrides the icon.
name string Overrides friendly name.
destination string Display hardcoded destination name.
clock_icon_state string None or left / right side of the time string.
extra_departures string next or all.
human_readable_time string Show for all, line, line_next or line_extras.
remaining_time string Show for all, line, line_next or line_extras.

Entur configuration

sensor:
  - platform: entur_public_transport
    name: Transport
    show_on_map: true
    stop_ids:
      - "NSR:StopPlace:5850" # Grorud T bus stop
      - "NSR:StopPlace:548" # Bergen train station
      - "NSR:StopPlace:58652" # Mortavika ferry

Manual card configuration

- type: custom:entur-card
  name: Rutetider
  entities:
    - entity: sensor.transport_grorud_t
      extra_departures: all
      divide_lines: true
      clock_icon_state: left
    - entity: sensor.transport_bergen_stasjon
      human_readable_time: line
    - entity: sensor.transport_mortavika_ferjekai
      remaining_time: all
      clock_icon_state: left
  display_time: true
  divide_routes: true

Contributions are welcome!


⭐️ this repository if you found it useful ❤️

BuyMeCoffee