The problem
How it works
Home Assistant’s AI Task integration lets automations, scripts and template entities hand a job to an AI model and get the result back as text or as fields you define. You add an AI Task entry under an AI integration such as Ollama or OpenAI, then call ai_task.generate_data with instructions, an optional output structure and attachments such as a camera image. The documented example is a template sensor that runs every five minutes, attaches a snapshot from a coop camera, asks how many birds are inside and stores the number as a sensor. The docs suggest the same pattern for free parking spaces, people in a room or whether a door is open, and the release added a blueprint for analysing camera footage.
Results and limitations
The source is official documentation and release notes with example configurations, not a measured deployment, so this case is marked planned.
Before you try it
Each run sends a camera image to whichever model you configure; use a local model through Ollama if images should stay at home, and think about who appears on camera. A five-minute schedule means many model calls per day, which costs money with a cloud API. AI features stay hidden unless you set up an AI integration. Treat counts as estimates rather than alarms you rely on for safety. Results depend on your setup and were not independently reproduced by Top 200 Repos.
Tools and repositories
- Tools
- Home Assistant 2025.8 or later · An AI integration such as Ollama or OpenAI · A camera entity
- Prerequisites
- A Home Assistant installation with a camera, plus a local model or a cloud AI API key.
Try it yourself: Write the question an AI Task asks about a camera
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
This is a snapshot from my [Camera location] camera. Answer only from what is visible in this image. How many [What to count] can you see? If the view is blocked, too dark or unclear, return [Value when unclear] instead of guessing. Return the number in the field [Output field name].Use this as the instructions of ai_task.generate_data with a number field in the structure, and test it on daytime and night-time snapshots first.
Related videos
About ollama/ollama
Learn Ollama in 15 Minutes - Run LLM Models Locally for FREE (opens in a new tab)
The description links the GitHub repository.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- AI Task (opens in a new tab)
Project documentation · home-assistant.io · Undated · Source checked 12 Nov 2026, 09:55 UTC
What this source supports
- AI Task is a building block used by AI integrations, with a preferred AI Task entity per task
- Actions include ai_task.generate_data and ai_task.generate_image
- Example template sensor attaches a coop camera image every five minutes and stores the bird count as a number
- Suggested alternatives: free parking spots, people in a room, whether a door is open
- 2025.8: The summer of AI (opens in a new tab)
Project documentation · home-assistant.io · Published 6 Aug 2025 · Source checked 12 Nov 2026, 10:08 UTC
What this source supports
- AI Task was introduced in Home Assistant 2025.8 and can take file and camera attachments
- Output can be text or a structure of your choice, from automations, scripts and template entities
- Ollama servers and OpenAI API keys are configured once and used through sub-entries
- AI features do not appear unless an AI integration is set up, and a blueprint for analysing camera footage was provided
