wtadler/HomeAssistant-WMATA
Integration to connect with the WMATA API to report upcoming trains and buses at local stops.
HomeAssistant-WMATA
February 2026 note: This is a fork of @benlikethecolor's original repository, which has not been updated since summer 2025. This fork continues maintenance and resolves several open issues from the original project.
Integration to connect with the WMATA API to report upcoming trains/buses at local stops.
Features
- Real-time arrival information for Metro trains and buses
- Multiple station/stop support
- Easy integration with Home Assistant dashboards
- Support for popular card types (Tile, Bubble Card, Mushroom)
Installation
To install this integration, you will need to have HACS installed. If you do not have HACS installed, download it by following the instructions here.
After HACS is installed, you should be able to click this button to install this integration:
If the above doesn't work, here's the manual installation steps:
- Open HACS in Home Assistant
- Select the three dots in the upper right, and select "Custom repositories"
- In the popup, enter the URL of this page in the "Repository" spot, select the type as "Integration", and select "Add"
- Within HACS, search for WMATA
- Click the WMATA entry, and select "Download"
- Now, setup the integration by going to "Settings" > "Devices & services"
- Select "Add integration"
- Search for "WMATA"
- Enter your WMATA API key and metro station ID/bus stop ID
- Select "Submit", and you should see the sensors appear!
Getting a WMATA API Key
To get a WMATA API key, follow these steps:
- Sign up for a new WMATA developer account here
- After your account is created, go to "Products", and select "Default Tier"
- On this page, enter the name of your new API key (ex: "Home assistant"), agree to the terms of use, and select "Subscribe"
- After your key is created, it will show you your API key, enter that in the installation steps
If you ever lose or forget your API details, you can find it on your profile under "Subscriptions".
Getting Your Metro Station ID
Unfortunately there's no good way to see a list of all of the bus station stop or metro station codes online outside of using the API. I've provided a list of the metro station codes in this file. Simply open it, find your local metro station, and add the code next to it.
IMPORTANT NOTE: if you see that your "local" metro station has two entries, make sure to pick the entry with the line you want. For example, say your local metro station is "Metro Center", and you ride the orange line. In this case, you would select the station code "C01", not "A01".
Getting Your Bus Stop ID
To get your Bus Stop ID, use WMATA's busETA website to locate your stop. The Bus Stop ID is a 7-digit code. Alternatively, the sign physically placed by your bus stop should have the ID printed on the bottom-right.
Setting Up Multiple Stations/Stops
If you want to have buses/trains for multiple stations setup, follow these steps:
- Go to "Settings" > "Integrations" > "WMATA"
- Select "Add Hub"
- Enter your API key again, along with the new station/stop ID
- Select "Submit"
After this is completed, you should see the new entities appear for the new station:
Dashboards
Tile Card
If you use tile card, here's a quick sample I've created using this integration.
type: tile
entity: sensor.wmata_g01_train_1
features_position: bottom
vertical: false
state_content:
- state
- Line
- DestinationBubble Card
If you use bubble card, here's a quick sample I've created using this integration.
type: custom:bubble-card
card_type: button
button_type: name
name: Train 1
icon: mdi:train
sub_button:
- entity: sensor.wmata_a01_train_1_destination
show_name: false
show_state: true
- entity: sensor.wmata_a01_train_1_line
show_state: true
- entity: sensor.wmata_a01_train_1_time
show_state: true
show_attribute: false
show_name: false
show_last_changed: false
show_background: true
state_background: trueMushroom Template Badge
The Mushroom package allows you to make a nice Mushroom Template badge like so:
type: custom:mushroom-template-badge
content: >-
{% set bus_times = states.sensor | selectattr('entity_id', 'search',
'wmata_STOP_ID_bus_') | map(attribute='state') | list %}
{{ bus_times | reject('equalto', 'unknown') | map('regex_replace', '^(.+)$',
'\\1m') | join(' • ') }}
icon: mdi:bus
color: green
visibility:
- condition: state
entity: sensor.wmata_STOP_ID_bus_1
state_not:
- unavailable
- unknown
label: Next buses
entity: sensor.wmata_STOP_ID_bus_1
tap_action:
action: more-infoFuture Improvements
- Change the way that this is setup so that you only need one station ID for stations with multiple codes. Just enter one or the other, have the code just search for both while you're there
- Make a better interactive way to find your bus stop ID when initializing the integration
@wtadler thanks
- @benlikethecolor for being the original author of this repo!
@benlikethecolor thanks
-
WMATA for providing this API
-
@walrus416 for making a similar integration as a starting point
-
@msp1974 for providing helpful integration examples




