niklaskappler/MMM-vvsDeparture

Needs option for offset

akraus53 opened this issue · 4 comments

I live close to Bihlplatz and there's a lot of vvs-traffic. It takes me 5mins to put on my shoes and walk to the platform, so if I look at my mirror at 12:00, the earliest U-Bahn that makes sense for me is at 12:05. For high-traffic stations, there's more connections between 12:00 and 12:05 than I'm showing on my mirror so I have to use the VVS App anyway.

Yes, I know there's the option to exclude uninteresting connections but it would still be a nice feature. If I find the time before you do, I'll try and implement this myself and make a pull request.

Danke und bis bald

Hi akraus53,
thx for the suggestion. I'm fine with adding a new config to address an offset to the current departure time.
I just checked the API of VVS and there is the itdTime and itdDate parameter we could add to the request fetching data. So far I couldn't find out if, by adding those parameters, also the delayed departures are included. Would need some more investigation.
In addition to only show the in future scheduled departures I think we should also note the time or the offset somewhere in the UI, so that not only the owner of the magic mirror knows of this offset. What do you think?
Unfortunately I'm quite busy these day, so feel free to send a PR. 👍🏻

Sounds great! I'm buzy at the moment, too, but I'll look into it when I find the time.

My approach would have simply been

if(departure_time - current_time > offset){
  // Don't show this connection
}

... but using the proper way with the API makes sense, esp. when people have a long walk to a busy station.

Showing it in the UI is a must, I suggest changing the text at the top to "Departures at {XY} Station in {Delay}mins" (Only if Delay!=0), I think thats clear enough and also easy to implement - I'd assume.

I couldn't find the doc to the vvs api, could you send me a link?

Your idea by putting it to the top sound great.

Unfortunately there is no (publicly) available documentation about the vvs api. It is, since years planned that they will release shortly a documentation on their OpenData portal (https://www.openvvs.de/pages/api). To get the necessary information I reverse engineered the api.

hggh commented

I have added a parameter offset to the configuration:

#11