crismc / homeassistant_nationalrailtimes_integration Goto Github PK
View Code? Open in Web Editor NEWA custom Home Assistant component to show next available trains to specific stops through the National Rail Darwin SOAP API.
A custom Home Assistant component to show next available trains to specific stops through the National Rail Darwin SOAP API.
If there are no more trains today, and the next one is in the morning, the integration gives the following output:
...
destination_name: null
service: null
It would be better if the next day's trains were polled, so that it could display the time of that train.
See the below screenshot from Journey Planner. This was taken at 23:00 hours, just after the last train for the evening has left.
If it matters, I have a 15 minute offset set up.
It would be best if the integration checks for the next train time, and if none are found, checks for the earliest time the next day. There should be a 24 hour limit to ensure that the user is never given a train time that could be of an unknown day.
Alternatively, returning a list of the next n trains regardless of date would also work.
15 minute offset
arriving: Neath
destination: Cardiff Central
YAML state
- Browser: Chromium based
- HA Version: 2023.12.4
- NationalRailTimes: 1.0.3
No response
Invalid configuration error when trying to configure via yaml.
Invalid config for [sensor.nationalrailtimes]: [destination] is an invalid option for [sensor.nationalrailtimes]. Check: sensor.nationalrailtimes->destination. (See ?, line ?).
Configuration pass
Try to add the following to your configuration.yaml:
No response
No response
Is it possible that this is caused by PLATFORM_SCHEMA (in sensor.py) not including destination?
Some station messages are reported as:
The Ticket Office is currently closed at XYZ station.
and
should not be displayed.You just need a station that has ticket office closed message.
No response
- Browser:
- HA Version:
- NationalRailTimes:
I have modified my local copy of def extra_state_attributes(self)
adding the followings before return:
pattern1 = re.compile(r'</p>')
attributes["message"] = [pattern1.sub('', sub) for sub in attributes["message"]]
pattern2 = re.compile(r'<p>')
attributes["message"] = [pattern2.sub('', sub) for sub in attributes["message"]]
It works, would be good to add something similar in your implementation.
No
To get information about the next few trains and not just 1 (next) departure. It would be great to be able to create a timetable card with:
Destination name
Scheduled arrival time
"on-time" status
Estiamted arrival time
I see a single destination per card as the best idea, but multiple destinations in one timetable could also be helpful
No response
No response
When selecting a station with only a single calling point (the destination), the lovelace card fails.
I currently believe this is because the calling points are not a list when only one item (probably an XML parsing problem).
Single calling point journeys should work
nationalrail-times-card
card in lovelaceYAML state
- Browser: Chrome
- HA Version: 2023.10.5
- NationalRailTimes: 1.0.2
Comparing the calling points from WSU to SUO (single calling point):
Calling points
locationName: Sutton (London)
crs: SUO
st: '22:14'
et: '22:18'
Versus the calling points from SUO to LBG (multiple calling points):
Calling points
- locationName: Carshalton Beeches
crs: CSB
st: '21:59'
et: On time
length: '5'
- locationName: Wallington
crs: WLT
st: '22:01'
et: On time
length: '5'
- locationName: Waddon
crs: WDO
st: '22:05'
et: On time
length: '5'
- locationName: West Croydon
crs: WCY
st: '22:09'
et: On time
length: '5'
- locationName: Norwood Junction
crs: NWD
st: '22:15'
et: On time
length: '5'
- locationName: London Bridge
crs: LBG
st: '22:28'
et: On time
length: '5'
You can see the latter is a list, whereas the former is not.
I'm planning to take a look to see if I can provide a patch for this as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.