Skip to content

hasl-sensor/lovelace-hasl-departure-card

Repository files navigation

HASL Departure Lovelace Card

hacs_badge ha_version version maintained License

Present departure times from HASL 3.2.0+ Departure sensors.

Now with deviations!

card

Manual Installation

Copy hasl4-departure-card.js and hasl4-departure-card-editor.js files to <config>/www/hasl4-departure-card.js

Where <config> is your Home Assistant configuration directory. Then use the following in your ui-lovelace.yaml file:

resources:
  - url: /local/hasl4-departure-card.js
    type: js

Basic setup

In your lovelace dashboard, Edit Dashboard -> Add Card -> Search for 'HASL Departure Card'

Configuration

Card fully supports configuration through the UI

card editor

Options

Name Type Required? Description
entities entity[] required The array of entity_id's of the 'Departure' sensors.
title string optional If set, this will be rendered as the card name.
show_entity_name bool optional Render a friendly name of a selected entity. Disabled when entities are set to more than 1 entity
show_header bool optional Render headers in each section such as "Line", "Destination" and "Departure".
show_icon bool optional Render transport icon for each line.
show_departures bool optional Render departures section.
max_departures number optional Max departures to show, default to all.
direction number optional Render departures only in said direction
hide_departed bool optional If set, will hide already departured vehicles.
show_departed_offset bool optional If set, will show some departed vehicles, which departed less than the offset minutes ago.
show_time_always bool optional Always present time in HH:MM form. If not set, time will be presented as "in X minutes" or "X minutes ago".
show_updated bool optional Render the 'last updated' text. Disabled when entities are set to more than 1 entity
language string optional The texts will be rendered in this language. Can be one of sv-SE, en-EN, fr-FR.
click_action string or object optional Action when tapping the card. See section click_action below.
hide_line_number bool optional Render the line number.

Setting entities to more than one entity will render departures from all of the sensors as one list sorted by expected time but will disable show_entity_name and show_updated options.

click_action

The click_action option can be used to specify what happens when the card is tapped. It can be one of the following:

  • Display information about the entity that was clicked:

    click_action: info
  • Display information about the specific entity

    click_action:
    entityId: sun.sun
  • Call a service:

    click_action:
      domain: light
      service: turn_on
      data:
        entity_id: light.living_room

Development

You'll need Node.js and npm installed on your computer. (Volta is recommended for managing Node.js versions)

npm install
npm run build

Credits

Support the developers