Skip to content
This sensor uses unofficial API retrieved by decompilation of iMPK application to provide a list of MPK Wrocław news available in original app.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
custom_components/impk
LICENSE
README.md
hacs.json
info.md

README.md

iMPK sensor

hacs_badge buymeacoffee_badge

These sensors use unofficial API retrieved by decompilation of iMPK application. Binary sensor provides a list of news available in the original app, sensor retrieves departures for desired stops.

Configuration options

Binary sensor

Key Type Required Default Description
name string False iMPK Name of sensor
monitored_conditions list True - List of conditions to monitor

Possible monitored conditions

Key Description
news List of news available in application

Sensor

Key Type Required Default Description
name string False iMPK Name of sensor
stops list True - List of stop configurations

Stop configuration

Key Type Required Default Description
id positive integer True - ID 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.

Example usage

binary_sensor:
  - platform: impk
    monitored_conditions:
      - news
sensor:
  - platform: impk
    lines:
      - id: 120820
      - id: 124202
        lines:
          - "D"
          - "131"
      - id: 124202
        name: "REJA"
        directions:
          - "REJA"

Installation

Download binary_sensor.py, sensor.py and manifest.json to config/custom_components/impk directory:

mkdir -p custom_components/impk
cd custom_components/impk
wget https://github.com/PiotrMachowski/Home-Assistant-custom-components-iMPK/raw/master/custom_components/impk/binary_sensor.py
wget https://github.com/PiotrMachowski/Home-Assistant-custom-components-iMPK/raw/master/custom_components/impk/sensor.py
wget https://github.com/PiotrMachowski/Home-Assistant-custom-components-iMPK/raw/master/custom_components/impk/manifest.json

Hints

  • These sensors provides attributes which can be used in HTML card or HTML Template card: html, html_timetable, html_departures
    • HTML card:
      - type: custom:html-card
        title: 'iMPK'
        content: |
          <big><center>News</center></big>
          [[ binary_sensor.impk_news.attributes.html ]]
          <big><center>Timetable</center></big>
          [[ sensor.impk_120820.attributes.html_timetable ]]
          <big><center>Departures</center></big>
          [[ sensor.impk_124202.attributes.html_departures ]]
    • HTML Template card:
      - type: custom:html-template-card
        title: 'iMPK'
        ignore_line_breaks: true
        content: |
          <big><center>News</center></big></br>
          {{ state_attr('binary_sensor.impk_news','html') }}
          </br><big><center>Timetable</center></big></br>
          {{ state_attr('sensor.impk_120820','html_timetable') }}
          </br><big><center>Departures</center></big></br>
          {{ state_attr('sensor.impk_124202','html_departures') }}
  • This integration is available in HACS.

Buy Me A Coffee

You can’t perform that action at this time.