I decided to use the core component Nederlandse Spoorwegen to retrieve time table information, but I simply can’t get it to work.
According to the component page above it was introduced in release 0.57 which was a while ago. This thread from April this year mentions that the NS API was going to change. I think it did between then and my time of writing. I’m not sure whether the documentation is still up-to-date however.
Two years ago someone asked for this specific component in this Feature Request thread. @b10m created the initial component back then and the YAML configuration hasn’t changed since that time:
sensor:
- platform: nederlandse_spoorwegen
email: <YOUR EMAIL ADDRESS>
password: <API PASSWORD>
departures:
- name: Some Name
from: <STATION>
to: <STATION>
He mentioned that you would need to create an account on this page, which is nowadays a page referring you to this page (I’m guessing the new API documentation). The actual Home Assistant component documentation refers you to the latter by redirecting you with this URL.
The configuration and the documentation mention you need a password
, an API password
. Where do I get this? When creating an account following one of the above links I create a password myself. I’m guessing this isn’t it, but I did try to use that one.
On the NS website I need to subscribe to certain API’s e.g. this one. When doing so I get an API key specifically for that API, but to which API do I need to subscribe?
When using the component I get the following error:
ERROR (SyncWorker_19) [homeassistant.components.nederlandse_spoorwegen.sensor] Couldn't fetch stations, API password correct?: 400 Client Error: Bad Request for url: http://webservices.ns.nl/ns-api-stations-v2
This API isn’t mentioned anywhere on the NS website. So, are there any users out there using this component succesfully? If so, where do I get the correct API key? Am I missing something?