Skip to content

[Bug]: Getting GasBuddy unavailable - API parsing problem #138

Closed
@lordwizzard

Description

@lordwizzard

The problem

This error originated from a custom integration.

Logger: gasbuddy
Source: custom_components/gasbuddy/init.py:175
integration: GasBuddy (documentation, issues)
First occurred: 12:39:59 PM (12 occurrences)
Last logged: 12:39:59 PM

Non-JSON response: Bad Request
An error reteiving data from the server, code: 400 message: {'error': 'Bad Request'}
An error occured attempting to retrieve the data: {'error': 'Bad Request'}
This error originated from a custom integration.

Logger: custom_components.gasbuddy
Source: custom_components/gasbuddy/init.py:180
integration: GasBuddy (documentation, issues)
First occurred: 12:39:59 PM (4 occurrences)
Last logged: 12:39:59 PM

Problem parsing API response.
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:633
integration: Sensor (documentation, issues)
First occurred: 12:40:06 PM (52 occurrences)
Last logged: 12:40:07 PM

Error adding entity None for domain sensor with platform gasbuddy
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 633, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 770, in _async_add_entity
entity.add_to_platform_start(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self.hass,
^^^^^^^^^^
self,
^^^^^
self._get_parallel_updates_semaphore(hasattr(entity, "update")),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 231, in add_to_platform_start
or self.unit_of_measurement == registry_unit
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 480, in unit_of_measurement
native_unit_of_measurement = self.native_unit_of_measurement
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/gasbuddy/sensor.py", line 110, in native_unit_of_measurement
uom = self.coordinator.data["unit_of_measure"]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'unit_of_measure'

What version of Home Assistant?

Version core-2025.3.3 Installation type Home Assistant OS Development false Supervisor true Docker true User root Virtual environment false Python version 3.13.2 Operating system family Linux Operating system version 6.6.74-haos-raspi CPU architecture aarch64 Timezone America/New_York Configuration directory /config GitHub API ok GitHub Content ok GitHub Web ok HACS Data ok GitHub API Calls Remaining 5000 Installed Version 2.0.5 Stage running Available Repositories 1663 Downloaded Repositories 15

What version of GasBuddy?

1.0.21

Diagnostics information

No response

Anything in the logs that might be useful for us?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-issueProblem with API response/dataduplicateThis issue or pull request already exists

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions