Skip to content

2c. Acquire local stops & departures

Arjan edited this page Nov 4, 2024 · 16 revisions

With an existing data source, you can opt-in for collecting the departures of stops around 'you'. The idea of the sensor is to help finding transport based on your geographical position. The default radius is 300m and you can configure options to reduce to 50m or raise to 5000m. For performance impact prevention, there is a limit of max 15 stop in this range, if this applies then you need to reduce the radius

Pre-requisite: a entity person.xyz or zone.xyz having positional data (latitude/longitude), which usually is acquired though a mobile phone and the HA companion app (link)

image

Select:

  • Source: the gtfs data with the stops
  • Object/Person: select from the list, it will only (!) show existing entities 'person' or 'zone'
  • Name: name of the combined set of sensors, best to combine this with the object and source, especially when you are using mutliple sources or when multiple people use the same source, e.g. Foo Nederland

Note: the sensors can only collect data from stops existing in the source. If your area is served by multiple providers, each with their own gtfs data source, then you need to add this for each one of them.

Depending on where your 'person'/'zone' is located at the time of the setup, it will show a number of stops with future departures, this could very well be 0

image

It will create sensors per stop containing the next departures, alike:

image

Local stop details explained

- departure: '08:30' >> scheduled departure time in local stop timezone
  departure_datetime: '2024-11-04T07:30:00+00:00' >> scheduled departure time in local stop timezone, as utc
  departure_realtime: '08:27' >> >> estimated departure real-time, received from the data-source/provider, in local stop timezone
  departure_realtime_datetime: '2024-11-04T07:27:46+00:00' >> estimated departure real-time, received from the data-source/provider, in local stop timezone, as utc
  delay_realtime_derived: '-0:02:14'  >> estimated delay, derived from departure time and real-time, shows '-' if 0 or non-existing real-time. Can be negative if departure is estimated before the scheduled time.
  delay_realtime: '-' >> delay, received from the data-source/provider, shows '-' if 0 or non-existing
  date: '2024-11-04' >> date related to the scheduled data
  stop_name: My City Centre >> name of the stop for which the data is shown  
  route: B >> route for which the data is shown
  route_long: My City Center - via Town XYZ - End Station >> long name of the route for which the data is shown
  headsign: End Station >> headsign of the vehicle for which the data is shown
  trip_id: '1907425342153'
  direction_id: 1
  icon: mdi:bus

You can now further configure this [(link)](https://github.com/vingerha/gtfs2/wiki/3.-Configuring-options#configuration-for-local-stop-departures)