zacs / ha-gtfs-rt

Real-time transit information for Home Assistant
MIT License
69 stars 30 forks source link

Google protobuf decode error #37

Closed Arodd2000 closed 10 months ago

Arodd2000 commented 1 year ago

I am receiving an error google.protobuf.message.DecodeError: Error parsing message. This is my first time setting up ha-gtfs-rt and have not had it working before. I followed the steps in the readme and tried adding information for Pittsburgh. Below is my config and log.

Config:

- platform: gtfs_rt
  trip_update_url: "https://truetime.portauthority.org/gtfsrt-bus/trips?debug"
  vehicle_position_url: "https://truetime.portauthority.org/gtfsrt-bus/vehicles?debug"
  departures:
    - name: "61A to Pitt"
      route: "61A"
      stopid: 7233

Log:

2023-11-15 09:25:38.904 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration gtfs_rt which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-15 09:25:38.905 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration icloud3 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-15 09:25:38.905 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-15 09:25:38.906 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration frigate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-15 09:25:41.922 ERROR (MainThread) [homeassistant.components.sensor] gtfs_rt: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 573, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 959, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gtfs_rt/sensor.py", line 141, in update
    self.data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 190, in wrapper
    result = method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gtfs_rt/sensor.py", line 156, in update
    positions, vehicles_trips, occupancy = self._get_vehicle_positions() if self._vehicle_position_url else [{}, {}, {}]
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gtfs_rt/sensor.py", line 214, in _get_vehicle_positions
    feed.ParseFromString(response.content)
google.protobuf.message.DecodeError: Error parsing message
2023-11-15 09:25:47.078 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for spare-esp @ 10.69.69.220: Error connecting to ('10.69.69.220', 6053): [Errno 113] Connect call failed ('10.69.69.220', 6053) (SocketAPIError)
2023-11-15 09:26:25.492 WARNING (MainThread) [homeassistant.components.mqtt.light.schema_json] Invalid color mode 'xy' received for entity light.porch_light
Arodd2000 commented 10 months ago

The problem was caused by including the "?debug" at the end of the url's. By removing "?debug" the error is resolved and is working as expected.

This addon requires protobuf data, not gtfs formatted data.