I'm struggling to track down an error with the integration using Auckland Transport's GTFS-RT feed. This API is provided by free of charge (account registration required) by Auckland Transport, who recently revamped their API portal and started offering GTFS V3. However, I noticed I need to provide V2 feeds to this integration, which AT also provides under the legacy/ path.
I've been trying to set up a sensor for a ferry route using the following config:
But it appears to be failing at parsing the protobuf response:
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 938, 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 157, in update
self._update_route_statuses(positions, vehicles_trips, occupancy)
File "/config/custom_components/gtfs_rt/sensor.py", line 173, in _update_route_statuses
feed.ParseFromString(response.content)
google.protobuf.message.DecodeError: Error parsing message
Turns out I had to manually include the Accept: application/x-protobuf header under headers. This particular API by default responds with JSON unless the Accept header is set.
I'm struggling to track down an error with the integration using Auckland Transport's GTFS-RT feed. This API is provided by free of charge (account registration required) by Auckland Transport, who recently revamped their API portal and started offering GTFS V3. However, I noticed I need to provide V2 feeds to this integration, which AT also provides under the
legacy/
path.I've been trying to set up a sensor for a ferry route using the following config:
But it appears to be failing at parsing the protobuf response:
I can get the results manually through Insomnia:
Logging is already set to
debug
for this component. What other info can I gather to help me diagnose this?