Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nextbus #8661

Merged
merged 7 commits into from May 8, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 56 additions & 0 deletions source/_components/sensor.nextbus.markdown
@@ -0,0 +1,56 @@
---
layout: page
title: "Public Transit (Nextbus)"
description: "Instructions on how to use public transit data from Nextbus in Home Assistant."
date: 2019-02-20 00:00
sidebar: true
comments: false
sharing: true
footer: true
logo: train.png
ha_category: Transport
ViViDboarder marked this conversation as resolved.
Show resolved Hide resolved
ha_iot_class: "Local Polling"
ha_release: "0.89"
---

The `nextbus` sensor will give you the next departure time and associated data from your public transit station/stop. The data comes from [NextBus](https://www.nextbus.com), which provides real time transit data for a number of transit authorities.

It is possible to get the tag information from the NextBus website.

1. Visit https://www.nextbus.com/
2. Use the drop downs to select the transit system, route, direction, and stop
3. Extract the tags from the URL. It is constructed with the following pattern:

https://www.nextbus.com/#!/<agency>/<route>/<direction>/<stop>

If tags are incorrect, valid ones will be displayed in the logs as a
convenience.

```yaml
# Example configuration.yaml entry
sensor:
- platform: nextbus
agency: AGENCY_TAG
route: ROUTE_TAG
stop: STOP_TAG
```

{% configuration %}
agency:
description: The agency tag from NextBus.
required: true
type: string
route:
description: The route tag from NextBus.
required: true
type: string
stop:
description: The stop tag from NextBus.
required: true
type: integer
name:
description: Name to use in the frontend.
required: false
default: <Agency> - <Route>
type: string
{% endconfiguration %}