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.
Describe the bug
Setting up the integration against a fresh Grocy 4.7.0 instance fails during
async_setup_entrywith a pydantic ValidationError. Connectivity and the APIkey both work fine (confirmed the key manually against
/api/system/infoand
/api/chores) — the failure is specific to/api/system/config.Traceback
Root cause
grocy-py==1.0.0'sSystemConfigDto(grocy_api_client.py) requiresUSER_USERNAMEon/api/system/config. Grocy 4.7.0 (released 2026-08-28)no longer returns
USER_USERNAMEwhen the request is authenticated with anAPI key only (no browser session) — there's no "logged in" user to report.
Environment
Expected behavior
usernameinSystemConfigDtoshould beOptional[str] = None, or theclient should tolerate a missing
USER_USERNAMEkey generally whenauthenticating via API key rather than session.
Workaround
None found — the config entry fails to set up at all since
_async_get_available_entitiesrequiresasync_get_config()to succeed.