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
- Subway tracking: No API key is required.
-
Bus tracking: An MTA Bus Time API key
is required.
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.
-
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.
Adding a subway stop
To add a subway arrival sensor:
- Go to Settings > Devices & services and select the MTA New York City Transit integration.
- Select Add subway stop.
- Select the subway line you want to monitor from the dropdown.
- Select the stop and direction (indicated by N/S suffix for northbound/southbound).
Adding a bus stop
To add a bus arrival sensor:
- Go to Settings > Devices & services and select the MTA New York City Transit integration.
- Select Add bus stop.
- Enter the bus route (for example,
M15,B46,Q10). - Select the stop from the list. Direction information is included with each stop.
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:
- Go to Settings > Devices & services, and select your integration.
- On the integration entry, select the
. - Then, select System options and toggle the button to disable polling.
- Then, select System options and toggle the button to disable polling.
- 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_entityaction. - Choose your targets by selecting the Choose area, Choose device, Choose entity, or Choose label buttons.
- 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
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.