I made my first card this week using the NS (Nederlandse Spoorwegen) API sensor, doc found here:
You can see what it looks like. When delayed it will add ‘+3’ in red after the time. Platform and delay will automatically update. Might still need some minor improvements.
Hey there, I think @firstchair was asking if you could share the content of your “ns-status-card.js” file, so we also can try it. I will appreciate it as well.
The card is great, but I just tried the NS integration to get the next train. But updates are so slow I mostly get the previous train. What do you use for settings to get meaningful results? Always one with a set time? Because that is not that useful for school when the first class is different all the time.
Nope, sorry. Didn’t have time to pursue this further. Looked a bit at the code though. The API seems suitable to use only few updates and still be able to have future trains as well by asking more alternatives at the same time. But it will require some programming to show the right one at the right time. I’m not in a position to do so.
I just want to try to add NS integration. But my log says:
Logger: homeassistant.components.nederlandse_spoorwegen.sensor
Source: components/nederlandse_spoorwegen/sensor.py:72
integration: Nederlandse Spoorwegen (NS) (documentation, issues)
First occurred: 11:00:25 (1 occurrences)
Last logged: 11:00:25
Could not fetch stations, please check configuration: The request could not be handled by the API
I suppose this integration is up to date and working for all of you (although I see only 2 active installations are using it).
I have tried my own preferences with train stations. But the code of the station is not correct according to log. When trying the standard sample, it doesn’t work either:
# Example configuration.yaml entry
sensor:
- platform: nederlandse_spoorwegen
api_key: NS_API_KEY
routes:
- name: Rotterdam-Amsterdam
from: Rtd
to: Asd
- name: Groningen-Zwolle-Maastricht
from: Gn
to: Mt
via: Zl
- name: "AlmereBuiten-Duivendrecht-the-08h06m-train"
from: Almb
to: Dvd
time: "08:06:00"