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 turn off the default polling and create your own polling automation, follow these steps:

  1. Go to Settings > Devices & services, and select your integration.
  2. On the integration entry, select the three dots menu, and then select System options.
  3. Turn off Enable polling for changes, and then select Update.
    • If Home Assistant asks you to restart, restart it.
  4. Go to Settings > Automations & scenes, and select Create automation > Create new automation.
  5. Add the triggers and conditions for when you want to poll for data.
  6. Select Add action, select By type, select Perform action, and then select + next to Perform action.
  7. Under Action, search for and select the Update entity action.
  8. Under Entities to update, select the entities you want to poll.
    • You can only select entities. Areas, devices, and labels aren’t supported.
  9. Select Save.

Many integrations update their data at most once every 10 seconds. If you poll more often, Home Assistant waits until the 10 seconds have passed before it updates the data again.

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. Next to the entry you want to remove, select the three dots menu. Then, select Delete.
    • Depending on the integration, the entries are listed under one of the following headings:
      • Devices
      • Hubs
      • Services
      • Integration entries
  3. To confirm, select Delete.
    • Home Assistant also deletes the devices and entities of the entry.
  4. If Home Assistant asks you to restart, restart Home Assistant.
  5. If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.