Skip to content

dzerik/ha-smartchain

Repository files navigation

en ru

SmartChain

Multi-provider LLM conversation agent for Home Assistant

HACS GitHub release

Overview

SmartChain is a Home Assistant custom integration that provides an intelligent voice/conversation assistant powered by multiple LLM providers through LangChain. It also ships a sidebar panel for camera image analysis.

Supported providers:

  • GigaChat (Sber) — Russian-focused LLM with vision support
  • YandexGPT — Yandex Cloud LLM
  • OpenAI — GPT-4.1, GPT-4o, o3, o4-mini
  • Ollama — local models (Llama, Qwen, Gemma, T-Pro, DeepSeek, Home-3B)
  • DeepSeek — cheapest cloud provider (V3, R1)
  • Anthropic — Claude (Sonnet, Haiku, Opus)

Key Features

Conversation

  • 6 LLM providers — cloud and local, switch without losing configuration
  • Multiple agents — different models and prompts per provider (sub-entries)
  • Streaming responses — real-time token-by-token output
  • Device control — Assist API (tool calling): lights, switches, locks, climate
  • Multi-agent — task delegation between agents
  • State history — LLM analyzes past events and trends
  • MCP servers — connect external tools via Model Context Protocol
  • Vision — camera image analysis via multimodal models
  • Skill system — loadable YAML files with additional knowledge
  • Prompt caching — token savings on repeated requests
  • Chat history — multi-turn conversations with context
  • Jinja2 templates — customizable system prompt with device context

Services

  • smartchain.ask — send a message to LLM from automations (Telegram, Slack, etc.)
  • smartchain.analyze_image — camera snapshot → multimodal LLM → response
  • AI Task entity — structured data generation for automations

SmartChain AI Panel

  • Sidebar panel with a camera analysis tab
  • Pick any HA camera, ask the LLM a natural-language question about the snapshot
  • Result is mirrored to the smartchain_image_analyzed event and sensor.smartchain_last_analysis

Note: The YAML automation/script/scene/blueprint generation feature was removed in v4.0.0. See CHANGELOG.md for migration details.

Installation

Requirements

  • Home Assistant 2024.12.0+
  • HACS installed

Install via HACS

  1. Add this repository as a custom HACS repository: https://github.com/dzerik/ha-smartchain
  2. Search for "SmartChain" in HACS
  3. Install and restart Home Assistant

Quick Start

1. Add Integration

Settings > Devices & Services > Add Integration > SmartChain

2. Select Provider and Enter Credentials

Provider What you need
GigaChat Auth credentials from developers.sber.ru
YandexGPT API Key + Folder ID from Yandex Cloud
OpenAI API key from platform.openai.com
Ollama Base URL (default: http://localhost:11434)
DeepSeek API key from platform.deepseek.com
Anthropic API key from console.anthropic.com

3. Configure Options

  • Model — select from list or type custom model name
  • Assist API — enable device control via LLM tool calling
  • System Prompt — customize the assistant's behavior
  • State History Tool — enable past event analysis

4. Activate Assistant

Settings > Voice Assistants > Add — select your SmartChain entity as the conversation agent.

5. Open SmartChain AI Panel

Click SmartChain AI in the Home Assistant sidebar to open the camera analysis panel.

SmartChain AI Panel - Analyze Camera

Documentation

Full user guide with all features: docs/USER_GUIDE.md

Topics:

  • Multiple agents and multi-agent delegation
  • Device control (Assist API)
  • State history tool
  • MCP servers
  • Vision (camera image analysis)
  • Skill system (YAML)
  • SmartChain AI Panel (camera analysis)
  • smartchain.ask service (Telegram, Slack)
  • smartchain.analyze_image service
  • AI Task for automations
  • System prompt customization
  • Parameter and model reference

License

MIT

About

SmartChain — multi-provider LLM conversation agent for Home Assistant (GigaChat, YandexGPT, OpenAI) with tool calling and streaming

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors