Git Product home page Git Product logo

stib-mivb-card's Introduction

Stib-Mivb

This card generates a passages card for the De Lijn public transport service in Flanders (Belgium).

example

Options

Name Type Requirement Description
type string Required custom:stib-mivb-card
entity string Required The entity_id of the entity you want to show.
title string Optional Add a custom title to the card.
config_type string Optional 'default' for standard setup, 'raw' for raw entity data, 'columns' for defining a custom list of columns. If this option is not added the default setup will be shown in the card.
columns object Optional List of columns to display.

Column object

Name Type Requirement Description
title string Required Column header to display.
field string Required key value of the entity that you wish to display.

Installation

Step 1

Install stib-mivb-card by copying stib-mivb-card.js from this repo to <config directory>/www/stib-mivb-card.js of your Home Assistant instance.

Example:

wget https://raw.githubusercontent.com/Emilv2/stib-mivb-card/master/stib-mivb-card.js
mv stib-mivb-card.js ~/.homeassistant/www/

Step 2

Set up the De Lijn custom sensor.

Example:

sensor:
  - platform: stib_mivb   
    api_key: ed3d8637ab9d3397a50a801957cb17ca
    lang: nl
    message_lang: en
    stops:
      - stop_id: 8301
        line_numbers: 
          - 6
          - 2

Note: replace the api_key with the access token you generated with you opendata.stib-mivb.be developer account.

Step 3

Link stib-mivb-card inside you ui-lovelace.yaml or via the Raw config editor when using the Configure UI in the Home-Assistant interface directly.

resources:
  - url: /local/stib-mivb-card.js
    type: js

Step 4

Add a custom element in your ui-lovelace.yaml. Or when using the Configure UI in the Home-Assistant interface directly you can add a Manual Card with this in the Card Configuration.

Example:

Example with default layout in the ui-lovelace.yaml:

      - type: 'custom:stib-mivb-card'
        entity: sensor.troon_line_6_2
        title: 'Troon'

Same when going via the Configure UI:

entity: sensor.troon_line_6_2
title: 'Troon'
type: 'custom:stib-mivb-card'

Example of a line with messages: example

Example of a deviated line: example

Credits

Thanks to cgtobi's rmv-card, Ian Richardson's list-card, bollewolle's delijn-card, and Helldog136's stib-mvib-card for all the initial work and inspiration.

stib-mivb-card's People

Contributors

emilv2 avatar bollewolle 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.