EDIT: is there any way to add a timer for all the buses from that particular stop? ie the 63 final destination is King’s Cross and the 363 is usually Elephant & Castle.
How can I list the buses departing from my stop 490007032N in one card? Apologies if that’s been covered already
You can have more than one sensor, each checking different destinations.
But as the current way the component is written you can only check a bus/train going leaving a stop to a single destination. I wish it could check all buses/trains leaving a stop/station regardless of destination.
I only seem to get one bus per card - should it be showing more than that?
Any tips for finding the correct destination of a bus via /uk/train/station/{station_code}/live.json
The 63 always terminates at King’s Cross but the 363 which also runs from the same stop has varying destinations. I’ve not been able to get the timer working. Origin: 490007032N
Also - what’s the best way to display a time table of buses from an origin in a HA card
Has anybody found a good source to pickup the info on how long a train should take to the destination? While in theory this info should be in the api it does not appear to be imstatiatef in the upstream python library. So looking to use another source to add this info…
I moved my home assistant from a pi to ubuntu and now all my buses are over an hour away, somewhere 60 mins is being added to the departures but I have changed no settings from those I had before. The time on the ubuntu machine is correct so I cannot see why this is happening.
Is there a way to create an automation based on the status of a specific train time in either YAML or NodeRed? Seems like it should be possible to find a specific time within the JSON object and its associated status.
Figured this out. Created a template sensor to base my automation on:
- platform: template
sensors:
ben_morning_train:
friendly_name: 'Morning Train'
value_template: '{% for x in range(5) %}
{% if states.sensor.next_train_to_rdg.attributes.next_trains[x].scheduled == "06:49" %}
{% set minutes_difference = (as_timestamp("1900-01-01 " + states.sensor.next_train_to_rdg.attributes.next_trains[x].estimated) - as_timestamp("1900-01-01 " + states.sensor.next_train_to_rdg.attributes.next_trains[x].scheduled)) / 60 %}
{% if (minutes_difference) >= 5 %}
Late
{% else %}
On time
{% endif %}
{% endif %}
{% endfor %}'
Looks for a specific train (the one scheduled for 6:49 in this case) and if it is 5 minutes or more late it shows ‘Late’, otherwise ‘On Time’. Plan is to create an automation to send an notification to me if the status changes to ‘Late’.
I guess this is still an issue? Using Hassio and everything is correct in my timetables, data etc. except when using the main sensor sensor.next_train_to_man which seems to add an hour on to the actual next stop.
Sorry if this got asked before (i did search), but is there anyway to schedule the component polling to maximise the 1000 API hits to active time of day?
e.g. 6am to 8pm. it would give nearly double the resolution for active working day. or twice the number of sensors.
Ah. I found the info lurking at the bottom of the component page:
Managing API requests
If you wish to manage the rate of API requests (e.g., to disable requests when you aren’t interested in travel, so that you can request updates more frequently when you do travel) set a really long scan_interval in the config options, and use the service homeassistant.update_entity to request the update of an entity, rather than waiting for the next scheduled update.
It would be helpful if this info was in the warning section at the top of the same page.