Skip to content
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

Sensors not showing up #16

Open
Friday13th87 opened this issue Sep 9, 2023 · 11 comments
Open

Sensors not showing up #16

Friday13th87 opened this issue Sep 9, 2023 · 11 comments

Comments

@Friday13th87
Copy link

Friday13th87 commented Sep 9, 2023

If i add more then 4-6 Sensors to the configuration file, the sensors wont show up and partially disappear after restarting HA.
I am using HA in docker and the Beta 1.3.0 version of this integration.

here is my configuration as an example

sensor:
  - platform: wienerlinien
    firstnext: first
    stops:
      - "852"
      - "724"
      - "901"
      - "4926"
      - "4118"
      - "4416"
      - "1448"
      - "1474"
      - "4109"
      - "4906"
      - "4411"
      - "4925"
      - "4920"
      - "4921"
      - "4619"
      - "4610"
      - "1449"
      - "1473"
      - "1449"
      - "2618"
      - "4426"
      - "4409"
  - platform: wienerlinien
    firstnext: next
    stops:
      - "852"
      - "724"
      - "901"
      - "4926"
      - "4118"
      - "4416"
      - "1448"
      - "1474"
      - "4109"
      - "4906"
      - "4411"
      - "4925"
      - "4920"
      - "4921"
      - "4619"
      - "4610"
      - "1449"
      - "1473"
      - "1449"
      - "2618"
      - "4426"
      - "4409"
      - "1462"
      - "1461"

log
2023-09-09 14:08:47.456 WARNING (MainThread) [custom_components.wienerlinien.sensor] Skipping already existing monitor
This is the only thing popping up in the logges repeatedly

It seems, that the problem is starting after adding more then 12 sensors (2 times 6 for "next" and "first").

Is there anything i am doing wrong, or is there a way to get this running with like 20-30 stops?

thanks in advance

EDIT:
It seems to be an API Limit problem.
if i am checking my IDs on the official page
https://www.wienerlinien.at/ogd_realtime/monitor?stopid=724

And do it for a lot of lines, i am getting after a while
"Abfrage Limit erreicht"

but it is working again after several seconds.
So it would be best to have a sleep of 5-10 seconds between each API call to avoid this behavior.

And maybe it would be possible to get the times for the first, next and so on in 1 API call.
The Times for the next upcoming 7 stops are delivered in 1 API call (key 0 till 6)

But as far as i can see i cant get both timings for first and next in one call, so i need to add 2 sensors for first and next, right?

@LuckyMooon
Copy link

I have the same problem, except that nothing is displayed for me, no matter how many stations I add.

Does anyone have an idea for a solution?

@tofuSCHNITZEL
Copy link
Owner

The whole thing is bad need of a rework. Though if you really are hitting the request limit then I don't think there is a real way to solve it. although there would be a way to get an API key - there seems to be no way currently to provide these credentials to the current api endpoint and perhaps not be (so) limited. Unfortunately there is no documentation at all provided by Wiener Linien.

@LuckyMooon
Copy link

Is a rework planned in the near future?

@tofuSCHNITZEL
Copy link
Owner

Yea sure... Soon(TM) ;) but I would also need some help because I would like to to it "correct" but some of the home assistant doku is beyond my understanding

@LuckyMooon
Copy link

I don't really know much about creating integrations myself, but if I can help in any way, I'm happy to do so.

@DerBauherr
Copy link

The whole thing is bad need of a rework. Though if you really are hitting the request limit then I don't think there is a real way to solve it. although there would be a way to get an API key - there seems to be no way currently to provide these credentials to the current api endpoint and perhaps not be (so) limited. Unfortunately there is no documentation at all provided by Wiener Linien.

Documentation from Wiener Linien for this API can be found here:
https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-echtzeitdaten-dokumentation.pdf

@jozefKruszynski
Copy link

The whole thing is bad need of a rework. Though if you really are hitting the request limit then I don't think there is a real way to solve it. although there would be a way to get an API key - there seems to be no way currently to provide these credentials to the current api endpoint and perhaps not be (so) limited. Unfortunately there is no documentation at all provided by Wiener Linien.

I have been working on an updated wienerlinien integration that was inspired by this one:

https://github.com/jozefKruszynski/wienerlinien

Please take a look and see what you think.

@tofuSCHNITZEL
Copy link
Owner

The whole thing is bad need of a rework. Though if you really are hitting the request limit then I don't think there is a real way to solve it. although there would be a way to get an API key - there seems to be no way currently to provide these credentials to the current api endpoint and perhaps not be (so) limited. Unfortunately there is no documentation at all provided by Wiener Linien.

I have been working on an updated wienerlinien integration that was inspired by this one:

https://github.com/jozefKruszynski/wienerlinien

Please take a look and see what you think.

This is just awesome! It's exactly what I have envisioned but for a lack of time and skill was never able to accomplish. Should I close this repo and we add yours to the official hacs repository listing? I would like to add an yaml config conversion flow so people can directly upgrade?

@jozefKruszynski
Copy link

Let's wait a while, so far I haven't added any test code and I would like to get that in place before deciding how to proceed.
If we can get a few people testing this version then it would help me gain a bit of confidence in moving forward with adding to hacs.

@tofuSCHNITZEL
Copy link
Owner

tofuSCHNITZEL commented Dec 8, 2024

Yes I understand. I will give it a try! Fortunately for hacs integrations tests are not mandatory ;) so if you add tests and we move the code to a python package we should apply to have the whole integration added to the home assistant core!

@mr-p666
Copy link

mr-p666 commented Dec 9, 2024

The whole thing is bad need of a rework. Though if you really are hitting the request limit then I don't think there is a real way to solve it. although there would be a way to get an API key - there seems to be no way currently to provide these credentials to the current api endpoint and perhaps not be (so) limited. Unfortunately there is no documentation at all provided by Wiener Linien.

I have been working on an updated wienerlinien integration that was inspired by this one:

https://github.com/jozefKruszynski/wienerlinien

Please take a look and see what you think.

This looks pretty cool!
I'll test it and report any issues I find.
Thanks for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants