Skip to content

Verbindungsverlust #38697

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

Closed
itsajokeor opened this issue Apr 23, 2025 · 8 comments
Closed

Verbindungsverlust #38697

itsajokeor opened this issue Apr 23, 2025 · 8 comments

Comments

@itsajokeor
Copy link

Feedback

Hi ich habe jeden Tag das Problem das die Verbindungen gegen Abend nichts mehr anzeigen, heisst wie Serververbindung die plötzlich fehlt, habe ich bei keiner anderen Integration. Was kann das sein? Am nächsten Morgen läuft sie dann wieder!

URL

https://www.home-assistant.io/integrations/swiss_public_transport/

Version

2025.4.3

Additional information

No response

@home-assistant
Copy link

Hey there @fabaff, @miaucl, mind taking a look at this feedback as it has been labeled with an integration (swiss_public_transport) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of swiss_public_transport can trigger bot actions by commenting:

  • @home-assistant close Closes the feedback.
  • @home-assistant rename Awesome new title Renames the feedback.
  • @home-assistant reopen Reopen the feedback.
  • @home-assistant unassign swiss_public_transport Removes the current integration label and assignees on the feedback, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information) to the feedback.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information) on the feedback.

@itsajokeor
Copy link
Author

Ich lasse mal das Debug Protokoll laufen um zu sehen was passiert.

@miaucl
Copy link
Contributor

miaucl commented Apr 23, 2025

Hallo, du wirst wahrscheinlich mehr als eine Verbindung konfiguriert haben? Dann läufst du nämlich in das rate limit der API (siehe ersten Abschnitt der Integration Docs).

Image

In dem Fall musst du "Custom polling" verwenden und zum Beispiel in der Nacht die Updates pausieren oder die Frequenz runterschrauben.
https://www.home-assistant.io/integrations/swiss_public_transport/#defining-a-custom-polling-interval

Ich habe 4 Verbindungen aktiv die zwischen 00h00 und 06h00 nicht aktiv sind und tagsüber alle 3 minuten aktualisieren. Damit komme ich knapp unter 1000 requests durch pro Tag.

Da ist leider ein bisschen Kreativität gefragt seitens Nutzer :)

Ich hoffe ich konnte helfen.

@miaucl
Copy link
Contributor

miaucl commented Apr 23, 2025

PS: Für Abfahrstabellen kann auch folgendes Tool verwendet werden
https://www.oevplus.ch/departures/

@itsajokeor
Copy link
Author

itsajokeor commented Apr 23, 2025 via email

@miaucl
Copy link
Contributor

miaucl commented Apr 23, 2025

öVplus kannst du einfach als iframe einbinden in den dashboards (wie eine x-beliebige website), aber nicht für automationen verwenden. Wenn du dazu fragen hast, gibt es in der HA community genug anleitungen und sonst auf discord fragen :)

Custom polling sollte eigentlich hier gut beschrieben sein: https://www.home-assistant.io/integrations/swiss_public_transport/#defining-a-custom-polling-interval

  1. Default polling für alle Verbindungen abschalten (System Options)
Image
  1. Eine Automation schreiben, die jede Verbindung dann aktualisiert wenn du es willst. Hier meine zwei Beispiele für Metro und Zug
alias: SPT Automation All Day Frequency (Train)
description: ""
triggers:
  - minutes: /5
    trigger: time_pattern
conditions:
  - condition: time
    after: "05:00:00"
    before: "08:00:00"
    weekday:
      - fri
      - thu
      - wed
      - tue
      - mon
      - sat
      - sun
actions:
  - action: homeassistant.update_entity
    metadata: {}
    data:
      entity_id:
        - sensor.lausanne_nyon_at_07_10_00_departure
        - sensor.lausanne_zurich_at_07_15_00_departure
    alias: Update entities
mode: single
alias: SPT Automation All Day Frequency (Metro)
description: ""
triggers:
  - minutes: /5
    trigger: time_pattern
conditions:
  - condition: time
    after: "06:30:00"
    before: "23:00:00"
    weekday:
      - fri
      - thu
      - wed
      - tue
      - mon
      - sat
      - sun
actions:
  - action: homeassistant.update_entity
    metadata: {}
    data:
      entity_id:
        - sensor.fourmi_croisettes_in_00_05_00_departure
        - sensor.fourmi_ouchy_in_00_05_00_departure
    alias: Update entities
mode: single
Image

Ich hoffe ich konnte dir helfen.

Github ist eigentlich keine Support Platform, daher empfehle ich dir weitere Fragen auf dem Discord zu stellen. Ich werde dieses Issue hiermit schliessen.

@miaucl
Copy link
Contributor

miaucl commented Apr 23, 2025

@home-assistant close

@itsajokeor
Copy link
Author

itsajokeor commented Apr 23, 2025 via email

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

No branches or pull requests

3 participants