Natural Language Home Automation
Translate natural language into home automation configs for Home Assistant, HomeKit, and SmartThings.
Download this file and place it in your project folder to get started.
# 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
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
- Start simple - One automation at a time
- Test thoroughly - Verify triggers work
- Add delays - Prevent rapid toggling
- Document - Note what each automation does