deg0nz / MMM-PublicTransportBerlin

MagicMirror module to display public transport in Berlin and Brandenburg with BVG Hafas data.
MIT License
40 stars 20 forks source link

directionStationId not working #39

Closed ferby09 closed 6 years ago

ferby09 commented 6 years ago

First of all thank you again for your hard work in cooperation with @derhuerst and making this module usable again. Unfortunately I can't get the directionStationId to work like it did with vbb-rest. The IDs are the same with bvg-rest, but it isn't working as I can still see the lines in the other direction. Is this an issue in bvg-rest?

deg0nz commented 6 years ago

AFAIK the directionStationId option had a bug/was not working some time ago... I think it was an issue on the HAFAS-side, but I'm not so sure. I don't know if this is fixed yet. Maybe you could dig into vbb-client or hafas-client issues and look for it. I remember I saw an issue about that somewhere there.

ferby09 commented 6 years ago

Thank you for your quick response, I'll have a look. But I can't remember having issues with it when you were still using the vbb-client.

derhuerst commented 6 years ago

vbb-client doesn't work right now, because 2.vbb.transport.rest is offline.

I have set up 1.bvg.transport.rest though, which has a very similar return format. From what I can tell, the direction parameter works there:

https://1.bvg.transport.rest/stations/900000013102/departures?direction=900000014101&duration=1
deg0nz commented 6 years ago

Alright, then I‘ll try to find time this weekend to look into it.

Von meinem Mobiltelefon gesendet. B.

On 14. Sep 2018, at 12:22, Jannis Redmann notifications@github.com wrote:

vbb-client doesn't work right now, because 2.vbb.transport.rest is offline.

I have set up 1.bvg.transport.rest though, which has a very similar return format. From what I can tell, the direction parameter works there:

https://1.bvg.transport.rest/stations/900000013102/departures?direction=900000014101&duration=1 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

deg0nz commented 6 years ago

Commit 6319c4508772898aac072bb8da807aef0a535000 should fix this issue. The code used the old nextStation parameter which was changed to direction I think.

@ferby09 Could you please check if this works for you and close the issue afterwards?

deg0nz commented 6 years ago

As I'm playing around a little bit... nextStation still gives answers.. and the amount of returned station differs from direction.

@derhuerst: What is the difference between these two?

derhuerst commented 6 years ago

It's an obscure technical one: direction uses a HAFAS parameter and therefore returns whatever HAFAS understands by "in direction"; nextStation uses hafas-departures-in-direction, which queries enough departures and then filters those that actually pass by the stop/station.

I don't know exactly which is the better one. I have also forgotten wether all HAFAS endpoints support the direction parameter (then nextStation should be used), but BVG does AFAIR.

So please play with direction, using a few edge cases:

deg0nz commented 6 years ago

@ferby09 Any updates?

ferby09 commented 6 years ago

I'm sorry for my late reply but I was kind of busy because my Magic Mirror's power supply was malfunctioning so I couldn't test it until now. It works perfectly fine now, thank you very much!

derhuerst commented 6 years ago

Please document your findings here!