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

adrkable/homeassistant-mta-subway

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant MTA Subway Service Status Sensor

Overview

A sensor to provide MTA Subway service statuses for Home Assistant. The sensor reads from the offical MTA Service Status XML feed and provides both the overall line status as a sensor state as well as status descriptions as sensor attributes. The train line states are updated every minute from the MTA feed.

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

Sensor States

  • Good Service
  • Delays
  • Planned Work
  • Service Change

Example subway card in Home Assistant

Sensor Attributes

Direction 0 State
Indicates the subway line state in either the North or East direction (direction in undocumented, but this is my best guess).

Direction 1 State
Indicates the subway line state in either the South or West direction (direction in undocumented, but this is my best guess).

Delays Description
A full description of why the line is delayed.

Service Change Description
A full description of the changes to the line service.

Planned Work Description
A full description of any planned work currently occuring on the line.


Example sensor state and attributes in Home Assistant

Installation

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

To install the offical MTA line icons, copy the www/mta_subway directory and all svg files to 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
      - 7
      - A
      - C
      - E
      - B
      - D
      - F
      - M
      - G
      - J
      - Z
      - L
      - N
      - Q
      - R
      - W
      - S
      - SI

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%