Home
cd ../playbooks
File OrganizationIntermediate

Natural Language Home Automation

Translate natural language into home automation configs for Home Assistant, HomeKit, and SmartThings.

10 minutes

You want 'turn on the porch light at sunset but only if someone's home' and that translates to 47 lines of YAML you don't understand. Smart home automation shouldn't require learning a configuration language.

Who it's for: non-technical smart home users who want automations without writing YAML, families setting up home routines, anyone who knows what they want their smart home to do but not how to configure it, Home Assistant users who prefer describing automations in English

Example

"When I leave for work, lock the doors, turn off all lights, and set the thermostat to 65" → Working automation configs for Home Assistant, HomeKit, or SmartThings with presence detection triggers, device actions, and fallback conditions — generated from your plain English description

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Natural Language Home Automation

## Your Role
You help translate natural language intentions into home automation configurations and troubleshoot smart home setups across platforms like Home Assistant, HomeKit, and SmartThings.

## Automation Templates

### Motion-Based Lighting
```yaml
## Natural Language → Automation

Input: "Turn on the hallway lights when someone walks by at night"

Output:
alias: "Hallway Motion Lights - Night Only"
trigger:
  - platform: state
    entity_id: binary_sensor.hallway_motion
    to: "on"
condition:
  - condition: time
    after: "22:00:00"
    before: "06:00:00"
action:
  - service: light.turn_on
    entity_id: light.hallway
    data:
      brightness_pct: 30
  - delay: "00:05:00"
  - service: light.turn_off
    entity_id: light.hallway
```

### Presence-Based Control
```yaml
## "Turn everything off when everyone leaves"

alias: "Away Mode"
trigger:
  - platform: state
    entity_id: group.family
    to: "not_home"
    for:
      minutes: 5
action:
  - service: light.turn_off
    entity_id: all
  - service: climate.set_hvac_mode
    entity_id: climate.home
    data:
      hvac_mode: "eco"
  - service: media_player.turn_off
    entity_id: all
```

### Time-Based Scenes
```yaml
## "Make the living room cozy at sunset"

alias: "Sunset Cozy Mode"
trigger:
  - platform: sun
    event: sunset
    offset: "-00:30:00"
condition:
  - condition: state
    entity_id: group.family
    state: "home"
action:
  - service: scene.turn_on
    entity_id: scene.living_room_cozy
  - service: light.turn_on
    entity_id: light.living_room
    data:
      brightness_pct: 40
      color_temp: 400
```

## Platform Translation

### Home Assistant
```yaml
# Native YAML configuration
automation:
  - alias: "Morning Routine"
    trigger:
      platform: time
      at: "07:00:00"
    action:
      - service: light.turn_on
        entity_id: light.bedroom
```

### HomeKit (Shortcuts)
```markdown
## HomeKit Shortcut
Trigger: Time of Day (7:00 AM)
Conditions: [Weekdays only]
Actions:
1. Set "Bedroom Light" to On
2. Set brightness to 50%
```

### SmartThings
```groovy
// SmartThings Automation
name: "Morning Routine"
trigger:
  time: "07:00"
conditions:
  days: ["Mon", "Tue", "Wed", "Thu", "Fri"]
actions:
  - light: "Bedroom"
    command: "on"
    level: 50
```

## Automation Categories

### Lighting
```markdown
## Common Lighting Automations

1. **Motion-activated lights**
   "Lights on when motion detected, off after X minutes"

2. **Time-based scenes**
   "Dim lights at 9 PM"
   "Bright white light in morning"

3. **Presence-based**
   "Lights on when I get home"
   "Turn off when away"

4. **Adaptive lighting**
   "Match color temperature to time of day"
```

### Climate
```markdown
## Climate Automations

1. **Schedule-based**
   "68°F during work hours, 72°F when home"

2. **Presence-based**
   "Lower temp when everyone leaves"

3. **Window/door integration**
   "Pause AC if windows open"

4. **Weather-reactive**
   "Pre-cool before hot afternoons"
```

### Security
```markdown
## Security Automations

1. **Away mode**
   "Arm when everyone leaves"
   "Random lights to simulate presence"

2. **Arrival**
   "Disarm when I'm nearby"

3. **Alerts**
   "Notify if motion when away"
   "Alert if door opens at night"
```

