Skip to content

PiotrMachowski/Home-Assistant-custom-components-MPK-Lodz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HACS Custom GitHub Latest Release GitHub All Releases Ko-Fi buycoffee.to PayPal.Me Revolut.Me

MPK Łódź sensor

This sensor uses unofficial API provided by MPK Łódź.

Configuration options

Key Type Required Default Description
name string False MPK Łódź Name of sensor
stops list True - List of stop configurations

Stop configuration

Key Type Required Default Description
id positive integer False - ID of a stop
num positive integer False - Number of a stop
name string False id Name of a stop
lines list False all available List of monitored lines.
directions list False all available List of monitored directions.

One of id or num must be provided!

Example usage

sensor:
  - platform: mpk_lodz
      stops:
        - id: 2427
          lines:
            - "o97A"          
        - id: 2873
          directions:
            - "DW. ŁÓDŹ KALISKA"

Installation

Using HACS (recommended)

This integration can be added to HACS as a custom repository:

  • URL: https://github.com/PiotrMachowski/Home-Assistant-custom-components-MPK-Lodz
  • Category: Integration

After adding a custom repository you can use HACS to install this integration using user interface.

Manual

To install this integration manually you have to download mpk_lodz.zip and extract its contents to config/custom_components/mpk_lodz directory:

mkdir -p custom_components/mpk_lodz
cd custom_components/mpk_lodz
wget https://github.com/PiotrMachowski/Home-Assistant-custom-components-MPK-Lodz/releases/latest/download/mpk_lodz.zip
unzip mpk_lodz.zip
rm mpk_lodz.zip

Hints

  • Value for id/num can be retrieved from ITS Łódź. After choosing a desired stop open its electronical table. There should be a number visibile in URL. If URL contains busStopId you should use this number as id. If URL contains busStopNum you should use this number as num.

  • These sensors provides attributes which can be used in HTML card or HTML Template card: html_timetable, html_departures

    • HTML card:
      - type: custom:html-card
        title: 'MPK'
        content: |
          <big><center>Timetable</center></big>
          [[ sensor.mpk_lodz_2427.attributes.html_timetable ]]
          <big><center>Departures</center></big>
          [[ sensor.mpk_lodz_2873.attributes.html_departures ]]
    • HTML Template card:
      - type: custom:html-template-card
        title: 'MPK'
        ignore_line_breaks: true
        content: |
          <big><center>Timetable</center></big></br>
          {{ state_attr('sensor.mpk_lodz_2427','html_timetable') }}
          </br><big><center>Departures</center></big></br>
          {{ state_attr('sensor.mpk_lodz_2873','html_departures') }}

Support

If you want to support my work with a donation you can use one of the following platforms:

Platform Payment methods Link Comment
Ko-fi
  • PayPal
  • Credit card
  • Buy Me a Coffee at ko-fi.com
  • No fees
  • Single or monthly payment
  • buycoffee.to
  • BLIK
  • Bank transfer
  • Postaw mi kawę na buycoffee.to
    PayPal
  • PayPal
  • PayPal Logo
  • No fees
  • Revolut
  • Revolut
  • Credit Card
  • Revolut
  • No fees