Skip to content

A sensor to provide MTA Subway service statuses for Home Assistant.

License

Notifications You must be signed in to change notification settings

iicky/homeassistant-mta-subway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant MTA Subway Service Status Sensor

hacs_badge

Overview

A sensor to provide MTA Subway service statuses for Home Assistant. The sensor reads from the goodservice.io API and provides both the overall line status as a sensor state as well as status descriptions and route directions as sensor attributes. The train line states are updated every minute from the detailed goodservice.io route endpoint.

Credit for the line icons goes to louh and his great NYC Subway Icons repo (used with some slight renaming).

Sensor States

  • Good Service
  • Planned Work
  • Slow
  • Not Good
  • Delays
  • Service Change

Example subway card in Home Assistant

Sensor Attributes

Color
Indicates the color of the subway line.

Scheduled
Indicates whether the route is scheduled or not.

Direction statuses
Indicates the route status for both route directions.

Delay summaries
A full description of route delays for both directions.

Service irregularity summaries
A full description of any service irregularity summaries currently occuring on the line for both route directions.

Service change summaries
A full description of any planned work currently for both directions individually and combined.


Example sensor state and attributes in Home Assistant

Installation

To install the sensor, copy the mta_subway folder under custom_components to a directory called custom_components in your Home Assistant configuration directory.

To use, add the following configuration to your configuration.yaml file for Home Assistant, removing any lines that you do not want to monitor:

sensor:
  - platform: mta_subway
    line:
      - '1'
      - '2'
      - '3'
      - '4'
      - '5'
      - '6'
      - '6X'
      - '7'
      - '7X'
      - 'A'
      - 'B'
      - 'C'
      - 'D'
      - 'E'
      - 'F'
      - 'FX'
      - 'G'
      - 'J'
      - 'L'
      - 'M'
      - 'N'
      - 'Q'
      - 'R'
      - 'GS'
      - 'FS'
      - 'H'
      - 'SI'
      - 'W'
      - 'Z'