ChatGPT Integration with Home Assistant

What is OpenAI ChatGPT Integration?

The OpenAI Conversation integration brings the power of ChatGPT directly into Home Assistant. This allows you to create natural language automations, build conversational voice assistants, and even have ChatGPT help control your smart home devices.

What You Can Do

  • Voice Control: “Turn off all the lights in the living room and set the thermostat to 72”
  • Smart Queries: “What rooms have lights currently on?”
  • Natural Language Automations: “If I leave home after 8 AM, remind me to turn off the coffee maker”
  • Context-Aware Responses: “What is the temperature in the bedroom?” → ChatGPT reads the sensor value
  • Complex Commands: “Set up a romantic movie night scene”

Prerequisites

  • Home Assistant 2023.1 or newer
  • OpenAI API account (free tier available)
  • Credit card for API billing (typically $1-5 per month for moderate use)

Step 1: Get Your OpenAI API Key

  1. Go to platform.openai.com/signup
  2. Create an account or log in
  3. Navigate to API Keys section
  4. Click Create new secret key
  5. Name it “Home Assistant”
  6. Copy the key immediately (you cannot view it again!)
  7. Store it securely (password manager recommended)

Set Up Billing

  1. Go to Billing → Payment methods
  2. Add a credit card
  3. Set a usage limit (recommended: $10/month to prevent surprises)
  4. OpenAI charges per token used (~$0.002 per 1,000 tokens)

Step 2: Add OpenAI Integration to Home Assistant

  1. In Home Assistant, go to Settings → Devices & Services
  2. Click Add Integration
  3. Search for OpenAI Conversation
  4. Paste your API key
  5. Click Submit

Configure the Integration

  1. After adding, click Configure on the OpenAI integration
  2. Choose your model:
    • gpt-4-turbo: Most capable, higher cost (~$0.01 per 1K tokens)
    • gpt-3.5-turbo: Fast and affordable (~$0.002 per 1K tokens)
    • gpt-4o-mini: Balanced option (recommended)
  3. Set Max Tokens: 150-300 (limits response length)
  4. Set Temperature: 0.5 (lower = more consistent, higher = more creative)
  5. Save configuration

Step 3: Set OpenAI as Default Conversation Agent

  1. Go to Settings → Voice assistants → Conversation
  2. Under Conversation Agent, select OpenAI Conversation
  3. Save

Using ChatGPT in Home Assistant

Voice Commands via Mobile App

  1. Open Home Assistant Companion app
  2. Tap the microphone icon
  3. Speak your command naturally
  4. ChatGPT processes and executes the action

Text-Based Commands

  1. Go to Settings → Voice assistants
  2. Click Assist tab
  3. Type your command in natural language
  4. ChatGPT responds and executes actions

Exposing Entities to ChatGPT

By default, not all entities are exposed to ChatGPT. Configure what it can control:

  1. Go to Settings → Voice assistants → Expose
  2. Toggle which entities ChatGPT can access
  3. Recommended to expose lights, switches, locks, climate controls, and sensors
  4. Do NOT expose: Security system arm/disarm, garage doors, or other sensitive devices unless you specifically want voice control

Cost Management

Monitor API Usage

  • Check usage at platform.openai.com/usage
  • Set up billing alerts in OpenAI dashboard
  • Review monthly costs (typical: $2-10/month for moderate use)

Optimize Costs

  • Use gpt-3.5-turbo instead of gpt-4 (75% cheaper)
  • Set lower max_tokens (150-200 is usually enough)
  • Limit exposed entities to reduce context size
  • Use custom sentences for repetitive commands instead of ChatGPT

Privacy Considerations

  • Data sent to OpenAI: Your commands, entity names, and states
  • Not sent: Video feeds, images, sensitive credentials
  • Stored: OpenAI retains conversation logs (per their privacy policy)
  • Alternative: Use local LLMs via Home LLM or LocalAI for complete privacy

Troubleshooting

ChatGPT Does Not Control Devices

  • Verify entities are exposed: Settings → Voice assistants → Expose
  • Check entity names are clear and descriptive
  • Ensure OpenAI is set as default conversation agent
  • Review Home Assistant logs for errors

“I Do Not Have Access to That Entity”

  • Entity is not exposed to ChatGPT
  • Go to Settings → Voice assistants → Expose → Enable the entity
  • Restart the conversation integration

High API Costs

  • Switch to gpt-3.5-turbo model
  • Reduce max_tokens to 150
  • Unexpose unnecessary entities
  • Use custom sentences for common commands
  • Set OpenAI usage limit to $10/month

Related Tutorials

Conclusion

ChatGPT integration transforms Home Assistant into a conversational smart home. Natural language commands make your smart home more accessible to everyone in the household—no need to memorize entity names or learn YAML syntax.

Start with simple commands like “turn off the lights,” then gradually explore more complex conversational automations. The possibilities are endless!