I don’t have the skills to do so, but integrating Paris public transport into our components would be amazing. The transport operator, RATP has an API that details all the states of the lines (metro, RER, tram and bus), as well as the next arrivals at each stop in each direction.
As you can imagine, a lot of the existing efforts are in French. Regardless, here are a few things I found that could help:
Good idea. I have no time currently as I’m focused on weather alerts from météo France component.
Perhaps after but I’m not in Paris anymore since decades. Can you perhaps share some use cases ? What type of information available in the API could be usefull for frontend display or for automation ?
It’s not so complicated if a pyton package already exist. Go to home-assistant source, find a simple componet like weather component or waze, you can reverse engineer easily.
During the morning routine, let a user know of any travel alerts on lines they use. If delays are expected, follow up with a Google Maps call to give the user a better/faster travel itinerary.
If traffic is normal, you could have a system where you say “leave in the next 5min in order to catch train x”.
After some researches I have found that city mapper’s API is better than RATP, because you can use directly the Latitude/longitude location rather than using the name of the station.
Citymapper is an app for public transport in multiple cities and it would be worth adding it to Home assistant.
I’m guessing many have solved this problem already, but just in case, I thought I’d chime in. I’ve used the REST API linked just above and since I couldn’t find any way to nicely display the “schedules” attribute that the REST sensor contained, I built a very simple Lovelace card that does just that. If anyone’s interested, I guess I could try to make it proper enough to publish it in HACS and improve it with the suggestions you might all have.
I’ve actually built a Lovelace card to display the next passages of whatever transport system vianavigo can deal with. It’s displayed in a way that’s supposed to mimic how the RATP does it, but it’s far from perfect (pretty broken on mobile, pretty ugly on “night” themes, etc.).
It’s not based on Pierre Grimaud’s API, because it was broken when I began working on it and because it’s limited compared to what vianavigo.com can do. So it uses the vianavigo “API” (it makes the same REST API calls as the vianavigo website).
What’s the catch ?
Well at the moment setting it up requires getting your line and station identifier by browsing the vianavigo website with developer tools open, which kinda sucks. I want to use the visual editor to allow anyone to easily select line and station from readable menus, but my understanding of polymer and the web components used in HA is too limited for me to work it out. And my real work has gotten a bit too hectic to allow me to spend time on this for a few months now, so I thought I’d let you guys have a look at it. If someone with web experience happens to read this and wishes to “tutor” me, I’ll happily get back to coding as soon as I can. But at the moment, I feel I can’t do much more by myself.
The code is here for anyone willing to have a look:
I’ve tryed to use your work but as a new HA user I might have done it in the wrong way
Installation :
I have downloaded the package “idfm-card-master” and installed in “\local.ip\config\www\community”
I haded the module in Configuration>LovelaceUI>Ressources ==> My first question here : I couldn’t find a “idfm-card.js” so I puted “rollup.config.js” as root but I wasn’t really convinced about it. Was it the good file ?
But as a result I have “Custom element doesn’t exist: idfm-card.” my guess is that the installation part didn’t went so well.
My second question is where can I find the dictionnary of all lines/stations ? I went here and here but i couldn’t find the right information (so I puted the parameters i found in the api exemple)
I’ll keep working on it but if you can help me that would be nice.
Wow, I’m sorry you had to go through all this just to try it. I just updated the README to add an installation section for the souls brave enough to try and use this horrid piece of code
This got me to see that Ile de France Mobilités actually scrapped the vianavigo website, which is not newsworthy in itself, but that the new website actually has everything needed to configure the card in its URLs, which gave me an idea to make this whole deal simpler within the configuration card. So for those that get sick just reading the readme, I might make time in the coming weeks/months to update the card with a simpler config flow. We’ll see
Oh, and to answer your dictionary question, I have no clue ! I kinda lost hope of finding something with all line IDs and associated stop_area IDs, which would make the config flow way more user-friendly