Giter VIP home page Giter VIP logo

delijn-sensor's Introduction

delijn-sensor

This code can be used to add a custom sensor for De Lijn public transport of Flanders (Belgium) to Home Assistant.

Note: the idea is to eventually add this to the code of Home Assistant itself

Options

Name Type Requirement Description
platform string Required delijn
sub_key string Required The subscription key generated in a developer account at data.delijn.be.
nextpassages object Required List of stops to display next passages of.

nextpassages object

Name Type Requirement Description
stop_id string Required Stop Id to retrieve the next passages of. These can be found by searching a stop here (https://www.delijn.be/en/haltes/). After the search the 6 digit numerical code can be found in the URL. Ie. 200552 in case the URL is https://www.delijn.be/en/haltes/halte/200552/Gent_Korenmarkt_perron_2.
max_passages number Optional Set a maximum number of passages to return in the sensor (maximum is 20 by default).

Installation

Step 1

Install delijn-sensor by copying delijn.py from this repo to <config directory>/custom_components/sensor/delijn.py of your Home Assistant instance.

Example:

wget https://github.com/bollewolle/delijn-sensor/raw/master/delijn.py
mv delijn.py ~/.homeassistant//custom_components/sensor/

Step 2

Set up the De Lijn custom sensor.

Example:

sensor:
  - platform: delijn
    sub_key: '<put your data.delijn.be subscriptionkey here>'
    nextpassage:
    - stop_id: '200552'
      max_passages: 10
    - stop_id: '201169'
      max_passages: 5

Note: replace with the subscription key you generated with you data.delijn.be developer account.

Credits

Thanks to the codes of RMV and Ruter Public Transport for all the initial work and inspiration.

delijn-sensor's People

Contributors

bollewolle avatar

Watchers

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