Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

BVG Sensor Issue #9

Open
ndom91 opened this issue Jun 4, 2023 · 2 comments
Open

BVG Sensor Issue #9

ndom91 opened this issue Jun 4, 2023 · 2 comments

Comments

@ndom91
Copy link

ndom91 commented Jun 4, 2023

Seems the integration can no longer pull updates correctly. I'm using a version 0.0.1 according to the manifest.json in my custom_components/bvg_berlin_public_transport/manifest.json, but 0.3.1 according to HACS

sensor.yaml config:

- platform: bvg_berlin_public_transport
  name: M5 > Hohenschönhausen, Zingster Str.
  direction: "Hohenschönhausen, Zingster Str."
  stop_id: "900000120513"
  walking_distance: 0

Logs:

2023-06-04 15:17:55.735 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.m5_hohenschonhausen_zingster_str fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 554, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 781, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/bvg_berlin_public_transport/sensor.py", line 154, in update
    self.singleConnection = self.getSingleConnection(self.direction, self.min_due_in, 0)
  File "/config/custom_components/bvg_berlin_public_transport/sensor.py", line 182, in getSingleConnection
    for pos in self.data:
TypeError: 'NoneType' object is not iterable

Also on the integration page, none of those sensors seem to appear 🤔

image

EDIT: Debug logging enabled confirms my fears, BVG endpoint returning a 503


2023-06-04 16:21:21.543 DEBUG (SyncWorker_2) [custom_components.bvg_berlin_public_transport.sensor] HTTP Error 503: Service Unavailable
2023-06-04 16:21:21.543 WARNING (SyncWorker_2) [custom_components.bvg_berlin_public_transport.sensor] Connection to BVG API lost, using local cache instead
@ndom91
Copy link
Author

ndom91 commented Jun 4, 2023

The v5 API endpoint (https://v5.bvg.transport.rest/stops/{}...., sensor.py:99) yuo're using here seems to be deprecated:

image

https://transport.rest/

@ndom91
Copy link
Author

ndom91 commented Jun 4, 2023

Theres a ton of left over from the template you used to set this up as well. I'm trying to see if I can clean up some of that stuff and bump the API version here: #10

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

No branches or pull requests

1 participant