TransportNSW compnent - route - destination as a configurable attribute?

Anyone using the Transport NSW sensor component?

I’ve been configuring up this new component, and i have hit a bit of a snag, which maybe only applicable in my particular circumstance.

I note there are 4 configurable values.

stop_id & route (which are relevant in this case) and api_key and name

The problem I face is with the way the ferries work here on Sydney Harbour. The route always remains the same and the stop id is always the same regardless of which direction the ferry is heading.

So i can’t just display ferries heading to circular quay, and i won’t know which direction the ferry is heading.

If i put in a stop_id: 10102008 for Balmain Wharf

This all works fine, and lets me know how many minutes prior to the ferry arriving.
Unfortunately, unlike the train platforms that have stop_id: that only travels in one direction, the stop_id: 10102008 travels in 2 different directions. For example, towards the city and away from the city.
So i don’t seem to have a way to define or filter which direction the countdown timer is referring to.

if i define a route as ‘F8 Cockatoo Island’ thats fine, but that covers ferries heading in both directions

so i went to the nsw transport api site
https://opendata.transport.nsw.gov.au/node/601/exploreapi#!/default/tfnsw_dm_request

and put the stop_id: 10102008 in, and the returns do actually give me a little more data than i am able to define in my sensor

So some values i have that i can see that are unique, but not configurable are as follows
for example
destination": “name”: “Circular Quay”,
or
description “Circular quay to Cockatoo Island”

seem to be unique and would indicate the direction of travel, even though the stop id and route are the same for both returns

Perhaps a solution could lie in having a configurable value of “destination” that could be integrated into the sensor for transport_nsw ?

Or could someone think of another way to achieve what i’m after?

transport api response paste as below against stop_id: 10102008 showing 2 trips, returning same stop_id and same route, but heading in different directions

{
“version”: “10.2.1.42”,
“systemMessages”: [],
“locations”: [
{
“id”: “10102008”,
“name”: “Balmain Wharf, Balmain”,
“disassembledName”: “Balmain Wharf”,
“coord”: [
-33.85475,
151.18611
],
“type”: “stop”,
“matchQuality”: 100000,
“isBest”: false,
“parent”: {
“id”: “95333002|1”,
“name”: “Balmain”,
“type”: “locality”
},
“assignedStops”: [
{
“id”: “10102008”,
“name”: “Balmain Wharf”,
“type”: “stop”,
“coord”: [
-33.85475,
151.18611
],
“parent”: {
“name”: “Balmain”,
“type”: “locality”
},
“modes”: [
9
],
“connectingMode”: 100
}
]
}
],
“stopEvents”: [
{
“location”: {
“id”: “20413”,
“isGlobalId”: true,
“name”: “Balmain, Balmain Wharf”,
“type”: “platform”,
“coord”: [
-33.85456,
151.18627
],
“parent”: {
“id”: “10102008”,
“name”: “Balmain, Balmain Wharf”,
“disassembledName”: “Balmain Wharf”,
“type”: “stop”,
“parent”: {
“id”: “95333002|1”,
“name”: “Balmain”,
“type”: “locality”
}
}
},
“departureTimePlanned”: “2018-10-27T01:36:00Z”,
“transportation”: {
“id”: “nsw:090F8: :R:sj2”,
“name”: “Sydney Ferries Netwo F8 Cockatoo Island”,
“disassembledName”: “F8”,
“number”: “F8 Cockatoo Island”,
“iconId”: 10,
“description”: “Cockatoo Island to Circular Quay”,
“product”: {
“class”: 9,
“name”: “Sydney Ferries Netwo”,
“iconId”: 9
},
“operator”: {
“id”: “112”,
“name”: “Sydney Ferries”
},
“destination”: {
“name”: “Circular Quay”,
“type”: “stop”
},
“properties”: {
“tripCode”: 57,
“mtSubcode”: “0”
},
“origin”: {
“name”: “Cockatoo Island Wharf”,
“type”: “stop”
}
},
“hints”: [
{
“content”: “At low tide ramp gradients increase. Wheelchair assistance may be required.”
}
],
“properties”: {
“WheelchairAccess”: “true”,
“RealtimeTripId”: “nsw-9-F8- -sj2-3-16-AB53”,
“PlanLowFloorVehicle”: “1”,
“PlanWheelChairAccess”: “1”
}
},
{
“location”: {
“id”: “20413”,
“isGlobalId”: true,
“name”: “Balmain, Balmain Wharf”,
“type”: “platform”,
“coord”: [
-33.85456,
151.18627
],
“parent”: {
“id”: “10102008”,
“name”: “Balmain, Balmain Wharf”,
“disassembledName”: “Balmain Wharf”,
“type”: “stop”,
“parent”: {
“id”: “95333002|1”,
“name”: “Balmain”,
“type”: “locality”
}
}
},
“departureTimePlanned”: “2018-10-27T01:57:00Z”,
“transportation”: {
“id”: “nsw:090F8: :H:sj2”,
“name”: “Sydney Ferries Netwo F8 Cockatoo Island”,
“disassembledName”: “F8”,
“number”: “F8 Cockatoo Island”,
“iconId”: 10,
“description”: “Circular Quay to Cockatoo Island”,
“product”: {
“class”: 9,
“name”: “Sydney Ferries Netwo”,
“iconId”: 9
},
“operator”: {
“id”: “112”,
“name”: “Sydney Ferries”
},
“destination”: {
“name”: “Cockatoo Island”,
“type”: “stop”
},
“properties”: {
“tripCode”: 10,
“mtSubcode”: “0”
},
“origin”: {
“name”: “Circular Quay”,
“type”: “stop”
}
},
“hints”: [
{
“content”: “At low tide ramp gradients increase. Wheelchair assistance may be required.”
}
],
“properties”: {
“WheelchairAccess”: “true”,
“RealtimeTripId”: “nsw-9-F8-
-sj2-3-10-AA51”,
“PlanLowFloorVehicle”: “1”,
“PlanWheelChairAccess”: “1”
}
},

I have a similar issue… Trains from Central to Gosford can start from a different platform. Even worse, in Gosford on a given platform a train can go either north or south. The same bus stop in Gosford can service multiple routes. Seems to me a route specifying start and end would be more useful than a stop ID.

@DavidFW1960

i reckon this should be doable, providing the transport_nsw .py hassio component is updated with some additional parameters

If i goto the transport nsw api site and use the link thats being referenced in the py

https://api.transport.nsw.gov.au/v1/tp/departure_mon?outputFormat=rapidJSON&coordOutputFormat=EPSG%3A4326&mode=direct&type_dm=stop&name_dm=10102008&itdDate=20181028&itdTime=1200&departureMonitorMacro=true&TfNSWDM=true&version=10.2.1.42

i get back the following response when i put in my stop_id of 10102008 with todays date

note the response includes an origin, a destination and a description - which could be used for our issue if configurable as follows

'description": “Cockatoo Island to Circular Quay”
“destination”: {
“name”: “Circular Quay”
“origin”: {
“name”: “Cockatoo Island Wharf”

complete response below

----snip----

{
“version”: “10.2.1.42”,
“systemMessages”: [],
“locations”: [
{
“id”: “10102008”,
“name”: “Balmain Wharf, Balmain”,
“disassembledName”: “Balmain Wharf”,
“coord”: [
-33.85475,
151.18611
],
“type”: “stop”,
“matchQuality”: 100000,
“isBest”: false,
“parent”: {
“id”: “95333002|1”,
“name”: “Balmain”,
“type”: “locality”
},
“assignedStops”: [
{
“id”: “10102008”,
“name”: “Balmain Wharf”,
“type”: “stop”,
“coord”: [
-33.85475,
151.18611
],
“parent”: {
“name”: “Balmain”,
“type”: “locality”
},
“modes”: [
9
],
“connectingMode”: 100
}
]
}
],
“stopEvents”: [
{
“location”: {
“id”: “20413”,
“isGlobalId”: true,
“name”: “Balmain, Balmain Wharf”,
“type”: “platform”,
“coord”: [
-33.85456,
151.18627
],
“parent”: {
“id”: “10102008”,
“name”: “Balmain, Balmain Wharf”,
“disassembledName”: “Balmain Wharf”,
“type”: “stop”,
“parent”: {
“id”: “95333002|1”,
“name”: “Balmain”,
“type”: “locality”
}
}
},
“departureTimePlanned”: “2018-10-28T01:36:00Z”,
“transportation”: {
“id”: “nsw:090F8: :R:sj2”,
“name”: “Sydney Ferries Netwo F8 Cockatoo Island”,
“disassembledName”: “F8”,
“number”: “F8 Cockatoo Island”,
“iconId”: 10,
“description”: “Cockatoo Island to Circular Quay”,
“product”: {
“class”: 9,
“name”: “Sydney Ferries Netwo”,
“iconId”: 9
},
“operator”: {
“id”: “112”,
“name”: “Sydney Ferries”
},
“destination”: {
“name”: “Circular Quay”,
“type”: “stop”
},
“properties”: {
“tripCode”: 57,
“mtSubcode”: “0”
},
“origin”: {
“name”: “Cockatoo Island Wharf”,
“type”: “stop”
}
},
“hints”: [
{

@davidfw1960

Looks like a solution for configurable destination is coming in a future release

Good news!