Probably not hard to find an example (as there are always bus replacement services!) but, do you have an example?
I found another bug today which I need to fix - on weekends my trains have a different destination and the API returns nothing. I need to work out how to fix this.
So that is the same “problem” I am seeing today.
The response is saying that there are no trains departing from your station - this is correct. There is a BRS.
I’d like to obtain the Origin station and display that information. Depending on what station the train comes from depends on how busy it will by the time it’s reached my station. So I can judge whether or not to get the next train.
My coding abilities are quite limited and have attempted to update your code but not getting the results, so clearly I’m doing something wrong.
Brilliant widget, many thanks as this is really making HabPanel uselful! I have a small problem; my trains are on a loop, so putting in the departure station (BFD) and the destination station (WAT) shows both those that go clockwise and those which run anti-clockwise. All the ones I need depart from Platform 1 at BFD; how can I filter the results to only show this? Any help much appreciated
I’ll be a bit of a change to do that as the API is different. I’ll try muck about with it over the weekend as I want to make some other changes to it as well.
[ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule 'Transport.GetTrainTimes': cannot invoke method public org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.items.GenericItem.getState() on null
Any ideas on what’s causing this and what I can change to resolve it? I’ve getting the train data but it would be nice to clean up this error from my logs.
Does this code still work? I have followed the instructions but I get null values in my logs and when i save the rules file i get the following errors in the logs:
Function2 is a raw type. References to generic type Function2<P1, P2, Result> should be parameterized
The method getCalendar() from the type DateTimeType is deprecated
Does it needs a new calendar type? I’m not a coder btw.
val String STA_ORIGIN = “PAD” //this is your station
val String STA_DEST = “STD” //this is the destination of the train
val String xAPI_KEY = “xxxxxxxxxxxxxxxxxxxxxxxxxx” //this is your API key
val String xAPP_ID = “xxxxxxxxxxx” //this is your appID.