Esphome config helper

From nodnarbnitram/claude-code-extensions · View interactive version

Esphome config helper is an AI agent skill from the GitHub repository 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 alre

How to use this skill

Skill file

ESPHome Configuration Helper

Rapid ESPHome configuration generation and troubleshooting skill with ready-to-use templates, GPIO reference guides, and validation utilities.

Purpose

This skill accelerates ESPHome device configuration by providing:

Use this skill for general ESPHome configuration tasks. For ESP32-S3-BOX-3 specific implementations, use the esphome-box3-builder skill instead.

When to Use This Skill

Use this skill when:

Delegate to specialized ESPHome agents for:

Configuration Templates

Available Templates

Located in templates/ directory:

  1. basic-device.yaml - Minimal ESP32 starter
  1. sensor-node.yaml - Temperature/humidity sensor node
  1. relay-switch.yaml - 4-channel relay controller
  1. display-node.yaml - Display with sensors

Using Templates

To use a template:

  1. Read the appropriate template file
  2. Customize device name, WiFi credentials, GPIO pins
  3. Add or remove components as needed
  4. Validate configuration (see Validation Workflow below)

Template Workflow:

# 1. Read template
cat .claude/skills/esphome-config-helper/templates/sensor-node.yaml

# 2. Copy to project
cp .claude/skills/esphome-config-helper/templates/sensor-node.yaml my-device.yaml

# 3. Edit with device-specific values
# - Update device name
# - Set WiFi credentials (use secrets.yaml)
# - Adjust GPIO pins if needed
# - Customize sensor names

# 4. Validate (see Validation Workflow)

GPIO Pin Reference

Quick GPIO Lookup

For detailed GPIO pinouts and safe pin selection, consult:

Quick Safe Pins:

Avoid (strapping/boot pins):

Common Sensor Configurations

Sensor Selection Guide

For detailed sensor configurations with wiring diagrams, consult:

Quick Sensor Recommendations:

Basic Sensor Patterns

I²C Sensor (BME280 example):

i2c:
  sda: GPIO21
  scl: GPIO22
  scan: true

sensor:
  - platform: bme280
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"
    pressure:
      name: "Pressure"
    address: 0x76
    update_interval: 60s

GPIO Sensor (DHT22 example):

sensor:
  - platform: dht
    pin: GPIO4
    model: DHT22
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"
    update_interval: 60s

Binary Sensor (PIR motion):

binary_sensor:
  - platform: gpio
    pin: GPIO14
    name: "Motion Sensor"
    device_class: motion

Troubleshooting Guide

Error Lookup

For complete error message lookup table and solutions, consult:

Common Error Quick Reference:

| Error Message | Quick Fix |

|---------------|-----------|

| "Unknown platform" | Check component name spelling, ensure platform supported |

| "GPIO already in use" | Check GPIO pin assignments, avoid duplicates |

| "Could not compile" | Check YAML syntax, verify indentation (2 spaces) |

| "WiFi connection failed" | Verify SSID/password, check signal strength, use static IP |

| "Sensor not found" | Check I²C address (use scan: true), verify wiring |

| "OTA upload failed" | Check device reachable, verify OTA password, restart device |

Troubleshooting Workflow

When encountering errors:

  1. Check YAML syntax: Verify indentation (2 spaces, no tabs)
  2. Validate GPIO pins: Ensure no conflicts, use safe pins
  3. Check component platform: Verify platform name and configuration
  4. Review logs: Use esphome logs device.yaml to see runtime errors
  5. Consult references: Check references/troubleshooting.md for specific error
  6. Validate config: Run validation workflow (see below)

Validation Workflow

Using the Validation Script

The validation utility provides quick configuration checks:

Script: scripts/validate-config.sh

Usage:

# Validate configuration
./.claude/skills/esphome-config-helper/scripts/validate-config.sh my-device.yaml

# The script runs:
# 1. esphome config my-device.yaml  (syntax check)
# 2. esphome compile my-device.yaml (compilation test)

Validation Steps:

  1. Syntax validation: esphome config my-device.yaml
  1. Compilation test: esphome compile my-device.yaml
  1. Fix errors: If validation fails:

Pre-Flash Checklist

Before flashing device:

Configuration Best Practices

YAML Structure

Organize configuration in logical sections:

# 1. Core platform
esphome:
  name: device-name
  friendly_name: Device Name

esp32:
  board: esp32dev
  framework:
    type: arduino

# 2. Network
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome
    password: !secret ota_password

# 3. Logging
logger:
web_server:

# 4. Components (sensors, switches, etc.)
sensor:
  # ...

binary_sensor:
  # ...

Secrets Management

Use secrets.yaml for sensitive data:

secrets.yaml:

wifi_ssid: "MyNetwork"
wifi_password: "MyPassword123"
api_encryption_key: "base64-generated-key"
ota_password: "SecureOTAPassword"

Reference in config:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

Naming Conventions

Follow consistent naming:

Example:

sensor:
  - platform: dht
    pin: GPIO4
    temperature:
      name: "Living Room Temperature"
      id: living_room_temp
    humidity:
      name: "Living Room Humidity"
      id: living_room_humidity

Integration with Other Skills and Agents

When to Use Other Resources

Additional Resources

Reference Files

For detailed information, consult:

Template Files

Working configuration examples in templates/:

Utility Scripts

Validation and testing tools in scripts/:

Quick Start Workflow

For new ESPHome device:

  1. Select template based on device type (sensor, switch, display, or basic)
  2. Copy template to project directory
  3. Customize configuration:
  1. Validate configuration using scripts/validate-config.sh
  2. Fix any errors using references/troubleshooting.md
  3. Flash device with validated configuration
  4. Monitor logs and troubleshoot if needed

For adding to existing config:

  1. Consult references for component configuration
  2. Check GPIO availability in references/gpio-pinouts.md
  3. Add component to configuration
  4. Validate before flashing
  5. Update and monitor

This skill provides rapid configuration generation for common ESPHome use cases. For specialized hardware (ESP32-S3-BOX-3) or deep technical questions, use the appropriate specialist skills and agents.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.