Skip to content

Releases: dzerik/ha-smartchain

v4.4.1

28 May 08:23

Choose a tag to compare

v4.0.1 — Drop YAML generation feature

27 Apr 14:23

Choose a tag to compare

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

  1. Remove any HA automations or scripts that call the deleted services.
  2. 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.
  3. The integration's options form will appear as a single screen instead of a menu — no action required.

Removed (v4.0.0)

  • Servicessmartchain.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 stepsgenerate_automation and preview_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 promptsGENERATE_AUTOMATION_PROMPT, GENERATE_SCRIPT_PROMPT, GENERATE_SCENE_PROMPT, GENERATE_BLUEPRINT_PROMPT, GENERATE_PROMPTS, IMPROVE_YAML_PROMPT.
  • hass.data[DOMAIN] keysgenerate_yaml and deploy_automation are 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.ask and smartchain.analyze_image services.
  • 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 ignoredverify_ssl and profanity toggles 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 messageload_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_json mangling responses — fence-stripping now drops only the opening ```/```json fence 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_schema alias 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

13 Mar 11:02

Choose a tag to compare

Fix: HA Custom YAML Tags Support

  • Validation: now correctly handles !input, !include, !secret and other HA-specific YAML tags
  • Blueprint deploy: uses HA's native YAML parser to preserve !input references
  • Resilience: gracefully handles corrupted automations.yaml files

v3.5.0

12 Mar 01:30

Choose a tag to compare

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

12 Mar 01:18

Choose a tag to compare

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

11 Mar 21:33

Choose a tag to compare

What's New

YAML Picker — Load Existing Items (v2.8.0)

  • New services: smartchain.list_yaml and smartchain.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_yaml parameter in generate_automation service — LLM receives existing YAML + improvement instructions
  • IMPROVE_YAML_PROMPT — dedicated prompt for editing/fixing existing configurations

HA Standard Context (v2.7.0)

  • Replaced custom _collect_ha_context() with HA Jinja2 DEFAULT_DEVICES_PROMPT template 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

11 Mar 21:06

Choose a tag to compare

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_automation now accepts type parameter
  • Validates type-specific required keys:
    • Automation: trigger + action
    • Script: sequence
    • Scene: entities + name
    • Blueprint: blueprint (with domain, name, input)
  • 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

11 Mar 20:52

Choose a tag to compare

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_automation service — check YAML without deploying
  • Validates: required keys (trigger/action), entity existence, service availability
  • deploy_automation now 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

11 Mar 20:23

Choose a tag to compare

Fix

  • Automations now correctly deploy to automations.yaml instead 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 Store import and storage constants

Full Changelog: v2.4.0...v2.4.1

v2.4.0 — Custom Sidebar Panel + Deploy Automation

11 Mar 20:16

Choose a tag to compare

SmartChain AI — Sidebar Panel

Новая страница в боковом меню Home Assistant с двумя вкладками:

Generate Automation

  1. Опишите автоматизацию на естественном языке
  2. SmartChain сгенерирует YAML через LLM
  3. Просмотрите, скопируйте или разверните прямо в HA одной кнопкой

Analyze Camera

  1. Выберите камеру из списка
  2. Напишите вопрос/инструкцию
  3. Получите 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