## Troubleshooting

```markdown
## Common Issues

### Automation Not Triggering
1. Check entity IDs are correct
2. Verify trigger conditions
3. Check automation is enabled
4. Review logs for errors

### Device Not Responding
1. Check device is online
2. Verify network connectivity
3. Check integration status
4. Restart device/hub

### Unexpected Behavior
1. Review condition logic
2. Check for conflicting automations
3. Verify time zone settings
4. Check for mode/state conflicts
```

## Instructions

1. Describe what you want to happen
2. Tell me your platform (Home Assistant, HomeKit, etc.)
3. I'll generate the automation code
4. Review and adjust triggers/conditions
5. Deploy and test

## Commands

```
"Create an automation for [scenario]"
"Translate this to Home Assistant YAML"
"Why isn't my [automation] working?"
"How do I make [device] do [action] when [trigger]?"
"Generate a morning routine automation"
"Help me troubleshoot [issue]"
```

## Best Practices

1. **Start simple** - Add complexity gradually
2. **Test conditions** - Verify triggers work as expected
3. **Use groups** - Organize devices logically
4. **Add delays** - Prevent rapid toggling
5. **Document** - Note what each automation does
README.md

What This Does

Converts your descriptions of how you want your smart home to behave ("turn on lights when I get home") into actual automation configurations for Home Assistant, HomeKit, or SmartThings.

Prerequisites

  • Claude Code installed
  • Smart home platform (Home Assistant, HomeKit, etc.)
  • Basic understanding of your devices

Setup Instructions

Step 1: Download the Template

Download the CLAUDE.md template below and save it to your home automation folder.

Step 2: List Your Devices

Create a device inventory:

# My Smart Home

## Lights
- Living room lights (Hue)
- Bedroom lights (Hue)

## Sensors
- Front door motion sensor
- Hallway motion sensor

## Other
- Thermostat (Nest)
- Door locks (August)

Step 3: Create Automations

Describe what you want:

Create an automation to turn on hallway lights when motion is detected at night

Example Usage

"Turn everything off when everyone leaves"
"Cozy mode at sunset"
"Wake up routine at 7am weekdays"
"Alert me if door opens when I'm away"
"Translate this to Home Assistant YAML"

Supported Platforms

  • Home Assistant (YAML)
  • Apple HomeKit (Shortcuts)
  • SmartThings
  • Google Home (routines)

Best Practices

  1. Start simple - One automation at a time
  2. Test thoroughly - Verify triggers work
  3. Add delays - Prevent rapid toggling
  4. Document - Note what each automation does

$Related Playbooks

File Organization

Intelligent File Organizer

Analyze folders, detect duplicates, suggest logical arrangements, and automate cleanup with context-aware file organization.

5 minutes
Beginner
File Organization

Document Layout Analyzer

Detect text blocks, tables, figures, and reading order in complex documents using surya.

10 minutes
Beginner
File Organization

Mac Performance Diagnostics

Run diagnostic commands, analyze results in plain English, and get resolution steps for Mac performance issues.

5 minutes
Beginner
File Organization

Markdown to Office Converter

Convert Markdown to Word, PowerPoint, PDF, and other Office formats using Pandoc.

10 minutes
Advanced
File Organization

Office to Markdown Converter

Convert Office documents to Markdown for version control and AI processing using Microsoft's markitdown.

10 minutes
Advanced
File Organization

PDF Compression Tool

Reduce PDF file size while maintaining acceptable quality

10 minutes
Intermediate
File Organization

Universal PDF Converter

Convert PDF files to and from Word, Excel, Image, and other formats

10 minutes
Intermediate
File Organization

PDF Text & Table Extractor

Extract text, tables, and metadata from PDFs using pdfplumber

10 minutes
Beginner
File Organization

PDF Form Auto-Filler

Fill out PDF forms programmatically and extract form data

10 minutes
Advanced
File Organization

PDF Merge & Split Tool

Combine multiple PDFs or split into separate files

10 minutes
Intermediate
File Organization

PDF OCR Scanner

Extract text from scanned PDFs using optical character recognition

10 minutes
Beginner
File Organization

PDF to Word Converter

Convert PDF files to editable Word documents using pdf2docx

10 minutes
Intermediate

Browse all File Organization playbooks →