Dutch Public Transport sensor (ovapi.nl)

I also create something like this with the 9292 api, the URL is hard to find but it looks like this:

https://api.9292.nl/0.1/journeys?before=0&sequence=1&byFerry={0}&bySubway={1}&byBus={2}&byTram={3}&byTrain={4}&lang=nl-NL&from={5}&dateTime={6}&searchType={7}&interchangeTime={8}&after={9}&to={10}'.format(ferry,subway,bus,tram,train,stopFrom,dateTime,searchType,interchangeTime,resultCount,stopTo)

The by variables are ‘‘true’’ or ‘‘false’’, in string form.
stopFrom = name of the stop, can be found in the 9292 url when generated on the site
dateTime = time and date in this form yyyy-mm-ddThhmm
searchType = departure or arrival
interchangeTime = “standard”
resultCount = number of results, starts from 0
stopTo = name of the stop, can be found in the 9292 url when generated on the site

The reason I used 9292 is that the openov api doesn’t have my stop in the database while 9292 does. maybe someone will find this usefull.

1 Like

Glad to see it’s working!

Paul and I were talking about this yesterday. But we first need to finish the sensor. Like yesterday I added a new feature, namely a line filter. And I’m sure some people will find a bug we missed, that we need to fix first.

Very interested in this as I would like to replace my MagicMirror with Lovelace if I possibly can, this would get me one step closer.
Have you seen this MM module that does similar? Not sure if it can maybe be some inspiration.

1 Like

Hi,

Maybe there is a option to also use 9292ov but then we should rename the sensor and create options for the different dataproviders. This does require a redesign of the sensor to keep it clean and understandable.

You can add a issue in the GitHub repro for this request though, in that case the feature request won’t be forgotten :slight_smile:

1 Like

Nice, thanks for the info. I’ve reserved some time next weekend to update the docs and I’ll have a look at this repro for possible features or other interesting bits.

It is not realy a request, but more an extra possibility for people that experiance the same problem as I had.

i have the exact same issue could you share youre sensor?

You see here all the bus lines. Search you line with the right destination like (I was searching for a Bus from Beijum):

change that to: Search for LinePublicNumber":“311” where the line number is the actual bus or tram nr.

Much easier to search this way, cause lots of places has big bus stations like zuidplein.

@IIIdefconIII

TimingPointCode is supported

yes i read that but how to put it correctly in the sensor, i have this code where only the tram works
The route_code of the tram is the actual TimePointCode

###### SENSORS -----------------------------
sensor:
  - platform: ovapi
    name: Bus_140
    stop_code: 'null'
    route_code: '31006183'

  - platform: ovapi
    name: Tram_23
    stop_code: '87'
    route_code: '31000227'

  - platform: ovapi
    name: Bus_183
    stop_code: 'null'
    route_code: '31000227'

remove the line, don’t input null;

  - platform: ovapi
    name: Bus_140
    route_code: '31006183'

i tried that but that doesnt give me the sensor in the states. maybe i need to give it a few minutes to pick up the data.

Did you restart HA?

yes i restarted it multiple times xD

Sorry my bad, it should be;

  - platform: ovapi
    name: Bus_140
    timing_point_code: <<YOUR TIMING POINT CODE>>

i tough something like that just couldn’t find the correct syntax, thanks this works perfect, could even remove it from the tram

This needs to be documented on the github page.

sensor:
  - platform: ovapi
    name: Bus_140
    timing_point_code: 'xxx'

  - platform: ovapi
    name: Tram_23
    timing_point_code: 'xxx'

  - platform: ovapi
    name: Bus_183
    timing_point_code: 'xxx'

Yes indeed! @Paul-dH promised it would be done by now :wink:

got to say, really like youre work but i wasted 3 hours to find this post and used the long example code on the github page.

same for the option timing_point_code

Think im not the only one,

Keep up the good works and many thanks for this! If you have lack of time i can give it a shot?

https://www.screencast.com/t/s0SAhYz3nk

Hi @IIIdefconIII,

Sorry for the delay on the new version of the readme, had a couple of surprises at home that needed my attention. I’m currently updating the readme so that it contains all options.

The explanation of the timing_point_code is quite small since it is a new option and I haven’t tried it yet.

If you have the chance, can you check the readme and verify that it contains all bits you were missing?? This indeed should help new users to find all possible options :slight_smile:

Thanks!

hi no sorry this card is great and that you put time and effort in it, but still a bit buggy, i added the show_future_departures: 4 and all times of all future sensors are the same somehow, please check the screenshot:

EDIT: my bad used the same timing point code and bus and tram lel, must be PEBKAC with copy pasting things.

I do think you can safely remove the sop_code and route_code from youre guide now cause its not needit anymore