From 3f10d4dcd6d0a1cb7f22320acbc76ed4d1a3c7ff Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Wed, 22 May 2024 14:43:18 -0500 Subject: [PATCH] Add on_safe_mode trigger to docs (#3857) --- components/safe_mode.rst | 13 +++++++++++-- guides/automations.rst | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) 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 `): An action to be performed once when safe mode is invoked. + +.. warning:: + + The ``on_safe_mode`` :ref:`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 ` - :ref:`display.on_page_change ` - :ref:`cover.on_open ` / :ref:`cover.on_closed ` +- :ref:`safe_mode.on_safe_mode ` - :ref:`wifi.on_connect / wifi.on_disconnect ` All Actions