{"record":{"id":"27ad06271fccb1e0","repo":"home-assistant/core","slug":"ai-task-entity-entity-id-does-not-support-genera","errorCode":null,"errorMessage":"AI Task entity {entity_id} does not support generating data","messagePattern":"AI Task entity (.+?) does not support generating data","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/ai_task/task.py","lineNumber":135,"sourceCode":"    entity_id: str | None = None,\n    instructions: str,\n    structure: vol.Schema | None = None,\n    attachments: list[dict] | None = None,\n    llm_api: llm.API | None = None,\n) -> GenDataTaskResult:\n    \"\"\"Run a data generation task in the AI Task integration.\"\"\"\n    if entity_id is None:\n        entity_id = hass.data[DATA_PREFERENCES].gen_data_entity_id\n\n    if entity_id is None:\n        raise HomeAssistantError(\"No entity_id provided and no preferred entity set\")\n\n    entity = hass.data[DATA_COMPONENT].get_entity(entity_id)\n    if entity is None:\n        raise HomeAssistantError(f\"AI Task entity {entity_id} not found\")\n\n    if AITaskEntityFeature.GENERATE_DATA not in entity.supported_features:\n        raise HomeAssistantError(\n            f\"AI Task entity {entity_id} does not support generating data\"\n        )\n\n    if (\n        attachments\n        and AITaskEntityFeature.SUPPORT_ATTACHMENTS not in entity.supported_features\n    ):\n        raise HomeAssistantError(\n            f\"AI Task entity {entity_id} does not support attachments\"\n        )\n\n    with async_get_chat_session(hass) as session:\n        resolved_attachments = await _resolve_attachments(hass, session, attachments)\n\n        return await entity.internal_async_generate_data(\n            session,\n            GenDataTask(\n                name=task_name,","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/ai_task/task.py#L117-L153","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Update the underlying conversation integration so it implements the AI Task data API and sets the feature flag.","If you maintain a custom agent, implement internal_async_generate_data and include AITaskEntityFeature.GENERATE_DATA in supported_features.","For image agents, use ai_task.generate_image instead."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"def supports_gen_data(entity) -> bool:\n    \"\"\"Entity advertises the data-generation capability.\"\"\"\n    from homeassistant.components.ai_task import AITaskEntityFeature\n\n    return AITaskEntityFeature.GENERATE_DATA in entity.supported_features","typeGuard":"def is_data_capable_ai_task_entity(entity) -> bool:\n    \"\"\"Type/narrowing guard: registered and GENERATE_DATA-capable.\"\"\"\n    return (\n        hasattr(entity, \"supported_features\")\n        and AITaskEntityFeature.GENERATE_DATA in entity.supported_features\n    )","tryCatchPattern":"from homeassistant.exceptions import HomeAssistantError\n\ntry:\n    result = await async_generate_data(hass, entity_id=eid, task_name=\"t\", instructions=\"...\")\nexcept HomeAssistantError as err:\n    if \"does not support generating data\" in str(err):\n        # pick a data-capable agent instead\n        raise\n    raise","preventionTips":["Keep conversation integrations updated so they implement the AI Task data API.","Pick agents by capability, not by name — image-only agents reject generate_data.","Custom agents must set the feature flag when implementing the method."],"tags":["homeassistant","ai-task","feature-flags","validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}