Groq Conversation for Home Assistant
Integration for Groq cloud API in Home Assistant, providing fast LLM inference with support for conversation agents and AI tasks.
Features
- Conversation Agents: Create multiple conversation agents with different Groq models
- AI Task Entities: Generate structured data using LLMs
- Tool Calling: Full support for Home Assistant actions and device control
- File Attachments: Support for images and PDF files in conversations
- JSON Mode: Structured outputs for AI tasks
- Fast Inference: Leverage Groq's lightning-fast LLM inference
- Multiple Models: Support for Llama, Mixtral, and other Groq models
Supported Models
The integration supports all models available in Groq, including:
- Llama 3 (8B, 70B)
- Mixtral (8x7B)
- Gemma
- And more as they become available
Installation
HACS (Recommended)
- 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 URL:
https://github.com/luizbafilho/groq-hass - Select "Integration" as the category
- Click "Add"
- Search for "Groq Conversation" and install
- Restart Home Assistant
Manual Installation
- Download the latest release from this repository
- Copy the
custom_components/groq_conversationdirectory to your Home Assistant'scustom_componentsdirectory - Restart Home Assistant
Configuration
Getting a Groq API Key
- Visit Groq Console
- Sign up or log in to your account
- Navigate to the API Keys section
- Create a new API key
- Copy the API key for use in Home Assistant
Adding the Integration
- Go to Settings → Devices & Services
- Click "+ Add Integration"
- Search for "Groq"
- Enter your Groq API key
- Click Submit
Creating Conversation Agents
After adding the integration:
- In the Groq integration card, click "Configure"
- Click "Add conversation agent"
- Select a model (e.g., llama3-8b-8192, mixtral-8x7b-32768)
- (Optional) Customize the system prompt
- (Optional) Select which Home Assistant APIs the agent can access
- Click Submit
The conversation agent will appear as a new entity that can be used with:
- Voice assistants (Assist)
- The conversation integration
- Automation scripts
Creating AI Task Entities
For structured data generation:
- In the Groq integration card, click "Configure"
- Click "Add AI task"
- Select a model optimized for structured outputs
- Click Submit
Use AI task entities in automations or scripts to generate structured data.
Usage Examples
Voice Assistant
Once configured with Home Assistant APIs, you can use voice commands like:
- "Turn on the living room lights"
- "What's the temperature in the bedroom?"
- "Set the thermostat to 72 degrees"
Automations
Use conversation agents in automations:
action:
- service: conversation.process
data:
agent_id: conversation.llama_3_8b
text: "Summarize today's events"AI Tasks for Structured Data
Generate structured data in automations:
action:
- service: ai_task.generate_data
target:
entity_id: ai_task.mixtral_8x7b
data:
task_name: "Extract Information"
instructions: "Extract all mentioned locations from this text: {{ trigger.text }}"
structure:
locations:
- name: string
type: stringFeatures Detail
Tool Calling
The integration supports tool calling, allowing the LLM to:
- Control devices (lights, switches, climate, etc.)
- Query device states
- Execute Home Assistant actions
- Access calendar and todo lists
- And more through the Home Assistant LLM API
File Attachments
Conversation agents support image and PDF attachments for vision tasks:
- Describe images
- Extract text from PDFs
- Answer questions about visual content
JSON Mode
AI task entities use Groq's JSON mode for reliable structured output generation:
- Extract entities from text
- Generate formatted data
- Create structured responses
- Validate against schemas
Troubleshooting
Integration Not Found
Make sure you've:
- Copied the files to the correct
custom_componentsdirectory - Restarted Home Assistant
- Cleared your browser cache
API Errors
Check that:
- Your API key is valid and active in Groq Console
- You have available API credits
- The selected model is available in your region
Models Not Loading
If models don't appear in the dropdown:
- Check your internet connection
- Verify your API key has the correct permissions
- Check Home Assistant logs for error messages
Support
- Issues: GitHub Issues
- Groq Documentation: Groq Docs
- Home Assistant Community: Community Forum
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This integration is licensed under the Apache License 2.0, the same license as Home Assistant.
Acknowledgments
- Built for Home Assistant
- Powered by Groq
- Inspired by the OpenAI Conversation integration
Disclaimer
This is a custom integration and is not officially affiliated with or endorsed by Groq or Home Assistant.