Giter VIP home page Giter VIP logo

ha-lta's Introduction

LTA bus arrival timings custom component for Home Assistant ๐ŸšŒ

Home Assistant custom component to retrieve bus timings, using the Datamall API provided by LTA.

Installation (HACS)

Installation by HACS is recommended if you would like to stay updated with latest releases.

  1. Follow the instructions here and add this repository.

  2. Request for an API key at Datamall. This key is required for Home Assistant to interact with the bus API.

  3. Restart Home Assistant and configure the component in configuration.yaml with the API key and bus stop codes.

Installation (Manual)

  1. Download this repository as a ZIP. Copy the folder /custom_components/ha-lta and paste it to the /custom_components/ folder in your Home Assistant directory. If you do not have a custom_components folder, create one.

  2. Request for an API key at Datamall. This key is required for Home Assistant to interact with the bus API.

  3. Configure the component in configuration.yaml with the API key and bus stop codes.

Configuration

Add the following to your configuration.yaml file and restart Home Assistant to load it. Bus stop codes are found at all bus stops and are 5 digit numbers (etc. 97061, 08138).

sensor:
  - platform: lta
    bus_stop_code: 'XXXXX'
    api_key: 'XXXXXXXXXX'

Usage

After you have added the configuration with a proper bus stop code, multiple sensor entities will be added for each bus number. Each bus number has 3 subsequent timings. The naming convention for a lta sensor is as follows:

lta.$BUS_STOP_CODE-$BUS_NUMBER-$BUS_ORDER

For example, sensor lta.98051-19-1 indicates the first timing for bus 19 towards bus stop code 98051. Sensor lta.98051-19-2 will indicate the next subsequent timing for the same bus number.

In rare cases, some bus numbers will only operate in service at certain timings. Home Assistant will automatically add any new additional bus numbers and remember them.

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.