restart_ha
Restarts Home Assistant to apply changes or resolve issues. Temporarily disrupts all operations.
Instructions
Restart Home Assistant
⚠️ WARNING: Temporarily disrupts all Home Assistant operations
Returns: Result of restart operation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- app/server.py:929-941 (handler)The restart_ha MCP tool handler. Decorated with @mcp.tool() and @async_handler('restart_ha'), it calls restart_home_assistant() from app/hass.py to restart Home Assistant via the homeassistant.restart service.
@mcp.tool() @async_handler("restart_ha") async def restart_ha() -> Dict[str, Any]: """ Restart Home Assistant ⚠️ WARNING: Temporarily disrupts all Home Assistant operations Returns: Result of restart operation """ logger.info("Restarting Home Assistant") return await restart_home_assistant() - app/hass.py:484-487 (helper)The restart_home_assistant helper function that actually calls the Home Assistant API service 'homeassistant.restart' via call_service.
@handle_api_errors async def restart_home_assistant() -> Dict[str, Any]: """Restart Home Assistant""" return await call_service("homeassistant", "restart", {}) - app/server.py:929-929 (registration)Tool registration via @mcp.tool() decorator on the restart_ha function. Also imported in app/server.py from app.hass as restart_home_assistant.
@mcp.tool() - app/server.py:931-941 (schema)The restart_ha function definition, returns Dict[str, Any] (JSON result of restart operation). No input parameters required.
async def restart_ha() -> Dict[str, Any]: """ Restart Home Assistant ⚠️ WARNING: Temporarily disrupts all Home Assistant operations Returns: Result of restart operation """ logger.info("Restarting Home Assistant") return await restart_home_assistant()