-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rejseplanen stopped working in December 2024 #133420
Comments
I dug into the code just to see what is happening. The integration uses a python library that implements the actual API. There is a bug open there raised in October and zero reaction from the maintainer. An important thing is that the new 2.0 API now cost money to use if you exceed 50000 API calls per month and you have to keep the API key non public. That means the library and integration will need to implement that each user uses their own API key and that we all have to request a key. Sound like a dead project to me because this is not feasible for normal users. |
There are several HA integrations that require the user to get their own API key and the current setup of looking up address, copying coordinates etc is already a bit much for regular users. So I still think the project has a future. Unfortunately I don't have the Python or integration-making experience to contribute much to a solution myself. |
Read into it as well. 50000 calls per month should be more than enough for regular users. Wouldnt mind a registration with my own key. |
where do you register ? |
Here https://labs.rejseplanen.dk/hc/da/articles/21553113674909-Adgang-til-API-GTFS-og-stoppestedsdata I have just applied to see if they really want to start handing out 100s of API keys to private end users. It would be better if they made a limited API access with that the things you need for the HA integration. And they could throttle the access per IP address if they worry about abuse. |
I have applied too. They do have the option of selecting “free service”, so I wonder if they might be open to allowing this integration to continue without individual API keys. Still, it has to be rewritten, of course. I don’t think very many of us use it, but it provides a lot of value for my family, at least. |
I got my API key. So others can apply too. Now we just need a Python programmer to rewrite the software. I can code stone age C but not not Python. And I am away on vacation over the holidays |
I looked at the API docs for v2, and there were references to something called HAFAS. It's apparently some kind of de facto industry standard for mass transportation services. There's a python library, No API key required. For now, at least. I don't have the time and/or motivation to do the work, but hopefully someone can take this and run with it. |
Looking at the old integration. It updates each sensor once per minute. One sensor is 44640 lookups per 31 days. That means you can only have 1 sensor. That sucks. I only need to update the sensor when I look at it. If I am to use the new API key, I will need to find a way to activate the sensor for e.g. 10 or 20 minutes and then it stops again automatically. I think the way most use the sensor is to look at a rejseplanen card to see when the next bus or train departs. I cannot see many use this for automations running 24/7. |
There is an endpoint where you can get multiple stops in one call, which would allow you to stay within the limit and have as many sensors as you want - as long as they can fit into this one call. From the docs:
|
I was wondering why the info didn't show up anymore ;P I hope someone less lazy than me fixes this issue soon :) |
Querying once per minute is also crazy. I understand the need to see delays, but they’re rare - so in the normal case (people sleeping, at work, not home, ..) it’s just a waste. Updates could be limited to once every 15-30 minutes outside peak, 5 minutes inside peak, and if a delay is identified then more often. Here’s to hoping we get a HAFAS integration :). Also hoping that we can query a departure board based on an intended destination station, and not a direction 🤞 |
In general i agree, but in the case of 5C in inner Copenhagen, once a minute might be needed considering how unreliable they are. |
Good news: I have added Rejseplanen support to this cool HAFAS HA integration (thanks @akloeckner 🙏 ), so it is now possible to get Danish public transport info in Home Assistant :) ![]() ![]() It is installed via HACS and with this as custom repository: https://github.com/akloeckner/hacs-hafas And then you can create a new entity like this: ![]() I'm considering writing a blog post with more details about how to set it up, let me know if this is something anyone would actually find useful! |
It looks to me like it only shows the next departure time, is that right? |
That is indeed possible, it's just me who's living in the country side where the trains only run once per hour 😉 But here's an example I just threw together with runddelen to Nørreport: And here's the code (without delays or cancellations to keep things simple):
|
Good work @madsnedergaard! 👍 |
First, thank you for the really nice work . I'm trying to edit the products line. It says on the HAFAS wiki that i should be "products: comma-separated list of line names". But I cant get it working. How do I get it to show as an example only line 350s and 6a? I tried messing around with the names. |
Great job |
How about only displaying info based on the
I digged further into this, and it turns out the Rejseplanen profile in Pyhafas does not support "letbane" as a transport mode :) |
Great. Just a question. Perhaps stupid. Can I change something local, while waiting for a merge? /Lars |
Thank you so much, this works for me :) |
I don't actually know, but since it's a dependency of a dependency it'll probably prove a bit tricky - I think you'd have to fork both projects to make an integration that would point at a specific branch :) |
OK. I’ll wait for you PR to merge |
Hej, jeg kan ikke finde ud af at slette rejseplanen integrationen, Nogle tips? |
Har du tjekket din configuration.yaml fil (eller anden fil, som bliver refereret) og sikret, at du har fjernet alle sensorer, der benytter 'rejseplanen' platform? |
Tak for tilføjelsen af Rejseplanen til HAFAS HA! Jeg kan ikke helt se om det er en del af HAFAS. Eksempel: 18:21 Mod Helsingør |
Der virker ikke umiddelbart som om det understøtter det: |
Tak for kigget og øv! :) |
Hi everyone,
|
The problem
The rejseplanen integration no longer shows anything in the sensors
There are no errors or warnings in the error log.
However when I go to the URLs in the documentation Rejseplanen says that they changed to API 2.0 4th of December.
That is probably the issue
What version of Home Assistant Core has the issue?
core-2024.12.3
What was the last working version of Home Assistant Core?
core-2024.12.1
What type of installation are you running?
Home Assistant OS
Integration causing the issue
rejseplanen
Link to integration documentation on our website
https://www.home-assistant.io/integrations/rejseplanen/
Diagnostics information
Nothing in the logs. It seems the old API still answers but not with any useful data
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
Nothing
The text was updated successfully, but these errors were encountered: