home-assistant/core · error · HomeAssistantError

AI Task entity {entity_id} does not support generating data

Error message

AI Task entity {entity_id} does not support generating data

What it means

HomeAssistantError from ai_task.async_generate_data when the resolved entity exists but its supported_features lacks AITaskEntityFeature.GENERATE_DATA. AI Task entities advertise capabilities per feature flag; only entities implementing internal_async_generate_data (e.g. conversation agents wired for structured data generation) set this bit.

Source

Thrown at homeassistant/components/ai_task/task.py:135

    entity_id: str | None = None,
    instructions: str,
    structure: vol.Schema | None = None,
    attachments: list[dict] | None = None,
    llm_api: llm.API | None = None,
) -> GenDataTaskResult:
    """Run a data generation task in the AI Task integration."""
    if entity_id is None:
        entity_id = hass.data[DATA_PREFERENCES].gen_data_entity_id

    if entity_id is None:
        raise HomeAssistantError("No entity_id provided and no preferred entity set")

    entity = hass.data[DATA_COMPONENT].get_entity(entity_id)
    if entity is None:
        raise HomeAssistantError(f"AI Task entity {entity_id} not found")

    if AITaskEntityFeature.GENERATE_DATA not in entity.supported_features:
        raise HomeAssistantError(
            f"AI Task entity {entity_id} does not support generating data"
        )

    if (
        attachments
        and AITaskEntityFeature.SUPPORT_ATTACHMENTS not in entity.supported_features
    ):
        raise HomeAssistantError(
            f"AI Task entity {entity_id} does not support attachments"
        )

    with async_get_chat_session(hass) as session:
        resolved_attachments = await _resolve_attachments(hass, session, attachments)

        return await entity.internal_async_generate_data(
            session,
            GenDataTask(
                name=task_name,

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Switch to an entity that supports data generation — check the entity's supported features in Developer Tools or use a mainstream conversation agent (OpenAI, Google, Anthropic) at a current version.
  2. Update the underlying conversation integration so it implements the AI Task data API and sets the feature flag.
  3. If you maintain a custom agent, implement internal_async_generate_data and include AITaskEntityFeature.GENERATE_DATA in supported_features.
  4. For image agents, use ai_task.generate_image instead.
Defensive patterns

Strategy: validation

Validate before calling

def supports_gen_data(entity) -> bool:
    """Entity advertises the data-generation capability."""
    from homeassistant.components.ai_task import AITaskEntityFeature

    return AITaskEntityFeature.GENERATE_DATA in entity.supported_features

Type guard

def is_data_capable_ai_task_entity(entity) -> bool:
    """Type/narrowing guard: registered and GENERATE_DATA-capable."""
    return (
        hasattr(entity, "supported_features")
        and AITaskEntityFeature.GENERATE_DATA in entity.supported_features
    )

Try / catch

from homeassistant.exceptions import HomeAssistantError

try:
    result = await async_generate_data(hass, entity_id=eid, task_name="t", instructions="...")
except HomeAssistantError as err:
    if "does not support generating data" in str(err):
        # pick a data-capable agent instead
        raise
    raise

Prevention

When it happens

Trigger: Calling ai_task.generate_data against an entity that only supports image generation (or attachments only) — get_entity succeeds, but the GENERATE_DATA flag is missing, so the request is rejected before any LLM call.

Common situations: Pointing generate_data at an image-only agent; an older conversation integration that has not adopted the AI Task API yet; custom components exposing an ai_task entity without the data feature.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/27ad06271fccb1e0. Report an issue: GitHub.