home-assistant

racurry's avatarfrom racurry

Guidance for Home Assistant configurations. Use when writing automations, dashboards, or service calls for HA.

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 27, 2025

When & Why to Use This Skill

This Claude skill provides expert guidance for Home Assistant (HA) configurations, ensuring your smart home setup follows modern best practices. It specializes in generating clean, up-to-date YAML code for automations, dashboards, and service calls, helping users navigate the platform's rapid evolution while avoiding deprecated syntax and common configuration errors.

Use Cases

  • Case 1: Writing robust Home Assistant automations using modern 'target' syntax and explicit execution modes (single, restart, etc.).
  • Case 2: Migrating legacy YAML configurations and deprecated service calls to the latest Home Assistant standards to ensure long-term compatibility.
  • Case 3: Implementing error-resistant logic with availability checks to prevent automations from failing when IoT devices are offline or unknown.
  • Case 4: Optimizing sensor triggers with thresholds and debounce durations to prevent 'trigger spam' and improve system performance.
  • Case 5: Creating advanced Jinja2 templates for dynamic notifications and dashboard elements that display real-time state data.
namehome-assistant
descriptionGuidance for Home Assistant configurations. Use when writing automations, dashboards, or service calls for HA.

Home Assistant Skill

Fetch official docs for current syntax - HA evolves rapidly:

Quality Checklist

  • Use modern service syntax: target: + data:, not entity_id: at root
  • Automations have unique id and explicit mode
  • Secrets via !secret, never hardcoded
  • Templates tested in Developer Tools → Template
  • Check entity availability for unreliable devices

Common Pitfalls

Legacy Syntax

Claude may generate deprecated patterns. Use modern syntax:

# Wrong: deprecated
service: homeassistant.turn_on
entity_id: light.porch

# Right: modern
service: light.turn_on
target:
  entity_id: light.porch

Automations need id and mode:

automation:
  - id: porch_light_sunset
    alias: "Porch light at sunset"
    mode: single  # or restart, queued, parallel
    trigger:
      - platform: sun
        event: sunset
    action:
      - service: light.turn_on
        target:
          entity_id: light.porch

Missing Availability Checks

Unreliable devices need guards:

action:
  - choose:
      - conditions:
          - condition: template
            value_template: >
              {{ states('light.unreliable_bulb') not in ['unavailable', 'unknown'] }}
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.unreliable_bulb

Trigger Spam

State triggers fire on every change. Use thresholds or debounce:

# Threshold: only fires when crossing
trigger:
  - platform: numeric_state
    entity_id: sensor.temperature
    above: 75

# Debounce: must stay in state
trigger:
  - platform: state
    entity_id: sensor.temperature
    for:
      minutes: 5

Hardcoded Values

Use templates for dynamic content:

# Bad
message: "Front door opened"

# Good
message: "Front door opened at {{ now().strftime('%I:%M %p') }}"