MVV Departure Display - OpenEPaperLink/Home_Assistant_Integration GitHub Wiki

MVV Departure Board Display

This automation creates a real-time departure board display for Munich public transport (MVV) using an E-Paper display. It updates every 5 minutes when you're at home, showing the next 5 departures from your configured station.

IMG_1954

Prerequisites

Installation

  1. Install the munich_public_transport integration in your Home Assistant instance
  2. Configure your desired station in the integration
  3. Add the automation code to your Home Assistant configuration

Configuration

Required Customization

Before using this automation, you need to replace the following placeholders in the code:

  • <YOUR_PERSON_ENTITY> - Your Home Assistant person entity (e.g., person.john)
  • <YOUR_STATION_SENSOR> - Your MVV station sensor ID (e.g., sensor.hauptbahnhof_all_departures)
  • <YOUR_HOME_ZONE> - Your home zone entity ID (e.g., zone.home)

Automation Code

alias: MVV Departure Display
description: MVV departure board display
triggers:
  - minutes: /5
    trigger: time_pattern
conditions:
  - condition: zone
    entity_id: <YOUR_PERSON_ENTITY>
    zone: <YOUR_HOME_ZONE>
actions:
    data:
      background: white
      rotate: 0
      payload:
        - type: text
          value: "{{ station_name }}"
          x: 148
          "y": 15
          align: center
          anchor: mm
          size: 20
        - type: line
          x_start: 0
          x_end: 296
          y_start: 25
          fill: black
          width: 1
        - type: rectangle_pattern
          x_start: 5
          y_start: 28
          x_offset: 0
          y_offset: 2
          x_size: 35
          y_size: 18
          fill: accent
          outline: accent
          width: 1
          x_repeat: 1
          y_repeat: "{{ departures|length }}"
        - type: multiline
          delimiter: ;
          x: 23
          font: ppb.ttf
          size: 20
          start_y: 38
          offset_y: 20
          color: white
          anchor: mm
          value: |-
            {% for departure in departures %}
              {{- departure.line -}}
              {%- if not loop.last %};{% endif -%}
            {% endfor %}
        - type: multiline
          delimiter: ;
          x: 45
          font: ppb.ttf
          size: 20
          start_y: 38
          offset_y: 20
          color: black
          value: |-
            {% for departure in departures %}
              {{- departure.destination[:16] -}}
              {%- if not loop.last %};{% endif -%}
            {% endfor %}
        - type: multiline
          delimiter: ;
          x: 238
          font: ppb.ttf
          size: 20
          start_y: 38
          offset_y: 20
          color: black
          value: |-
            {% for departure in departures %}
              {{- departure.realtime_departure }}
              {%- if not loop.last %};{% endif -%}
            {% endfor %}
    action: open_epaper_link.drawcustom
variables:
  departures: "{{ state_attr('<YOUR_STATION_SENSOR>', 'departures') }}"
  station_name: >-
    {{ state_attr('<YOUR_STATION_SENSOR>',
    'friendly_name').replace(' All Departures', '') }}
mode: single