Giter Club home page Giter Club logo

lovelace-vasttrafik-card's Introduction

vasttrafik-card

Styled entities using the Västtrafik theme in a lovelace entities card. All trams and buses are styled using the colours used in their respective municipality.

This card also displays:

  • When the next vehicle is leaving
  • Departing station
  • Heading / arriving station
  • When you have to leave home in order to catch the vehicle (also known as the sensor delay).
  • Sorting of entities, showing the next entity to depart first

v1.0.0

If you are looking for the Västtrafik-card where you can group sensors based on departure or destination, you want the (discontinued) v1.0.0

Installation

Install card-tools by adding card-tools.js to your lovelace resources. Install this card either through HACS (recommended), or by manually extracting and setting up as a resource.

Options

Name Type Default Description
entities list Required A list of entity sensors provided by the Västtrafik integration
title string Västtrafik The title of the card
municipality string Göteborg The municipality of the station(s), more info here
sort boolean true Whether to sort the departures (earliest first), or keep the entities in the given order
showFrom boolean true Whether to show the departing station or not
showTo boolean false Whether to show the arriving station or not
showDir boolean false Whether to show the destination station or not

Municipality

As there are many lines with the same name or number in Västra Götaland, the styles are split by municipality. For accuracy, choose the municipality of your departing sensor(s).

Currently supported municipalities:

Ale
Alingsås
Åmål
Årjäng
Bengtsfors
Bollebygd
Borås
Dals-Ed
Essunga
Falkenberg
Falköping
Färgelanda
Göteborg
Götene
Grästorp
Gullspång
Habo
Hallsberg
Härryda
Herrljunga
Hjo
Jönköping
Karlsborg
Kristinehamn
Kumla
Kungälv
Kungsbacka
Laxå
Lerum
Lidköping
Lilla Edet
Lysekil
Mariestad
Mark
Mellerud
Mölndal
Mullsjö
Munkedal
Nässjö
Norge
Öckerö
Örebro
Orust
Partille
Säffle
Skara
Skövde
Sotenäs
Stenungsund
Strömstad
Svenljunga
Tanum
Tibro
Tidaholm
Tjörn
Töreboda
Tranemo
Trollhättan
Uddevalla
Ulricehamn
Vänersborg
Vara
Varberg
Vårgårda
Västra Götaland

Examples

type: 'custom:vasttrafik-card'
title: 'Mot Brunnsparken'
entities:
  - sensor.ekedal_till_brunnsparken
  - sensor.godhemsgatan_till_brunnsparken
municipality: Göteborg
sort: true

Example 1

Tram and bus styles (example shows Göteborg)

Colours for each tram or bus line

In case of errors

  1. A warning will be printed to the console if any entity id you provide is not attributed to Västtrafik
  2. The sensor updates every 2 minutes, so you will sometimes get -2 minutes until departure

Västtrafik updated their designs?

To get the latest designs/colours exported as css, run python3 ../helpers/generate_css.py from the dist folder.

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.