Логотип Home Assistant Best Practices

Home Assistant Best Practices

Организация
homeassistant-ai
home-assistant-best-practices

Рекомендации по автоматизациям, помощникам, сценариям и панелям Home Assistant. ВЫЗЫВАЙТЕ ЭТОТ НАВЫК, КОГДА: - Создаёте или редактируете автоматизации, сценарии, сцены, панели или blueprint - Выбираете шаблонные датчики, помощники или макросы Jinja - Меняете структуру триггеров, условий или режимов; создаёте автоматизации для кнопок, пультов или сущностей событий - Переименовываете сущности или заменяете device_id на entity_id - Ищете типы карточек или документацию по доменам; пишете приложения AppDaemon - Удаляете или восстанавливаете резервную копию либо обновляете Core или ОС ПРОБЛЕМЫ: - Шаблоны Jinja2 используются там, где есть встроенные возможности - Вместо entity_id используется device_id - Идентификаторы сущностей изменены без проверки зависимостей - Выбран неверный режим автоматизации - Используется необработанный датчик или заданное вручную значение вместо помощника - Напрямую редактируются файлы .storage или создаются фрагменты YAML - Пользователю предлагают редактировать configuration.yaml для интеграций через интерфейс - В Blueprint заданы сущности без возможности выбора или пропущены селекторы - Изменено существующее состояние без способа восстановления - Код Jinja скопирован из одного шаблона в другой

Add to TypingMind

Обзор

Издательhomeassistant-ai
Репозиторийskills
Название навыкаhome-assistant-best-practices
Звёзды
807
Форки
33
Файлы в комплекте
15
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 15

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — homeassistant-ai. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Home Assistant Best Practices в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/homeassistant-ai/skills/tree/main/skills/home-assistant-best-practices
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/homeassistant-ai/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/home-assistant-best-practices .claude/skills/home-assistant-best-practices
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Home Assistant Best Practices в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Home Assistant Best Practices, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Home Assistant Best Practices не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Home Assistant Best Practices

Core principle: Use native Home Assistant constructs wherever possible. Templates bypass validation, fail silently at runtime, and make debugging opaque.

No tool reaches the HA API? Do not stop to ask for access. If you can drive a browser on the HA web UI, make the change there, but first show the user the exact change and wait for their OK before you save: approving a click does not show them what it writes. Otherwise give the user the complete config to create in the UI (for an automation, the YAML for the editor's Edit in YAML mode; for a helper, its form fields), and name the entity IDs you assumed. Config that can only be written in YAML is edited with the File editor app (or in the config folder on a Container install): keep a copy of the file first, then check the configuration and run the matching reload in the YAML tab of Tools (named Developer Tools before 2026.8; restart if it isn't listed).

A feature marked with a release (2026.5+) depends on the instance's version. Read it before choosing: version in GET /api/config, or Settings → About in the UI. On that release or later, use the feature and do not offer the older way as an equal choice. If you cannot read the version, assume a current release and name the older fallback with the version it needs.

Read the matching reference before you answer. This page only summarizes the files in Reference Files; the exact keys, fields and working examples are in them. Read every file whose row matches the task, and only those: do not load all reference files upfront.

Decision Workflow

Follow this sequence when creating any automation:

0. Gate: modifying existing config?

If your change affects entity IDs, display names, or cross-component references — renaming entities or devices, replacing template sensors with helpers, converting device triggers, or restructuring automations — read safe-refactoring first. That reference covers impact analysis, device-sibling discovery, display-name overrides, and post-change verification. Complete its workflow before proceeding.

Steps 1-5 below apply to new config or pattern evaluation.

1. Check for a purpose-specific, then generic native, trigger/condition

Since 2026.7 the default building blocks are purpose-specific triggers/conditions — <domain>.<name> keys (motion detected, battery low, door opened) with area/floor/label targets. Check for one that matches the intent first, then a generic native trigger/condition, and only then a template. Read triggers-and-conditions #purpose-specific-triggers--conditions-default-since-20267 before writing the trigger.

A purpose-specific trigger takes entity_id in its target: as well, so one known sensor is not a reason to fall back to trigger: state. Write the automation with the purpose-specific trigger; do not offer it only as an optional upgrade.

Common substitutions:

  • trigger: state on a motion, occupancy or door binary_sensor → motion.detected/motion.cleared, occupancy.detected/occupancy.cleared or door.opened/door.closed with target: {entity_id: ...}, or area_id when the area is known
  • List of individual sensor entities in a trigger → one purpose-specific trigger with an area/floor/label target:
  • delay after motion.detected for "no motion anywhere for N minutes" → motion.cleared with options: {behavior: all, for: ...}, which fires once every targeted sensor has been clear that long (unavailable and unknown sensors are left out of the count)
  • {{ states('x') | float > 25 }} → numeric_state condition with above: 25
  • {{ is_state('x', 'on') and is_state('y', 'on') }} → condition: and with state conditions
  • {{ now().hour >= 9 }} → condition: time with after: "09:00:00"
  • wait_template: "{{ is_state(...) }}" → wait_for_trigger with state trigger (caveat: different behavior when state is already true — see safe-refactoring #trigger-restructuring)

2. Check for built-in helper or Template Helper

Read helper-selection before creating a template sensor.

Common substitutions:

  • Sum/average multiple sensors → min_max integration
  • Binary any-on/all-on logic → group helper
  • Rate of change → derivative integration
  • Cross threshold detection → threshold integration
  • Consumption tracking → utility_meter helper

If no built-in helper fits, use a Template Helper — not YAML. Create it via the HA config flow (programmatically or in the UI: Settings → Devices & Services → Helpers → Create Helper → Template). A flow-created helper is UI-editable; a template: YAML entry needs a template.reload and is not.

Write template: YAML when the user asks for it, when neither path is available, or when the config needs a key the flow has no field for — trigger-based templates and attributes: are the common ones. Then use managed YAML editing (yaml-only-integrations), not a hand-edit.

3. Select correct automation mode

Default single mode is often wrong. See automation-actions #automation-modes.

ScenarioMode
Motion light with timeoutrestart
Sequential processing (door locks)queued
Independent per-entity actionsparallel
One-shot notificationssingle

4. Use entity_id over device_id

device_id breaks when devices are re-added. See device-control.

Exception: Zigbee2MQTT autodiscovered device triggers are acceptable.

5. For buttons and remotes

  • Any integration exposing an event.* entity: Use event.received targeting that entity (see the anti-pattern row below)
  • ZHA: No event entities — use an event trigger with device_ieee (persistent)
  • Z2M: Event entities are experimental and off by default — use a device trigger (autodiscovered) or mqtt trigger

Read device-control #buttonremote-patterns before writing the trigger.


Critical Anti-Patterns

Anti-patternUse insteadWhyReference
condition: template with float > 25condition: numeric_stateValidated at load, not runtimetriggers-and-conditions #native-conditions
wait_template: "{{ is_state(...) }}"wait_for_trigger with state triggerEvent-driven, not polling; waits for change (see safe-refactoring #trigger-restructuring for semantic differences)automation-actions #wait-actions
device_id in triggersentity_id (or device_ieee for ZHA)device_id breaks on re-adddevice-control #entity-id-vs-device-id
event trigger on an integration's bus event (e.g. hue_event) for a button that has an event.* entityevent.received targeting that entity, with values read from its event_types attributeThe entity can be renamed and survives a re-add when the integration keeps a stable unique ID; bus event data differs per integrationdevice-control #buttonremote-patterns
numeric_state trigger driving a costly action, unguardedCondition rejecting unavailable/unknown in trigger.from_stateA restart or blip re-arms the trigger, so an unchanged value fires with no crossing (the guard also drops real crossings)triggers-and-conditions #unavailable-arms-a-numeric-state-trigger
mode: single for motion lightsmode: restartRe-triggers must reset the timerautomation-actions #automation-modes
enabled: false as a top-level key in automations.yamlautomation.turn_off (temporary) or entity registry disable (permanent)Not a valid top-level key — rejected during schema validation; automation loads as unavailableautomation-actions #disabling-automations
Template sensor for sum/meanmin_max helperDeclarative, handles unavailable stateshelper-selection #numeric-aggregation
Template binary sensor with thresholdthreshold helperBuilt-in hysteresis supporthelper-selection #threshold
Renaming entity IDs without impact analysisFollow safe-refactoring workflowRenames break dashboards, scripts, scenes, Config-Entry data, and storage dashboards silentlysafe-refactoring #entity-renames
Renaming members of Config-Entry-based groups (UI groups) without updating membershipUpdate group membership via Options Flow after the registry renameThe entity registry rename does not update options.entities in the Config Entry — group silently breakssafe-refactoring #config-entry-groups
Renaming entities used by Min/Max helpers or custom Config-Entry integrations (e.g. Better Thermostat) without checking their Config-Entry dataScan the config entries' data+options; re-select the renamed entity in the Min/Max Options Flow. An integration that keeps it in data (Better Thermostat) has no API fix: tell the user and take a full backup before the renameThey store entity_ids in the Config Entry, and a registry rename does not update them; single-source helpers such as Threshold (since 2025.6) and Generic Thermostat update themselvessafe-refactoring #config-entry-data--blind-spots-for-entity-registry-renames
template: sensor/binary sensor in YAMLTemplate Helper via the config flowA flow helper reloads in place and stays UI-editable; a template: entry needs a config reload and does not. Exceptions are real — trigger-based templates and attributes: have no flow fieldhelper-selection #template-helpers
Editing .storage/ files or other HA internal state directlyUse the HA REST/WebSocket API to manage state and config entries.storage/ files are HA's internal state database; direct edits bypass validation, risk corruption, and can be silently overwritten by HA—
Writing raw YAML to configuration.yaml by hand for YAML-only integrationsUse managed YAML config editing with backup and validationUnmanaged writes risk syntax errors, have no backup, and skip check_config — managed editing provides all threeyaml-only-integrations
Generating YAML snippets for automations/scripts/scenesUse the HA config API to create automations/scripts programmatically; with no API access, give the config for the UI editor insteadAPI calls validate config, avoid syntax errors, and don't require manual file edits or restartstriggers-and-conditions, automation-actions, examples.yaml
Telling user to edit configuration.yaml for integrationsDirect user to Settings > Devices & Services in the HA UIMost integrations are UI-configured; YAML integration config is rare and integration-specific—
Referring to HA "add-ons"Use the term "Apps"HA renamed add-ons to Apps in 2026.2 — "Apps are standalone applications that run alongside Home Assistant"—
vacuum.send_command with vendor room IDsvacuum.clean_area with HA area IDs in cleaning_area_id (if segments are mapped)Uses native HA areas, works across integrations — but requires segment-to-area mapping in entity settings firstdevice-control #vacuum-control
Using color_temp (mireds) in light actionsUse color_temp_kelvin with the value converted: Kelvin = 1,000,000 ÷ mireds (500 mireds = 2000 K)The color_temp parameter was removed in 2026.3; only Kelvin is supported, and HA accepts any positive number there, so a mireds value copied across is read as Kelvin (500 mireds becomes 500 K)device-control #lights
Saving states or attributes in variables:, or hard-coding values, to put devices back after a temporary changescene.create with snapshot_entities before the change, then scene.turn_on on that sceneThe snapshot keeps each entity's own state, including a light that was off, in one call; variables need a template per attribute and a restore step per entityscenes #snapshot--restore-scenecreate
Person/Device Tracker entered_home/left_home device triggers or is_home/is_not_home conditionsstate trigger to: home / to: not_home, or state conditionThese were removed in 2026.5 — state triggers and conditions are the correct replacementstriggers-and-conditions #presence-and-person-triggers-and-conditions-removed-in-20265
Entity list in a trigger where an area/floor/label target fitsPurpose-specific trigger with target: {area_id: ...}Automation follows area membership as devices change — no stale entity liststriggers-and-conditions #purpose-specific-triggers--conditions-default-since-20267
Old purpose-specific keys (battery.low, vacuum.docked, timer.time_remaining, ...) or trigger behavior: any/lastRenamed 2026.7 keys (battery.became_low, ...) and behavior: each/all (renamed 2026.6)Old keys no longer load; old behavior values raise a repair issue and face removaltriggers-and-conditions #purpose-specific-triggers--conditions-default-since-20267
AppDaemon: callbacks in __init__, uncancelled run_in timers, state in instance variables, hardcoded entity IDsRegister in initialize(), cancel before rescheduling, persist via input_* helpers, pass IDs through self.argsEach fails silently, resets on reload, or blocks reuseappdaemon #appdaemon-specific-anti-patterns
Blueprints: hardcoded entities, free text where a selector belongs, !input inside a template, missing source_urlTyped !input selectors; bind an input to variables: before templating it; always set source_urlHardcoding defeats reuse, text lets typos through, and !input is a YAML tag rather than a template valueblueprint-guide #common-pitfalls
Backups: full restore to undo one object edit, no backup before an irreversible operation (registry deletion, integration removal, Core/OS upgrade), calling an action "reversible" without naming its inverseRoll the single object back; take the backup before; name the exact inverse or treat it as irreversibleA full restore reverts every unrelated change since and restarts HA; a backup taken afterward captures the damagebackups #when-a-full-backup-earns-its-cost
Restoring a backup, deleting a backup, or upgrading Core or the OS without explicit user confirmationAsk, name the concrete effect, and wait for an answer — every time, backup or notA full restore discards everything since the archive for all restored parts and restarts HA; a Supervisor partial restore overwrites only the selected archive parts; deletion destroys a recovery point; a Core/OS upgrade is high-impact and its recovery path IS the pre-upgrade backupbackups
The same non-trivial Jinja expression repeated across templatesOnce a native trigger/condition and a built-in helper are ruled out, define it once as a macro in config/custom_templates/*.jinja and import itOne definition to fix when the rule changes, instead of copies that drift aparttemplate-guidelines #reusable-macros
trigger, this, value_json, or a {% set %} variable used inside an imported macroPass it to the macro as an argumentAn import does not carry the caller's context — the variable is undefined inside the macro, so it renders empty and any attribute access on it errors (HA's own functions like states are globals and do work)template-guidelines #imports-do-not-carry-the-callers-context

Reference Files

Read each file whose row matches the task before you answer:

FileWhen to read
safe-refactoringRenaming entities or their display names, replacing helpers, restructuring automations, or any modification to existing config
triggers-and-conditionsWriting an automation's triggers or conditions: purpose-specific and native triggers/conditions, for: durations, trigger IDs
automation-actionsWriting the actions of an automation or script, or choosing its mode: waits, variables, capturing action responses, continue_on_error, admin-only actions (Unauthorized) in scripts, stopping a sequence, repeat, if/then vs choose, parallel; documenting/annotating steps; disabling automations
helper-selectionDeciding whether to use a built-in helper vs template sensor — aggregation, rate of change, thresholds, time-in-state, counting/timing, scheduling, grouping, probabilistic inference, smoothing, climate, domain conversion, decision matrix
template-guidelinesConfirming templates ARE appropriate for a use case; sharing Jinja logic between templates with custom_templates macros
yaml-only-integrationsCreating or editing YAML-only integrations that have no config flow (e.g. command_line, platform-based mqtt, rest)
device-controlWriting actions, button/remote automations, or using target:
scenesAuthoring or activating scenes; snapshot/restore patterns, including putting devices back the way they were after a temporary change; snapshot-vs-script distinction
dashboard-guideDesigning or modifying Lovelace dashboards — layout, view types, strategies, sections, cards, badges, CSS styling, HACS
dashboard-cardsLooking up available card types or fetching card-specific documentation
domain-docsLooking up integration/domain documentation, or the dedicated doc page for a specific trigger, condition, or action
examples.yamlNeed compound examples combining multiple best practices
appdaemonAppDaemon apps: when to use vs. native HA, app structure, actions, scheduling, error handling, safe refactoring impact
blueprint-guideAuthoring reusable blueprints: metadata & source_url, inputs & selectors, target vs entity, defaults, input sections, !input templating, versioning
backupsDeciding whether an operation needs a backup first; choosing between a full restore, a partial restore, and rolling one object back; what an archive actually contains; encryption keys and the emergency kit; restore verification; what HA does and does not protect when deleting a backup; whether a git config repo replaces a full backup

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Home Assistant Best Practices?

Рекомендации по автоматизациям, помощникам, сценариям и панелям Home Assistant. ВЫЗЫВАЙТЕ ЭТОТ НАВЫК, КОГДА: - Создаёте или редактируете автоматизации, сценарии, сцены, панели или blueprint - Выбираете шаблонные датчики, помощники или макросы Jinja - Меняете структуру триггеров, условий или режимов; создаёте автоматизации для кнопок, пультов или сущностей событий - Переименовываете сущности или заменяете device_id на entity_id - Ищете типы карточек или документацию по доменам; пишете приложения AppDaemon - Удаляете или восстанавливаете резервную копию либо обновляете Core или ОС ПРОБЛЕМЫ: -...

Зачем использовать Home Assistant Best Practices в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Home Assistant Best Practices — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Home Assistant Best Practices в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/homeassistant-ai/skills/tree/main/skills/home-assistant-best-practices. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Home Assistant Best Practices?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Home Assistant Best Practices?

С любым количеством. В TypingMind вы можете использовать Home Assistant Best Practices с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Home Assistant Best Practices?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — homeassistant-ai. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все
Логотип anthropics

Doc Coauthoring

anthropics
ОрганизацияПопулярный

Проведите пользователя через структурированный процесс совместной подготовки документации. Используйте навык для написания документации, предложений, технических спецификаций, документов с решениями и других структурированных материалов. Этот…

21.8K
184K
Инструкции
Открыть
Логотип vercel

Authoring Skills

vercel
ОрганизацияПопулярный

Как создавать навыки агента и поддерживать их в актуальном состоянии в .agents/skills/. Используйте этот навык при создании SKILL.md, написании описаний навыков, выборе полей frontmatter или определении того, что должно входить в навык, а что…

34.7K
143.1K
Инструкции
Открыть
Логотип vercel

Dce Edge

vercel
ОрганизацияПопулярный

Шаблоны вызова require(), безопасные для DCE, и ограничения edge runtime. Используйте при написании условных вызовов require(), защите импортов, доступных только в Node (например, node:stream), или редактировании define-env-plugin.ts / app-render /…

34.7K
143.1K
Инструкции
Открыть
Логотип vercel

Gh Stack

vercel
ОрганизацияПопулярный

Управляет стековыми PR и разбивает многоэтапную работу на ветки, удобные для ревью, с помощью gh-stack. Используйте для создания и просмотра стека, редактирования, отправки, публикации, синхронизации, перебазирования, слияния или переключения на него; когда просят разделить работу или…

34.7K
143.1K
Файлы: 3
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