A lightweight and fast integrated development environment (IDE) for Home Assistant, powered by artificial intelligence.
Stop copy-pasting code between ChatGPT and your specialized editors. AI Code Task brings your AI assistant directly into your dashboard, with full access to your configuration files and entity states.
This is a custom Lovelace card that combines three tools into one cohesive interface:
- A Chat Interface for talking to your LLMs.
- A Code Editor for viewing and modifying your configuration.
- A File Explorer for navigating your
/configdirectory.
It is designed to streamline the workflow of writing automations, fixing scripts, and managing your Home Assistant configuration.
AI models often hallucinate entity names. This card solves that.
- Attach Entities: Use the "Database" icon to search and select your actual Home Assistant entities (e.g.,
light.living_room,sensor.temperature). - Live State: The AI receives the current state and attributes of those entities.
- Result: The code it generates uses your actual entity IDs and respects their current capabilities.
You don't need to leave the dashboard to check a file path or read an existing script.
- Browse
/config: Navigate your configuration directory directly from the card. - Open & Edit: Click any compatible file to open it in the built-in editor.
- Context for AI: You can "upload" local files from the explorer to the chat so the AI can analyze them (e.g., "Why is this automation in
automations.yamlnot triggering?").
The chat and editor are linked.
- One-Click Open: If the AI generates code for a specific file, a clickable badge appears. One click opens that file in the editor.
- Diff & Save: Review the generated code in the editor, make manual tweaks if needed, and save directly to disk.
- Snippet vs File: The interface distinguishes between a generic code example (Snippet) and a modification to an actual file, reducing confusion.
This card doesn't care which AI you use. It sits on top of Home Assistant's AI TASK platform.
- Works with Everything: Grok xAI, OpenAI, Google Gemini, Anthropic, or local LLMs (via Ollama/LocalAI). If it's configured in Home Assistant, it works here.
- Switch on the Fly: You can switch providers instantly from the dropdown menu to compare responses.
Click this badge to install AI CODE TASK via HACS
Click this badge after restart Home Assistant to configure AI CODE TASK and select default Provider AI:
Manual HACS
- Open HACS in Home Assistant
- Go to Integrations → Menu (⋮) → Custom repositories
- Add:
https://github.com/pajeronda/ai_code_task - Category: Integration
- Search for "AI Code Task" and click Download
- Restart Home Assistant
- Download the latest release of AI Code Task (alternatively, download the zip from the "<> code" badge at the top of this page)
- Extract and copy the
ai_code_taskfolder toconfig/custom_components/ - Restart Home Assistant
I recommend using it in a dashboard in "Panel" mode (full screen) to optimize the split view between chat and editor, but it works in all dashboard modes and on all device types.
- type: panel
path: code
title: AI CODE TASK
cards:
- type: custom:ai-code-task-card
theme: <your theme>IMPORTANT:
- If you don't see the card after the install/update, try refreshing your browser cache! On PC, press Ctrl + F5 (or Cmd + Shift + R on Mac). If you're using the Home Assistant app, try closing and reopening it.


