diff --git a/components/safe_mode.rst b/components/safe_mode.rst index 8abfb62b5..690eee592 100644 --- a/components/safe_mode.rst +++ b/components/safe_mode.rst @@ -5,8 +5,6 @@ Safe Mode :description: Instructions for setting up ESPHome's Safe Mode to help recover from repeated boot failures. :image: system-update.svg -.. _config-safe_mode: - Sometimes hardware and/or software doesn't behave as expected. ESPHome supports a "safe mode" to help recover from repeated boot failures/reboot loops. After a specified number (the default is ten) of boot failures, the safe mode may be invoked; in this mode, all components are disabled except serial logging, network (Wi-Fi or Ethernet) and the OTA @@ -22,6 +20,7 @@ for ``num_attempts`` times (see below). # Example configuration entry safe_mode: +.. _safe_mode-configuration_variables: Configuration variables: ------------------------ @@ -32,6 +31,16 @@ Configuration variables: Defaults to ``10``. - **reboot_timeout** (*Optional*, :ref:`config-time`): The amount of time to wait before rebooting when in safe mode. Defaults to ``5min``. +- **on_safe_mode** (*Optional*, :ref:`Automation <automation>`): An action to be performed once when safe mode is invoked. + +.. warning:: + + The ``on_safe_mode`` :ref:`automation <automation>` is intended for use by recovery actions **only**. + + As mentioned above, in safe mode, all components are disabled except serial logging, network (Wi-Fi or Ethernet) + and OTA component(s). + + **All other components (for example, displays and sensors) are disabled and cannot be used.** See Also -------- diff --git a/guides/automations.rst b/guides/automations.rst index 7bfe0e3b5..5dabced22 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -349,6 +349,7 @@ All Triggers :ref:`ota.on_state_change <ota-on_state_change>` - :ref:`display.on_page_change <display-on_page_change-trigger>` - :ref:`cover.on_open <cover-on_open_trigger>` / :ref:`cover.on_closed <cover-on_closed_trigger>` +- :ref:`safe_mode.on_safe_mode <safe_mode-configuration_variables>` - :ref:`wifi.on_connect / wifi.on_disconnect <wifi-on_connect_disconnect>` All Actions