Releases: dzerik/ha-smartchain
v4.4.1
Full Changelog: v4.4.0...v4.4.1
v4.0.1 — Drop YAML generation feature
⚠ Breaking release. This is the first v4 release. The LLM-driven YAML generation feature has been removed. SmartChain is now focused on conversation, AI Task, and camera analysis only. See migration notes below.
Migration
- Remove any HA automations or scripts that call the deleted services.
- If you were generating automations through the SmartChain panel, generate them via the LLM directly (
smartchain.ask) and paste into HA's native automation editor. - The integration's options form will appear as a single screen instead of a menu — no action required.
Removed (v4.0.0)
- Services —
smartchain.generate_automation,smartchain.deploy_automation,smartchain.validate_automation,smartchain.list_yaml,smartchain.get_yaml. Existing automations that call these will fail at runtime. - Options-flow steps —
generate_automationandpreview_automation. The options menu is collapsed to settings only. - Panel components — the YAML editor (sidebar explorer, code editor, AI bar, toolbar, entity picker). The sidebar panel is now camera-analysis only.
- Const prompts —
GENERATE_AUTOMATION_PROMPT,GENERATE_SCRIPT_PROMPT,GENERATE_SCENE_PROMPT,GENERATE_BLUEPRINT_PROMPT,GENERATE_PROMPTS,IMPROVE_YAML_PROMPT. hass.data[DOMAIN]keys —generate_yamlanddeploy_automationare no longer registered.- Translation keys for the dropped flow (
description_required,no_agent,service_not_ready,generation_failed,deploy_failed,empty_yaml,automation_deployed,automation_not_deployed).
Kept
- Conversation entity, AI Task entity, all 6 LLM providers (GigaChat, YandexGPT, OpenAI, Ollama, DeepSeek, Anthropic).
smartchain.askandsmartchain.analyze_imageservices.helpers.async_generate_structured()— generic structured-output helper for downstream integrations (not tied to YAML generation).- Sidebar panel — pruned to the camera analysis tab only.
Bug fixes (v4.0.1)
- GigaChat subentry options silently ignored —
verify_sslandprofanitytoggles set in a subentry's form are now actually applied to the GigaChat client. Previously these were always read from the parent entry's options, so per-subentry values were lost. - Event-loop blocking I/O on first message —
load_skills()(sync YAML reads from disk) is now awaited via the executor inside the conversation entity, preventing the loop from stalling on the first reply. - Event-loop blocking I/O on multimodal messages — when a chat log carries image attachments,
_chatlog_to_langchain()(which reads files and may run TurboJPEG) is now offloaded to the executor. Plain text conversations stay on the event loop with no extra hop. _safe_extract_jsonmangling responses — fence-stripping now drops only the opening```/```jsonfence and a matching trailing```, instead of removing every backtick at either end of the response.
Refactors
- Config-flow model validation — three near-identical model-resolution blocks (
_validate_and_create,_validate_and_update,OptionsFlow.async_step_settings) now share a single_normalize_model_input()helper. common_config_option_schemaalias removed — the dead backwards-compat shim referenced no live consumers after the v4.0.0 cleanup.
Tests: 118 passing (was 128 — 10 tests covering only the removed services were dropped).
Full Changelog: v3.5.1...v4.0.1
v3.5.1
Fix: HA Custom YAML Tags Support
- Validation: now correctly handles
!input,!include,!secretand other HA-specific YAML tags - Blueprint deploy: uses HA's native YAML parser to preserve
!inputreferences - Resilience: gracefully handles corrupted automations.yaml files
v3.5.0
AI Bar UX Redesign
- AI Prompt bar: redesigned layout — 3-row textarea with explicit label, agent/type selectors positioned to the right
- Entity picker: inline mode in modal — shows all entities immediately on open (no need to search first)
- Apply button: adjacent to prompt field for quick access
- Ctrl+Enter: submit prompt shortcut
- Entity limit: increased to 200 in inline/modal mode
v3.4.2 — HA Built-in Editor + Validation
Major: HA Built-in Editor
<ha-code-editor>— uses Home Assistant's native CodeMirror 6 component- Deleted custom IIFE CM6 bundle (441KB saved)
- YAML syntax highlighting — powered by HA's Lezer parser + theme
- Entity autocomplete — from HA's built-in feature
New: Validation Panel
- Errors and warnings displayed below editor with icons
- Click to navigate to matching line in editor
- Smart line detection for entity_id, service, key references
- Auto-clears on text change
Fixes
- Version banner in console:
SMARTCHAIN v3.4.2 - Confirm dialog — inline styles (was outside panel CSS scope)
- Simple LCS-based diff view
🤖 Generated with Claude Code
v2.8.0 — YAML Picker & Editor
What's New
YAML Picker — Load Existing Items (v2.8.0)
- New services:
smartchain.list_yamlandsmartchain.get_yaml— read existing automations, scripts, scenes, and blueprints from YAML files - New panel component
<sc-yaml-picker>— browse, search, and load existing HA items into the editor - Two source modes: "Choose from HA" (picker with search & type grouping) or "Paste YAML" (manual)
- Blueprint protection: blueprint-based automations marked with warning badge; confirm dialog warns about breaking the blueprint link
- Auto-sets type selector when loading from picker
YAML Improve/Edit Mode (v2.7.0)
- "Edit existing YAML" button in the Generate tab — switch between generating new and improving existing YAML
source_yamlparameter ingenerate_automationservice — LLM receives existing YAML + improvement instructionsIMPROVE_YAML_PROMPT— dedicated prompt for editing/fixing existing configurations
HA Standard Context (v2.7.0)
- Replaced custom
_collect_ha_context()with HA Jinja2DEFAULT_DEVICES_PROMPTtemplate rendering — same mechanism as the conversation agent system prompt - Provides richer context: rooms, devices, sensors, device_class, model, units
Bug Fix
- Fixed YAML editor line numbers displaying horizontally instead of vertically (
white-space: pre)
Full Changelog
- 7 services total: ask, analyze_image, generate_automation, deploy_automation, validate_automation, list_yaml, get_yaml
- 8 panel ES module components
- 128 tests passing
v2.6.0 — Multi-type Generation & Modular Panel
New Features
Multi-type YAML Generation
Generate not just automations, but also:
- Scripts — sequences of actions (deploy to
scripts.yaml) - Scenes — entity state snapshots (deploy to
scenes.yaml) - Blueprints — reusable automation templates with configurable inputs (deploy to
blueprints/automation/smartchain/)
Each type has a dedicated LLM prompt optimized for its YAML structure.
Type-aware Validation
validate_automationnow acceptstypeparameter- Validates type-specific required keys:
- Automation:
trigger+action - Script:
sequence - Scene:
entities+name - Blueprint:
blueprint(withdomain,name,input)
- Automation:
- Entity and service validation works across all types
Modular Panel Architecture
Panel decomposed into ES module components for maintainability:
panel/
smartchain-panel.js — orchestrator
styles.js — shared CSS
services.js — HA service helpers
components/
entity-picker.js — <sc-entity-picker>
yaml-editor.js — <sc-yaml-editor>
validation-panel.js — <sc-validation-panel>
generate-tab.js — <sc-generate-tab>
camera-tab.js — <sc-camera-tab>
Panel UX
- Type selector — dropdown to choose Automation/Script/Scene/Blueprint
- Placeholder text and labels adapt per type
- Deploy button label changes per type ("Deploy to HA" / "Save Blueprint")
- All existing features (entity picker, agent select, YAML editor, validation) work across all types
Full Changelog: v2.5.0...v2.6.0
v2.5.0 — Smart Context, Validation & Enhanced Panel
New Features
Smart Context for Automation Generation
- LLM prompt now enriched with real HA entities, areas, and devices from your installation
- Generated automations use actual
entity_ids instead of invented ones - Optional entity picker — select specific entities to narrow LLM context for precise results
Automation Validation
- New
validate_automationservice — check YAML without deploying - Validates: required keys (
trigger/action), entity existence, service availability deploy_automationnow validates before writing — prevents invalid automations- Validation results show detailed errors and warnings
Enhanced Panel UX
- Agent selector — choose which SmartChain agent for generation and camera analysis
- Entity picker with search, domain grouping, and chip tags
- YAML syntax highlighting — color-coded keys, strings, numbers, booleans, entity_ids, comments
- Line numbers in YAML editor
- Edit/Preview toggle — modify generated YAML before deploying
- Validate button — check YAML against your HA instance
- Regenerate button — quick re-generation with same description
- Dark theme support via HA CSS variables
Full Changelog: v2.4.1...v2.5.0
v2.4.1 — Fix automation deploy
Fix
- Automations now correctly deploy to
automations.yamlinstead of.storage/automations- Previously created automations were not visible in HA's Automations UI
- Now uses the same approach as Extended OpenAI Conversation: read/append/write
automations.yaml+automation.reload
- Removed unused
Storeimport and storage constants
Full Changelog: v2.4.0...v2.4.1
v2.4.0 — Custom Sidebar Panel + Deploy Automation
SmartChain AI — Sidebar Panel
Новая страница в боковом меню Home Assistant с двумя вкладками:
Generate Automation
- Опишите автоматизацию на естественном языке
- SmartChain сгенерирует YAML через LLM
- Просмотрите, скопируйте или разверните прямо в HA одной кнопкой
Analyze Camera
- Выберите камеру из списка
- Напишите вопрос/инструкцию
- Получите AI-анализ изображения
New: smartchain.deploy_automation service
service: smartchain.deploy_automation
data:
automation_yaml: |
alias: Morning coffee
trigger:
- platform: time
at: "07:00:00"
action:
- service: switch.turn_on
target:
entity_id: switch.coffee_machineПринимает YAML → записывает в HA storage → reload. Автоматизация сразу появляется в Настройки → Автоматизации.
Details
- Panel как custom web component с нативным доступом к HA
- Адаптивный дизайн, поддержка тёмной/светлой тем HA
- Graceful degradation — если frontend недоступен, panel не регистрируется
- 128 тестов, 4 сервиса (ask, analyze_image, generate_automation, deploy_automation)
🤖 Generated with Claude Code