# Home Assistant MCP for AI Agents AI Agent Connect

> Home Assistant MCP connects your AI agent to your smart home setup. It lets you control lights, thermostats, and media players while checking sensor data or running automations through your Home Assistant instance. It works with both local setups and Nabu Casa cloud.

## Overview
- **Category:** superpower
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_PFndzyBgm6EFRgWmvVvPuFq5L6pWhKzeDkkABGnT/ai-agent-connect
- **Tags:** smart-home, home-automation, device-control, local-control, automation-triggers

## Description

The Home Assistant MCP bridges the gap between your AI client and your Home Assistant instance, giving it the eyes and hands it needs to manage your environment. You can tell it to dim the lights in the den, set the guest room temperature, or ask what's on the calendar for tonight. It handles the heavy lifting of interacting with the Home Assistant REST API so you don't have to. Whether you're managing a single apartment or a large property with multiple zones, this connection makes your home feel truly responsive. It makes it easier to manage complex routines when your agent can see every entity and trigger specific services on demand. It's one of the most practical ways to use the Vinkius catalog to turn a standard AI into a functional smart home controller. You won't have to worry about the underlying API calls or the complexity of the JSON payloads. This tool lets you focus on the result, like having the lights turn on as you walk into a room or getting a summary of your home's status before you head out for the day. It's about moving from manually controlling a smart home to actually living in an automated one.

## Tools

### get_api_status
Check if your Home Assistant instance is online before trying other commands. This confirms your connection is active.

### get_calendar_events
Pull specific events from your Home Assistant calendars. Use this to check your daily schedule.

### list_ha_calendars
See a list of all calendars currently configured in your home setup. This helps you find the right schedule.

### call_ha_service
Execute specific actions like turning on a light or setting a temperature. This is the primary control tool.

### check_ha_configuration
Verify that your Home Assistant configuration is valid and error-free. Use this to troubleshoot setup issues.

### list_ha_components
See all the loaded integrations and components currently running. This helps you see what's active in your home.

### get_ha_config
Pull the full configuration details from your Home Assistant instance. This provides deep system insights.

### list_ha_events
See a list of all event types your home is currently tracking. Use this to understand your system's triggers.

### fire_ha_event
Trigger a custom event to start an automation or script. Use this to activate your pre-built routines.

### get_entity_state
Get the current status of a specific light, sensor, or switch. Use this for quick status checks.

### get_entity_history
Look up past state changes for a specific device to find trends. This is great for analyzing energy use.

### get_logbook_entries
Fetch entries from the logbook to see what happened in your home recently. This provides a history of activity.

### render_ha_template
Run Jinja2 templates to get complex data from your home state. This lets you access advanced system values.

### list_available_services
See all the actions you can perform across different home domains. This is essential for discovery.

### list_entity_states
Get a full list of every device and its current status in your home. This gives your agent a complete overview.

## Prompt Examples

**Prompt:** 
```
Is the front door locked and what's the temperature in the nursery?
```

**Response:** 
```
Checking your home status now.

| Status | Detail |
| :--- | :--- |
| **Front Door** | Locked |
| **Nursery Temp** | 72°F |
| **Humidity** | 45% |

All systems look normal.
```

**Prompt:** 
```
Turn off all the lights in the kitchen and set the thermostat to 68 degrees.
```

**Response:** 
```
Done. I've turned off the kitchen lights and set the thermostat to 68°F.

* **Kitchen Lights**: Off
* **Thermostat**: 68°F
```

**Prompt:** 
```
What happened in the living room last night?
```

**Response:** 
```
Here are the logbook entries for the living room from last night:

* **8:00 PM**: Motion detected
* **8:05 PM**: Living room light turned on
* **11:30 PM**: Living room light turned off
```

## Capabilities

### Turn lights and switches on or off
Control the power state of any connected bulb, plug, or switch in your home.

### Adjust thermostat temperatures and HVAC modes
Set the heat or cooling levels for different rooms through natural language.

### Open and close window covers or garage doors
Manage your blinds, curtains, and garage doors with simple commands.

### Check real-time sensor data like temperature or motion
Get live updates on your home's environment from various sensors.

