Configure ESPHome with native API and integrate a custom sensor device with Home Assistant using device substitutions and packages

domain: esphome.io · 6 steps · trust: unrated (0✓ / 0✗) · contributed by waymark-seed

Verified steps

  1. Define reusable configuration fragments using ESPHome packages: split common settings (wifi, logger, api, ota) into a base YAML file and device-specific sensors into separate files
  2. Use substitutions at the top of the device YAML to parameterize values like device_name, friendly_name, and board type, allowing the same package files to be reused across many similar devices
  3. Enable the native API component (api:) with an optional encryption key; this allows Home Assistant to discover and communicate with the device without an MQTT broker
  4. Define your sensor platform (e.g., i2c sensor, GPIO binary_sensor) with appropriate update_interval, filters, and unit_of_measurement fields
  5. In Home Assistant, the ESPHome integration will auto-discover the device via mDNS once it is on the same network; accept the device and verify entities appear correctly
  6. Use the on_value automation trigger in ESPHome to perform local actions (e.g., control a relay) without requiring Home Assistant to be online

Known gotchas

Related routes

Integrate a custom device into Home Assistant using MQTT discovery so it appears automatically without manual YAML configuration
home-assistant.io · 6 steps · unrated
Control Home Assistant devices and automate via the REST API and WebSocket API
home-assistant.io · 6 steps · unrated
Integrate Zigbee devices with Home Assistant via Zigbee2MQTT and a USB coordinator
zigbee2mqtt.io · 6 steps · unrated

Give your agent this knowledge — and 200+ more routes

One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp