Repository navigation
get_domains() fails with ValidationError after Home Assistant 2025.11 release #217
Description
Description
After upgrading to Home Assistant 2025.11 (released November 5, 2025), the client.get_domains() method fails with a Pydantic validation error. This appears to be caused by changes in the Home Assistant REST API response format where some services are missing the required name field.
Environment
- homeassistant-api version: 5.0.2
- Home Assistant version: 2025.11.0
- Python version: 3.13
Steps to Reproduce
from homeassistant_api import Client
ip = "..."
token = "..."
client = Client(ip, token, cache_session=False)
# This now fails with ValidationError
domains = client.get_domains()Error Message
Traceback (most recent call last):
File "<python-input-18>", line 1, in <module>
client.get_domains()
File "lib/python3.13/site-packages/homeassistant_api/rawclient.py", line 281, in get_domains
return {domain.domain_id: domain for domain in domains}
File "lib/python3.13/site-packages/homeassistant_api/rawclient.py", line 278, in <lambda>
lambda json: Domain.from_json(json, client=cast(Client, self)),
File "lib/python3.13/site-packages/homeassistant_api/models/domains.py", line 68, in from_json
domain._add_service(service_id, **data)
File "ib/python3.13/site-packages/homeassistant_api/models/domains.py", line 76, in _add_service
service_id: Service(
service_id=service_id,
domain=self,
**data,
)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Service
name
Field required [type=missing, input_value={'service_id': 'save_pers...vices={}), 'fields': {}}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/missing
Expected Behavior
The get_domains() method should successfully return a dictionary of all available domains and their services, which I use to access available fields and functions of my devices.
Actual Behavior
The method raises a ValidationError because the Pydantic Service model requires a name field that is apparently missing from some services in the Home Assistant 2025.11 REST API response.
Analysis
It appears that Home Assistant 2025.11 has changed the format of service definitions returned by the REST API. Some services (like save_persistent_states based on the error context) no longer include the name field that the library's Pydantic model expects.
This is likely related to the extensive automation editor improvements and API changes mentioned in the [2025.11 release notes](https://www.home-assistant.io/blog/2025/11/05/release-202511/).
Proposed Solution
The Service model in homeassistant_api/models/domains.py should be updated to make the name field optional, or provide a default value when it's missing from the API response. This would maintain backward compatibility while handling the new API format.
Workaround
None currently available. The get_domains() method is completely broken after upgrading Home Assistant to 2025.11.
Additional Context
- The
trigger_service()method still works correctly for controlling devices - Only the
get_domains()method appears to be affected - Other methods like
get_entity()appear to work when called with theentity_idkeyword argument
Activity
konetzed commentedon Nov 10, 2025
Any updates on this? Just curious as im kinda stuck and seems like no work around. :)
jzucker2 commentedon Nov 10, 2025
I started trying to dig into this. I can't even find the docs updates for the new behavior.
Here's the actual implementation file in Home Assistant, which hasn't been updated in 5 months: https://github.com/home-assistant/core/blame/dev/homeassistant/components/api/__init__.py
And the deployed docs page hasn't been updated in 2 months and doesn't contain any of this info AFAIK: https://github.com/home-assistant/developers.home-assistant/blame/master/docs/api/rest.md
And the REST API dev docs has a simple SWAGGER tool that also doesn't define parameters (or outputs):
https://developers.home-assistant.io/docs/api/rest/
Am I just missing something? Or does someone understand this a little better than me? I can definitely reproduce the issue by upgrading. I just don't see why this is the only project affected or what proper procedures are expected
Edit: I think it might be related to this => home-assistant/core#147120
This also has a dev blog post: https://developers.home-assistant.io/blog/2025/10/24/service-web-api-changes/
GrandMoff100 commentedon Nov 11, 2025
It seems like name is indeed optional in the official Service schema so I agree it should be just an easy fix.
GrandMoff100 commentedon Nov 11, 2025
https://pypi.org/project/HomeAssistant-API/5.0.2.post1/
scheidtdav commentedon Dec 6, 2025
I am facing a very related issue with Home Assistant 2025.12. and the
get_domains()call:I could not find information on changes though.
Steps to reproduce are exactly as originally outlined.
@GrandMoff100 can this be reopened or should I create a new issue?
konetzed commentedon Dec 14, 2025
Upgraded last night to find out all my scripts are broken.
Version info
Traceback output
Currently on HomeAssistant-API 5.0.2.post1
LukeBoland commentedon Dec 15, 2025
Both get_domains() and get_domain() fail
GrandMoff100 commentedon Dec 24, 2025
Hi guys! @LukeBoland @konetzed @scheidtdav Sorry, I've been caught up with finals and Christmas, but one temporary workaround that seems to work is to modify the model config at runtime
Home Assistant seems to changed the schema of service models on us and I will try to work on it over the holidays.
Please let me know if this workaround works for y'all, and I just ask for your patience.
GrandMoff100 commentedon Dec 25, 2025
I think I've fixed it. It seems like just an extra
multipleflag insideServiceFieldSelectorMediadid the trick?https://pypi.org/project/HomeAssistant-API/5.0.2.post2/
konetzed commentedon Dec 25, 2025
Tested and my scripts are working after upgrade to HomeAssistant-API-5.0.2.post2, TYVM!
GrandMoff100 commentedon Dec 25, 2025
Merry Christmas!