Skip to content

GraphQL request returned errors #20

@fcastilloec

Description

@fcastilloec

System Health details

System information

Version core-2026.3.0
Installation type Home Assistant OS
Development false
Supervisor true
Docker true
Container architecture aarch64
User root
Virtual environment false
Python version 3.14.2
Operating system family Linux
Operating system version 6.12.47-haos-raspi
CPU architecture aarch64
Timezone America/New_York
Configuration directory /config

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

I just updated to Home Assistant 2026.3.0 and the integration stopped working. I'm not sure if they are related or just a coincidence, but lots of errors are happening.

Reproduction steps

  1. Start Home Assistant
  2. Integration throws errors

Debug logs

Logger: custom_components.national_grid
Source: helpers/update_coordinator.py:426
integration: National Grid (documentation, issues)
First occurred: March 4, 2026 at 11:55:08 PM (444 occurrences)
Last logged: 12:00:06 PM

Unexpected error fetching national_grid data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 426, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/national_grid/coordinator.py", line 97, in _async_update_data
    data = await self._fetch_all_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/national_grid/coordinator.py", line 132, in _fetch_all_data
    await self._fetch_account_data(account_id, today, from_month, data)
  File "/config/custom_components/national_grid/coordinator.py", line 217, in _fetch_account_data
    await self._fetch_ami_data(
    ...<5 lines>...
    )
  File "/config/custom_components/national_grid/coordinator.py", line 317, in _fetch_ami_data
    ami_data = await self.api.get_ami_energy_usages(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/local/lib/python3.14/site-packages/aionatgrid/client.py", line 694, in get_ami_energy_usages
    return extract_ami_energy_usages(response)
  File "/usr/local/lib/python3.14/site-packages/aionatgrid/extractors.py", line 197, in extract_ami_energy_usages
    response.raise_on_errors()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/site-packages/aionatgrid/graphql.py", line 54, in raise_on_errors
    raise ValueError(f"GraphQL errors encountered: {self.errors}")
ValueError: GraphQL errors encountered: [{'message': "Unable to cast object of type 'System.DateTime' to type 'System.Nullable`1[System.DateTimeOffset]'.", 'locations': [{'line': 2, 'column': 9}], 'path': ['amiEnergyUsages'], 'extensions': {'code': 'BadRequest'}}]

Diagnostics dump

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions