AI Agent HA
A powerful Home Assistant custom integration that connects your Home Assistant instance with multiple AI providers (OpenAI, Google Gemini, Anthropic (Claude), OpenRouter, Alter, z.ai, and Llama) to translate user requests into valid Home Assistant operations, including creating automations automatically!
🚀 Quick Install

Click the button above to install AI Agent HA directly through HACS, or see the detailed installation instructions below.
☕ Support the Project
If you find this integration helpful and would like to support its development, you can buy me a coffee! Your support helps keep this project active and maintained. Currently I am the only Dev on that project and looking to have more paretners here.

Every contribution, no matter how small, is greatly appreciated and helps fund the continued development and improvement of AI Agent HA.
Another way to support me will be to try my new project. Askie - AI for kids. I am looking for feedback on this one: Web: https://kidsai.app • iOS: https://apps.apple.com/app/id6749299565 Android: https://play.google.com/store/apps/details?id=com.askie.app
✨ Features
- 🤖 Multiple AI Provider Support: OpenAI, Google Gemini, Anthropic (Claude), OpenRouter, Alter, z.ai, and Llama
- 🎯 Model Selection: Choose from predefined models or use custom model names
- 🏠 Smart Home Control: Turn lights on/off, control climate, and manage devices
- ⚡ Automation Creation: Automatically create automations based on natural language
- 📋 Dashboard Creation: Create and customize Home Assistant dashboards through natural language
- 📊 Data Access: Get entity states, history, weather, and more
- 🔒 Secure: API keys stored securely in Home Assistant
- 🎨 Beautiful UI: Clean, modern chat interface
- 🔄 Real-time: Instant responses and updates
📸 Screenshots
Automation Creation

📋 Dashboard Creation
AI Agent HA now supports creating and managing Home Assistant dashboards through natural language conversations! Simply describe what you want, and the AI will create a complete dashboard for you.
How Dashboard Creation Works
- Natural Language Request: Ask the AI to create a dashboard for any purpose
- Entity Discovery: The AI automatically finds relevant entities in your Home Assistant
- Smart Organization: Entities are organized by room, functionality, or domain
- Dashboard Generation: Complete dashboard with proper cards and layout is created
- Integration: Dashboard is automatically added to your Home Assistant sidebar
- Restart Required: You'll need to restart Home Assistant to see the new dashboard in your sidebar
Dashboard Creation Examples
Simple Room Dashboard
"Create a dashboard for my living room lights"
The AI will find all living room light entities and create a dashboard with appropriate light control cards.
Security Dashboard
"Create a security dashboard with all door sensors, cameras, and alarm controls"
The AI will create a comprehensive security monitoring dashboard with sensor states, camera feeds, and alarm controls. After creation, restart Home Assistant to see the new dashboard in your sidebar.
Energy Monitoring Dashboard
"I want an energy dashboard showing power consumption and usage graphs"
The AI will create an energy monitoring dashboard with real-time power gauges, usage graphs, and cost tracking.
Climate Control Dashboard
"Create a climate dashboard for temperature control throughout the house"
The AI will organize thermostats, temperature sensors, and HVAC controls in a logical layout.
Supported Dashboard Features
- Smart Card Selection: Appropriate card types for each entity (lights, sensors, media players, etc.)
- Room-Based Organization: Entities automatically grouped by area when possible
- Interactive Clarification: AI asks follow-up questions to refine your requirements
- Template-Based Creation: Built-in templates for common dashboard types (security, energy, climate, etc.)
- Dynamic Layout: Optimized card arrangements and view organization
- Icon Integration: Automatic Material Design icon selection
Dashboard Types the AI Can Create
- Room-Specific: Living room, bedroom, kitchen, etc.
- Functional: Security, energy, climate, media, lighting
- Device-Specific: All lights, all sensors, all switches
- Scenario-Based: Morning routine, evening security, vacation mode
- Custom: Any combination based on your specific needs
For detailed dashboard creation documentation, see: Dashboard Creation Guide
🚀 Supported AI Providers
OpenAI
- Models: All available models are loaded dynamically.
- Setup: Get API key from OpenAI Platform
- During configuration, you can optionally set a custom Base URL (e.g.,
for proxies or regional endpoints). Leave it blank to use the official default.
- Note If you need a model not listed, select “Custom...” and type the exact model ID.
Google Gemini
- Models: All available models are loaded dynamically.
- Setup: Get API key from Google AI Studio
- Note: If you need a model not listed, select “Custom...” and type the exact model ID.
Anthropic (Claude)
- Models: Claude Opus 4.7, Claude Sonnet 4.6, Claude Haiku 4.5, Claude 3.5 Sonnet, Claude 3.5 Haiku, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku
- Setup: Get API key from Anthropic Console
- Popular Models:
claude-opus-4-7 (Latest flagship model)
claude-sonnet-4-6 (Latest sonnet model)
claude-haiku-4-5 (Fast and efficient)
claude-3-5-sonnet-20241022 (Previous generation)
claude-3-opus-20240229 (Most powerful for complex tasks)
OpenRouter
- Models: Access to 100+ models including Claude, Llama, Mistral, and more
- Setup: Get API key from OpenRouter
- Popular Models:
anthropic/claude-3.5-sonnet
meta-llama/llama-3.1-70b-instruct
mistralai/mixtral-8x7b-instruct
Llama
- Models: Llama 4 Maverick, Llama 3.1, Llama 3.2
- Setup: Get API key from your Llama provider
Alter
- Models: Various custom models
- Setup: Get API key from Alter HQ
z.ai
- Models: GLM-4.7, GLM-4.6, GLM-4.5, GLM-4.5-air, GLM-4.5-x, GLM-4.5-airx, GLM-4.5-flash
- Setup: Get API key from Z.ai Platform
- Endpoints:
- General Purpose: Standard AI tasks
- Coding: Optimized for coding scenarios (3× usage, 1/7 cost)
- Popular Models:
glm-4.7 (Latest flagship model)
glm-4.5-flash (Fast and efficient)
Local Ollama
- Models: Any Ollama model (e.g., llama3.2, mistral, mixtral, etc.)
- Setup: Run Ollama locally and provide its API URL (e.g.,
http://localhost:11434/api/generate)
Local OpenAI-Compatible Endpoints
- Models: All available models are loaded dynamically from your endpoint (if supported). Falls back to “Custom...” if not.
- Setup: Provide your endpoint base URL ending with
/v1/ (e.g., http://localhost:8080/v1/)
- Note: If you need a model not listed, select “Custom...” and type the exact model ID.
📦 Installation
HACS Installation (Recommended)
Use the Quick Install button at the top of this README for the easiest installation, or manually add the repository:
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository:
https://github.com/sbenodiz/ai_agent_ha
- Select "Integration" as the category
- Click "Add"
- Find "AI Agent HA" in the integration list
- Click "Download"
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for "AI Agent HA"
- Follow the setup wizard to configure your preferred AI provider
Manual Installation
- Download the latest release from the releases page
- Extract the files
- Copy the
custom_components/ai_agent_ha folder to your Home Assistant custom_components directory
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for "AI Agent HA"
- Follow the setup wizard to configure your preferred AI provider
⚙️ Configuration
The integration uses a two-step configuration process:
Step 1: Choose AI Provider
Select your preferred AI provider from the dropdown:
- OpenAI
- Google Gemini
- Anthropic (Claude)
- OpenRouter
- Alter
- z.ai
- Llama
- Local Ollama
- OpenAI-Compatible Endpoints
Step 2: Configure Provider
Enter your API credentials and optionally select a model:
- API Key/Token: Your provider-specific API key
- Model: Choose from predefined models or enter a custom model name
Configuration Examples
# Example configuration.yaml (optional - integration supports config flow only)
ai_agent_ha:
ai_provider: anthropic
anthropic_token: "sk-ant-..."
models:
anthropic: "claude-3-5-sonnet-20241022"
# Example with z.ai provider
ai_agent_ha:
ai_provider: zai
zai_token: "your-zai-api-key"
zai_endpoint: