
Updated on February 3, 2026
In the world of IoT, rock-solid stability is the name of the game. But let’s be real—even the most dependable device can freeze up and need a good old-fashioned reboot. If you have an ESPHome board installed in a hard-to-reach place—like inside a drop ceiling, an electrical panel, or behind a heavy piece of furniture—a simple device hang-up can become a massive headache. Fortunately, in 2026, we have a simple and elegant solution: creating a virtual ESPHome restart button directly in our Home Assistant interface.
This definitive guide will show you how to configure a restart button in Home Assistant for any board, from the classic ESP8266 and ESP32 to the latest models. I’ve personally tested this method on dozens of my own devices, and its reliability is rock-solid.
Option 1: Create a Restart Button (Recommended Method)
The cleanest and most modern way to implement this feature is through ESPHome’s native button platform. This will create a button entity in Home Assistant that, when pressed, executes the restart action on the microcontroller.
To get started, simply add the following code to your device’s ESPHome YAML file:
# Example configuration for a restart button
button:
- platform: restart
name: "Garage Sensor Reboot"
id: garage_rebootOnce you save, compile, and upload this code to your board, a new entity called button.garage_sensor_reboot will appear in Home Assistant, ready to use.
Configuration Parameters
While the basic setup is minimal, it’s helpful to know what each parameter does:
| Parameter | Description |
name (Required) | The friendly name for the button entity in Home Assistant. Make it descriptive so you know exactly what you’re rebooting. |
id (Optional) | A unique identifier for using this button elsewhere in your ESPHome code, such as in scripts or lambdas. |
icon (Optional) | Lets you define a custom icon from the Material Design Icons catalog (e.g., icon: "mdi:restart-alert"). |
Option 2: Use a Restart Switch (Legacy Method)
An alternative, more old-school but still perfectly functional method is to use a switch. The restart platform is also available for switches. When you toggle it on, the device reboots immediately. The key difference is that a switch is a stateful entity (on/off). In this case, even though you toggle it ‘on’ to restart the device, it will always report back as ‘off’ after the reboot is complete.
The configuration for an ESPHome restart switch is very similar:
# Example configuration for a restart switch
switch:
- platform: restart
name: "Kitchen Lights Controller Reboot"This will create a switch.kitchen_lights_controller_reboot entity in Home Assistant. It’s a valid option if your existing automations or scripts are already designed to work with switches instead of buttons.
Common Troubleshooting Steps
Although setting this up is straightforward, you can occasionally hit a snag. Here are the fixes for the most common problems:
- The button isn’t showing up in Home Assistant: After adding the code and flashing the device, if the new entity is missing, check the ESPHome logs. Ensure the board is properly connected to your WiFi network. Sometimes, a full power cycle (unplugging it and plugging it back in) will force the sync. Also, verify that your OTA updates completed without errors.
- YAML validation error: 99% of the time, this is an indentation issue. YAML is notoriously strict about spaces. If you need a refresher on how to keep your code clean and reusable, check out our ultimate guide to YAML Anchors & Aliases.
- Device reboots but won’t reconnect: This issue usually isn’t with the restart button itself, but with the device’s core network configuration. Double-check the
wifi:section in your code to ensure the credentials are correct and that the device has a strong enough signal.
Advanced Automation: The ‘Watchdog’ Reboot
The real power of an ESPHome restart button is using it in automations. What if a critical sensor goes offline? We can build a ‘watchdog’ automation that automatically reboots the device if it disconnects from Home Assistant for a set amount of time.
Every ESPHome node has a binary_sensor.your_device_name_status entity that indicates if it’s online. We can use this as our trigger.
Here’s an example of a watchdog automation in Home Assistant:
automation:
- alias: "Auto-reboot Garage ESP if it goes offline"
id: auto_reboot_garage_esp_2026
trigger:
- platform: state
entity_id: binary_sensor.garage_sensor_status
to: 'off'
for:
minutes: 15
action:
- service: button.press
target:
entity_id: button.garage_sensor_reboot
mode: singleHow this automation works:
trigger: It fires when the status sensor for our “Garage Sensor” (binary_sensor.garage_sensor_status) changes tooff(disconnected) and stays in that state for 15 minutes.action: It calls thebutton.pressservice to virtually “push” our remote restart button.
This simple automation can save you countless headaches, especially with devices that control critical functions in your smart home. It’s a foundational concept for anyone looking to understand what Home Assistant is and how it can dramatically improve the reliability of your entire system.
With this guide, you now know how to remotely reboot an ESP32 or any other ESPHome board, allowing you to build a more resilient and self-healing smart home for 2026 and beyond.
