Thank you Anand, this is so cool!! A few days ago my daughter asked me to provide this kind of app to her.
About installation. I had difficulties getting the custom_components to show up in Integrations. Changed the execute permission by chmod 755 *.py
in the installation folder. Donāt know if that was necessary. Finally it showed up after reboot of whole server, not just restart of service.
What I would like to have is show the two next ARRIVAL TIMEs for a particular ROUTE (bus) on a particular STOP CODE. I managed easily to show next bus, but how to add a second, like if I miss this one how long do I have to wait?
The route schedule is visible if you click for more info, but I have not figured our the right attribute code.
Another thing, would it be possible to calculate remaining time to arrival on a STOP somehow using e.g. now()?
And Thank You again for your awesome contribution!
One reason why the custom_components did not show up in Integrations could be the browser cache. But good that you got it working now.
The attributes contain all future arrival times for the day. I will try to build a template to extract next two routes as sensors and see if it works.
For the āremaining timeā as well, I think template sensor could work, although comparing times via template has not been easy for me. Will give it a shot and see if I can get something working.
The time_remaining sensor seems to drop the padding zeroes making single digit time a bit difficult to read. In a perfect world it would not show hours (if zero), pad the minutes and update every second. Probably that is not sensible due to the way the app refreshes itself every 10 seconds or so.
I edited your time_remaining so that it shows only minutes until next bus. unit_of_measurement: 'min' ... {{ (td.seconds/60) | round(0) }}
However, this probably doesnāt work if the next bus arrives in over an hour.
I am very thankful for your support. Great work and very useful Custom Component.
Really nice! Do you have any idea how i can make something like a picture? I can get next arrival times, but how i get next bus route (and next after tharā¦ after thatā¦).
@Revolver: Can you check the latest release. I have updated it with UI-Option-4 that has a table with the list of scheduled lines on the route. Hope this helps!
Good job! I tried the UI-Option-4 and found that not all buses were visible. Looks like at least two buses are missing. I also noticed that those buses that run the next day side donāt show up (like buses running immediately after midnight). But like i said, good job. This is awesome!
Thanks!! Issue with the missing buses is weird. I need to check that.
I have limited the number of buses to a single day in the integration. So buses past midnight will only show up after 00:00. Maybe I can remove that restriction as well. Will get back.
I encountered some problem with the option 4 arrivals: For some reasons the card does not show the upcoming lines correctly.
The first upcoming train in the table is not actually the next one arriving in the schedule. It is always third one (2 trains before).
Also as you can see I cannot get always the route neither destination to the table.
I used exactly the same configurations as in the example, but of course my stop is H0082 (Pohjois-Haaga train station). Not sure where is the problem, I can get all the schedules to be shown in the option 2 card type. Any ideas what I should try next?
Also I am not sure if the API provides the rail info for the trains?
And I have also setup an automation to track āUnavailableā. Lets see how it pans out. You could also maybe double check there are no syntax issues with the template you are using?