Transport NSW / Sydney Bus, Ferry and Train schedule

Hello! incredible your project. Thanks for sharing it.

  • Do you think there is an API key for public transport timetables in Italy?
  • Can I use the same transport_nsw.py for a configuration in Italy?
    Thank’s!

@DavidFW1960 Thanks for the template, I expanded it slightly:

- platform: template
sensors:
trainmonitor_eleven:
  friendly_name_template: >-
    Platform 11 - {{ states.sensor.gosfordkariong.attributes.destination }}
  value_template: >-
    {% if is_state_attr('sensor.gosfordkariong', 'due', 'n/a') %}
      No schedule found
    {% else %}
      {% if (states.sensor.gosfordkariong.attributes.due > 60) %}
        {{ (states.sensor.gosfordkariong.attributes.due/60)|round }}hr
      {% else %}
        {{ states.sensor.gosfordkariong.attributes.due }}m (Next {{ states.sensor.gosfordkariong.attributes.next_due }}m)
      {%- endif %}
    {% endif %}
  entity_picture_template: >-
    {{ '/local/icons/' + states.sensor.gosfordkariong.attributes.line_name + '_train_img.png' }}

I’ve changed the py file slightly to get the next train as well, but will write a cleaner version to share over the next few days as I suspect there is a way we can reference the stops as follows:

{{states.sensor.gosfordkariong.attributes.next_train[0]}}'

Hello! Do you think there is even a way for Italian timetables? Could you please include them?

given this is written against an Australian state Government website, there will be only NSW transport info in this system.

You might be able to rework the python against an Italian system - should one exist?

probably exists but I’m not an expert in programming.

It does only work for NSW Australia as the underlying API only provides that data. You have to write different components for any new data source IF there is a public API available.

So, there is NO support for Italian transport and I also have no idea if it is even possible. Sorry, maybe someone comes up with a new sensor in the future.

Hi guys, this is still working?

Thanks!

Yes working fine

I was having problem but I solve it. There is a integration page on home-assistant.io if anyone else is interested!

Thanks david

I notice that the delay time can be seen on sites like AnyTrip, is it possible to retrieve the current eta as opposed to the scheduled eta?
I wish to track country trains which can be delayed significantly.

it reports due and a delay in the sensor
image
image

Thanks, I only just created this integration & the two trains I was watching today both had a delay of zero even though one was over 30 minutes late the other ontime.

However, now the delays are showing correctly for the next two trains.

Hey there, I am fairly new at this and I am having some trouble with getting this setup. I have the following configurations in my sensors file but I am being presented with n/a for all responses.

I wonder if anyone can assist with this?

- platform: transport_nsw
  name: Next train
  stop_id: "201710"
  destination: "Central Station"
  route: "Airport & South Line"
  api_key: !secret trip_planner_api

I should also note that I have tried the following configurations and neither work.

- platform: transport_nsw
  name: Next train
  stop_id: "201710"
  destination: "Central Station"
  api_key: !secret trip_planner_api

- platform: transport_nsw
  name: Next train
  stop_id: "201710"
  route: "Airport & South Line"
  api_key: !secret trip_planner_api

All three of the above return n/a

I had a similar problem. I removed the destination attribute and get no errors. I am not sure how ‘destintation’ should be setup but is needed given some trains skip stations.