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 any 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
entity entity required The entity_id of the 'Departure' sensor.
title string optional If set, this will be rendered as the card name.
show_entity_name bool optional Render an individual name for each entity section.
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
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.

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