Vehicle-level occupancy is different to per-carriage occupancy

Hi - this is going to be super-difficult to catch as it’s intermittent, but I’ve found some /trip API and GTFS returns that conflict. By that I mean that the general occupancy level returned by the /trip API says, for example, STANDING_ONLY but the per-carriage information returned by the GTFS feed has each one as MANY_SEATS_AVAILABLE.

FWIW here’s a current RealtimeTripId for one of the journeys that sometimes shows this, although as I said it’s intermittent. I’ve only seen it happen for journeys where the departure time at the origin is a reasonable amount of time in the future. As the departure time gets closer the API starts to return accurate vehicle-level data. The GTFS per-carriage data always appears to be accurate:

  • RealtimeTripId: W758.1380.131.64.D.6.90011819
  • gtfsTripid: 3001.nsw-2-BMT.1.TA.477.s

At the time of posting this, the train was due to depart from Blaxland Platform 1 in 32 minutes :slight_smile: I’ve attached the raw API and GTFS returns for reference. Here’s the GTFS extract, and the general occupancy_status there is also showing what I assume is the incorrect STANDING_ROOM_ONLY value:

id: "27"
vehicle {
trip {
trip_id: "W758.1380.131.64.D.6.90011819"
schedule_relationship: SCHEDULED
route_id: "BMT_2"
}
position {
latitude: -33.7237
longitude: 150.454163
}
timestamp: 1781847357
congestion_level: UNKNOWN_CONGESTION_LEVEL
stop_id: "Mountains.Hazelbrook 1 Loc"
vehicle {
id: "5974.2274.7265.7680.8760.7987"
label: "14:21 Lithgow Station to Central Station "
[transit_realtime.tfnsw_vehicle_descriptor] {
vehicle_model: "D"
}
}
occupancy_status: STANDING_ROOM_ONLY
[transit_realtime.consist] {
position_in_consist: 1
occupancy_status: MANY_SEATS_AVAILABLE
}
[transit_realtime.consist] {
position_in_consist: 2
occupancy_status: MANY_SEATS_AVAILABLE
}
[transit_realtime.consist] {
position_in_consist: 3
occupancy_status: MANY_SEATS_AVAILABLE
}
[transit_realtime.consist] {
position_in_consist: 4
occupancy_status: MANY_SEATS_AVAILABLE
}
[transit_realtime.consist] {
position_in_consist: 5
occupancy_status: MANY_SEATS_AVAILABLE
}
[transit_realtime.consist] {
position_in_consist: 6
occupancy_status: MANY_SEATS_AVAILABLE
}
}

raw_api_return.zip (22.3 KB)

raw_gtfs_return.zip (642 Bytes)

It’s making my Home Assistant integration look bad, or at least inconsistent!

image