Skip to content

SystemConfigDto validation error on Grocy 4.7.0: USER_USERNAME missing from /api/system/config #363

Description

@Araquis

Describe the bug
Setting up the integration against a fresh Grocy 4.7.0 instance fails during
async_setup_entry with a pydantic ValidationError. Connectivity and the API
key both work fine (confirmed the key manually against /api/system/info
and /api/chores) — the failure is specific to /api/system/config.

Traceback

File "/config/custom_components/grocy/grocy_data.py", line 103, in wrapper
    config = self.api.system.config()
  File ".../grocy/managers/system.py", line 37, in config
    raw = self._api.get_system_config()
  File ".../grocy/grocy_api_client.py", line 1142, in get_system_config
    return SystemConfigDto(**parsed_json)
pydantic_core._pydantic_core.ValidationError: 1 validation error for SystemConfigDto
USER_USERNAME
  Field required [type=missing, input_value={'MODE': 'production', ...}, input_type=dict]

Root cause
grocy-py==1.0.0's SystemConfigDto (grocy_api_client.py) requires
USER_USERNAME on /api/system/config. Grocy 4.7.0 (released 2026-08-28)
no longer returns USER_USERNAME when the request is authenticated with an
API key only (no browser session) — there's no "logged in" user to report.

Environment

  • Grocy: 4.7.0 (linuxserver/grocy docker image)
  • custom-components/grocy: 1.16.0 (installed via HACS)
  • grocy-py: 1.0.0 (latest on PyPI)
  • Home Assistant Core: 2026.8.3 (docker, ghcr.io/home-assistant/home-assistant:stable)

Expected behavior
username in SystemConfigDto should be Optional[str] = None, or the
client should tolerate a missing USER_USERNAME key generally when
authenticating via API key rather than session.

Workaround
None found — the config entry fails to set up at all since
_async_get_available_entities requires async_get_config() to succeed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions