
ha-automation
Create and debug Home Assistant automations, scripts, blueprints, and Jinja2 templates. Use when working with triggers, conditions, actions, automation YAML, scripts, blueprints, or template expressions. Activates on keywords: automation, trigger, condition, action, blueprint, script, template, jinja2.
- Installs
- 89
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/nodnarbnitram/claude-code-extensions --skill ha-automation- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ha-automation automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Home Assistant Automation Expert
Master Home Assistant automations, scripts, blueprints, and Jinja2 templating with confidence.
Before You Start
This skill prevents common automation mistakes including:
- Incorrect trigger syntax - Using deprecated formats or invalid entity IDs
- Missing condition operators - Forgetting
and/or/notconjunctions - Jinja2 template errors - Undefined variables or incorrect filter usage
- Blueprint parameterization issues - Missing
!inputsubstitutions or misaligned selectors
Quick Reference: Automation Structure
Basic Automation Format
automation: !include automations.yaml
Single Automation File
- alias: "My Automation"
description: "What this automation does"
trigger: ...
condition: ...
action: ...
mode: single
Triggers Quick Reference
State Trigger
trigger:
platform: state
entity_id: light.bedroom
from: "off"
to: "on"
for:
minutes: 5
Numeric State Trigger
trigger:
platform: numeric_state
entity_id: sensor.temperature
above: 25
below: 30
Time Trigger
trigger:
platform: time
at: "10:30:00"
Time Pattern Trigger
trigger:
platform: time_pattern
hours: "*/2" # Every 2 hours
minutes: 0
Device Trigger
trigger:
platform: device
device_id: abc123...
domain: light
type: turned_on
Event Trigger
trigger:
platform: event
event_type: call_service
event_data:
domain: light
MQTT Trigger
trigger:
platform: mqtt
topic: home/front_door/status
payload: "opened"
Webhook Trigger
trigger:
platform: webhook
webhook_id: my_webhook_id
Sun Trigger
trigger:
platform: sun
event: sunrise
offset: "-00:30:00" # 30 min before sunrise
Zone Trigger
trigger:
platform: zone
entity_id: device_tracker.john
zone: zone.home
event: enter
Template Trigger
trigger:
platform: template
value_template: "{{ state_attr('light.bedroom', 'brightness') > 200 }}"
Conditions Quick Reference
State Condition
condition:
- condition: state
entity_id: light.bedroom
state: "on"
Numeric State Condition
condition:
- condition: numeric_state
entity_id: sensor.temperature
above: 20
below: 25
Time Condition
condition:
- condition: time
after: "08:00:00"
before: "20:00:00"
weekday:
- mon
- tue
- wed
Sun Condition
condition:
- condition: sun
after: sunrise
before: sunset
Template Condition
condition:
- condition: template
value_template: "{{ states('light.bedroom') == 'on' }}"
Combining Conditions
condition:
- condition: and
conditions:
- condition: state
entity_id: light.bedroom
state: "on"
- condition: numeric_state
entity_id: sensor.temperature
above: 20
condition:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.motion
state: "on"
- condition: state
entity_id: light.bedroom
state: "on"
Actions Quick Reference
Call Service Action
action:
- service: light.turn_on
target:
entity_id: light.bedroom
data:
brightness: 255
color_temp: 366
Call Service (Multiple Targets)
action:
- service: light.turn_on
target:
entity_id:
- light.bedroom
- light.living_room
area_id: downstairs
Choose (If/Then/Else)
action:
- choose:
- conditions:
- condition: state
entity_id: light.bedroom
state: "on"
sequence:
- service: light.turn_off
target:
entity_id: light.bedroom
- conditions:
- condition: state
entity_id: light.bedroom
state: "off"
sequence:
- service: light.turn_on
target:
entity_id: light.bedroom
default:
- service: notification.send
data:
message: "Unable to determine light state"
Repeat (Loop)
action:
- repeat:
count: 3
sequence:
- service: light.toggle
target:
entity_id: light.bedroom
- delay:
seconds: 1
Delay
action:
- delay:
minutes: 5
Wait for Trigger
action:
- wait_for_trigger:
platform: state
entity_id: binary_sensor.motion
to: "off"
timeout:
minutes: 30
- service: light.turn_off
target:
entity_id: light.bedroom
Parallel Actions
action:
- parallel:
- service: light.turn_off
target:
entity_id: light.bedroom
- service: switch.turn_off
target:
entity_id: switch.fan
Automation Modes
mode: single # Default - cancel previous run
mode: restart # Restart on retrigger
mode: queued # Queue up to 10 retriggered runs
mode: parallel # Allow multiple simultaneous runs
mode: queued # with max: 10 # Limit queued runs
Jinja2 Template Cheatsheet
Common Variables
states('entity.id')- Get entity statestate_attr('entity.id', 'attribute')- Get entity attributenow()- Current datetimeas_timestamp('2024-01-01')- Convert to timestamptrigger- Trigger object (if in trigger template)
Filters
{{ value | float(0) }} # Convert to float with default
{{ value | int(0) }} # Convert to int with default
{{ value | round(2) }} # Round to 2 decimal places
{{ value | timestamp_custom("%Y-%m-%d") }} # Format timestamp
{{ value | replace("old", "new") }} # Replace string
{{ value | lower }} # Lowercase
{{ value | upper }} # Uppercase
{{ value | length }} # Get length
{{ list | list }} # Convert to list
Conditionals
{% if states('light.bedroom') == 'on' %}
Light is on
{% elif states('light.bedroom') == 'off' %}
Light is off
{% else %}
Unknown
{% endif %}
Loops
{% for entity in states.light %}
{{ entity.name }}: {{ entity.state }}
{% endfor %}
Math Operations
{{ 5 + 3 }} # Addition
{{ 10 - 4 }} # Subtraction
{{ 3 * 4 }} # Multiplication
{{ 20 / 4 }} # Division
{{ 17 % 5 }} # Modulo (remainder)
String Operations
{{ "hello " + "world" }} # Concatenation
{{ value is string }} # Type checking
{{ value is number }}
{{ value is defined }} # Check if variable exists
{{ value | default("fallback") }} # Provide default
Debugging Templates
Use Developer Tools > Template in Home Assistant UI to test templates in real-time.
Blueprint Creation Basics
Blueprint Structure
blueprint:
name: "Friendly Name"
description: "What this blueprint does"
domain: automation
source_url: "https://github.com/user/repo/path/to/blueprint.yaml"
input:
my_light:
name: "Light to control"
description: "The light entity to control"
selector:
entity:
domain: light
brightness_level:
name: "Brightness"
description: "Brightness percentage (0-100)"
selector:
number:
min: 0
max: 100
unit_of_measurement: "%"
duration:
name: "Duration"
description: "How long to stay on"
selector:
number:
min: 1
max: 60
unit_of_measurement: "minutes"
my_bool:
name: "Enable feature"
selector:
boolean:
trigger: ...
condition: ...
action:
- service: light.turn_on
target:
entity_id: !input my_light
data:
brightness: !input brightness_level
Blueprint Selectors
# Entity selector
selector:
entity:
domain: light
# Device selector
selector:
device:
integration: zwave
manufacturer: Philips
# Area selector
selector:
area:
# Number selector
selector:
number:
min: 0
max: 100
step: 5
unit_of_measurement: "%"
# Text selector
selector:
text:
multiline: true
# Boolean selector
selector:
boolean:
# Select (dropdown)
selector:
select:
options:
- label: "Option 1"
value: "value1"
- label: "Option 2"
value: "value2"
Common Mistakes to Avoid
❌ Don't: Use old trigger format
trigger:
- platform: state
entity_id: light.bedroom
✅ Do: Use nested structure
trigger:
- platform: state
entity_id: light.bedroom
to: "on"
❌ Don't: Mix trigger and condition logic
trigger:
- platform: state
entity_id: light.bedroom
to: "on"
condition:
- condition: state
entity_id: light.bedroom
to: "on" # Redundant!
✅ Do: Use trigger for change detection, condition for state verification
trigger:
- platform: state
entity_id: light.bedroom
condition:
- condition: numeric_state
entity_id: sensor.temperature
above: 20 # Additional check
❌ Don't: Forget entity_id in service calls
action:
- service: light.turn_on
data:
brightness: 255
✅ Do: Specify target entity
action:
- service: light.turn_on
target:
entity_id: light.bedroom
data:
brightness: 255
Best Practices
- Use descriptive alias names - Make automation purposes clear
- Add descriptions - Explain why the automation exists
- Test with Developer Tools - Verify templates before deployment
- Use choose for complex logic - More readable than multiple automations
- Organize by room or function - Use
!includeto split large files - Set appropriate mode - Choose single/restart/queued based on use case
- Add for: condition - Prevent false triggers from brief state changes
- Use templates for flexibility - Enable parameter passing in blueprints
Troubleshooting
Template Shows "Error"
- Check template in Developer Tools > Template
- Verify entity IDs exist:
homeassistant.entity_ids - Use
| default("value")filter for optional attributes
Automation Doesn't Trigger
- Verify entity IDs and state values (case-sensitive)
- Check trigger.yaml syntax with YAML validator
- Review automation logs in Settings > Developer Tools > Logs
Blueprint Input Not Working
- Verify
!input variable_namesyntax (YAML 1.2 tag) - Check selector type matches input type
- Ensure blueprint is in correct folder:
config/blueprints/automation/
Jinja2 Syntax Error
- Check for undefined variables - use
| default() - Verify filter syntax:
value | filter_name(arg) - Don't use quotes inside quotes without escaping
Official Resources
FAQ
What does the ha-automation skill do?
Create and debug Home Assistant automations, scripts, blueprints, and Jinja2 templates. Use when working with triggers, conditions, actions, automation YAML, scripts, blueprints, or template expressions. Activates on keywords: automation, trigger, condition, action, blueprint, script, template, jinja2.
How do I install ha-automation?
Run npx skills add https://github.com/nodnarbnitram/claude-code-extensions --skill ha-automation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ha-automation/ (personal) or .claude/skills/ha-automation/ (project).
Which AI agents can use ha-automation?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ha-automation safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ha-automation?
It is published by nodnarbnitram in nodnarbnitram/claude-code-extensions. It has 89 recorded installs.
More from nodnarbnitram/claude-code-extensions
tauri-v2
nodnarbnitram/claude-code-extensions
Tauri v2+ cross-platform app development with Rust backend. Use when configuring tauri.conf.json, implementing Rust commands ([tauri::command]), setting up IPC patterns (invoke, emit, channels), configuring permissions/capabilities, troubleshooting build issues, or deploying desktop/mobile apps. Triggers on Tauri, src-tauri, invoke, emit, capabilities.json.
code-reviewer
nodnarbnitram/claude-code-extensions
Review code for best practices, security issues, and potential bugs. Use when reviewing code changes, checking PRs, analyzing code quality, or performing security audits.
ha-voice
nodnarbnitram/claude-code-extensions
Configure Home Assistant Assist voice control with pipelines, intents, wake words, and speech processing. Use when setting up voice control, creating custom intents, configuring TTS/STT, or building voice satellites. Activates on keywords: Assist, voice control, wake word, intent, sentence, TTS, STT, Piper, Whisper, Wyoming.
esphome-config-helper
nodnarbnitram/claude-code-extensions
This skill should be used when the user asks to "create an esphome config", "set up an esp32 device", "configure esphome yaml", "add a sensor to esphome", "fix esphome compile error", or mentions "gpio pin assignment", "wifi setup", "ota update", or error messages like "Unknown platform", "GPIO already in use", "Could not compile", or "WiFi connection failed". Provides rapid ESPHome configuration generation, troubleshooting, and validation.
frigate-configurator
nodnarbnitram/claude-code-extensions
Configure Frigate NVR with optimized YAML, object detection, recording, zones, and hardware acceleration. Use when setting up Frigate cameras, troubleshooting detection issues, configuring Coral TPU/OpenVINO, or integrating with Home Assistant.
ha-energy
nodnarbnitram/claude-code-extensions
Open the skill to read its SKILL.md instructions.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。