MTA New York City Transit

The MTA New York City Transit integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides real-time subway and bus arrival predictions for NYC transit lines using GTFS-RT data from the Metropolitan Transportation Authority (MTA).

Prerequisites

Configuration

To add the MTA New York City Transit service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

  • Browse to your Home Assistant instance.

  • Go to Settings > Devices & services.

  • In the bottom right corner, select the Add Integration button.

  • From the list, select MTA New York City Transit.

  • Follow the instructions on screen to complete the setup.

API key

Your MTA Bus Time API key. Required for bus tracking, optional for subway only.

Adding a subway stop

To add a subway arrival sensor:

  1. Go to Settings > Devices & services and select the MTA New York City Transit integration.
  2. Select Add subway stop.
  3. Select the subway line you want to monitor from the dropdown.
  4. Select the stop and direction (indicated by N/S suffix for northbound/southbound).

Adding a bus stop

To add a bus arrival sensor:

  1. Go to Settings > Devices & services and select the MTA New York City Transit integration.
  2. Select Add bus stop.
  3. Enter the bus route (for example, M15, B46, Q10).
  4. Select the stop from the list. Direction information is included with each stop.

Note

Bus tracking requires an API key. If you did not provide one during initial setup, you will be prompted to enter one when you attempt to add a bus stop.

Supported functionality

The integration creates a device per stop with 9 sensors, covering the next 3 upcoming arrivals.

Sensors

For each of the next 3 arrivals, the following sensors are created:

  • Arrival: A timestamp sensor showing the predicted arrival time.
  • Arrival destination: The final destination of the train or bus.
  • Arrival route: The route identifier of the train or bus.

Defining a custom polling interval

If you want to define a specific interval at which your device is being polled for data, you can disable the default polling interval and create your own polling automation.

To add the automation:

  1. Go to Settings > Devices & services, and select your integration.
  2. On the integration entry, select the .
    • Then, select System options and toggle the button to disable polling. Disable polling for updates
  3. To define your custom polling interval, create an automation.
    • Go to Settings > Automations & scenes and create a new automation.
    • Define any trigger and condition you like.
    • Select Add action, then, select Other actions.
    • Select Perform action, and from the list, select the homeassistant.update_entity action.
    • Choose your targets by selecting the Choose area, Choose device, Choose entity, or Choose label buttons. Update entity
  4. Save your new automation to poll for data.

The default pollingData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] interval is 30 seconds.

Removing the integration

This integration follows standard integration removal. No extra steps are required.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three dots menu. Then, select Delete.