### Query historical state changes and logbook entries
Look back at what happened in your home at specific times in the past.

### Manage and view calendar events
Access your home's calendar to check schedules or plan upcoming activities.

### Trigger custom automations and scripts
Fire off specific routines and scripts you've already built in your system.

## Use Cases

### Checking the house before leaving
A user asks if the garage is open and if the lights are off. The agent uses get_entity_state to confirm everything is secure before they head out.

### Setting the mood for dinner
A user says 'Make it cozy in the dining room.' The agent calls several services to dim lights and close the blinds automatically.

### Reviewing energy trends
A user asks about the heater's behavior last week. The agent uses get_entity_history to show the temperature fluctuations and usage patterns.

### Managing a rental property
A manager asks for the status of all thermostats in the guest house. The agent lists the states for all climate entities in one go.

## Benefits

- Manage multiple devices at once by using call_ha_service to group actions like turning off all lights in a room, which saves you from clicking every single switch manually.
- Monitor your home's status in real time by asking your agent to list_entity_states or check specific sensors, giving you an instant update on your home's current environment.
- Analyze home trends by using get_entity_history to see how temperatures or power usage change over time, helping you identify patterns in your energy consumption or climate.
- Simplify your schedule by using get_calendar_events to check your daily plans without leaving your chat, making it easy to stay organized while you're busy with other tasks.
- Run complex logic by using render_ha_template to pull specific data points from your home state, allowing your agent to handle advanced calculations without needing extra code.
- Stay informed on home activity by fetching logbook_entries to see who entered the house or when a device triggered, providing a clear history of what happened while you were away.

## How It Works

The bottom line is you get a voice-activated or text-based remote for your entire smart home.

1. Subscribe to the Home Assistant MCP on Vinkius.
2. Provide your Home Assistant URL and a Long-Lived Access Token.
3. Start giving your AI client commands like turn off the kitchen lights.

## Frequently Asked Questions

**Can the Home Assistant MCP control my lights and thermostat?**
Yes, it gives your agent the ability to turn lights on or off, adjust brightness, and set temperatures for your climate devices.

**Does this work with my local Home Assistant setup?**
It works perfectly with local instances. You just need to provide your local IP address and your long-lived access token.

**Can I use the Home Assistant MCP to check my home security sensors?**
Yes, your agent can check the real-time state of binary sensors, motion detectors, and door contacts to keep you informed.

**How do I connect my Home Assistant to my AI client?**
You just need to subscribe to this Connector on Vinkius and enter your Home Assistant URL and access token in the configuration.

**Can it see my home's calendar events?**
It can pull and list calendar events from your Home Assistant setup, making it easy to ask your agent about your daily schedule.

**Is it possible to trigger my existing automations with this?**
Yes, your agent can fire custom events that trigger the automations and scripts you've already built in Home Assistant.

**What Home Assistant URL should I use?**
For local instances, use your Home Assistant's local network URL: `http://YOUR_IP:8123` (or `http://homeassistant.local:8123`). For cloud access via Nabu Casa, use your remote URL: `https://YOUR_INSTANCE.ui.nabu.casa`. The API is accessible at the same base URL as your Home Assistant frontend.

**How do I get a Long-Lived Access Token?**
Log in to your Home Assistant web interface, go to your user profile (click your name in the sidebar, then **Profile**), scroll down to **Long-Lived Access Tokens**, click **Create Token**, give it a name (e.g., 'Connector'), and copy the generated token. This token never expires unless manually revoked.

**What devices and integrations are supported?**
All Home Assistant integrations are supported since the API works at the service/state level. This includes lights (Philips Hue, LIFX, etc.), thermostats (Nest, Ecobee, etc.), covers/blinds, switches, media players (Sonos, Chromecast, etc.), sensors, cameras, locks, vacuums, and 1000+ other integrations. Use `list_entity_states` to discover all available entities.

**Can I trigger Home Assistant automations from the API?**
Yes! You can trigger automations in multiple ways: 1) Call the `automation.trigger` service directly, 2) Fire a custom event using `fire_ha_event` that matches an event trigger in your automation, 3) Call the `script.turn_on` service to run scripts. You can also control devices directly which will trigger related automations.