From 22d62dcd2929cec9f937c00e41f2ad3104b7cc16 Mon Sep 17 00:00:00 2001 From: Steve Rodgers Date: Sat, 4 Nov 2023 13:13:48 -0700 Subject: [PATCH 01/10] Update template.rst Add zone type, add chime. --- components/alarm_control_panel/template.rst | 51 ++++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/components/alarm_control_panel/template.rst b/components/alarm_control_panel/template.rst index 71d214d469..a3399aeedc 100644 --- a/components/alarm_control_panel/template.rst +++ b/components/alarm_control_panel/template.rst @@ -36,6 +36,8 @@ Configuration variables: - **input** (**Required**, string): The id of the binary sensor component - **bypass_armed_home** (*Optional*, boolean): This binary sensor will not trigger the alarm when in ``armed_home`` state. - **bypass_armed_night** (*Optional*, boolean): This binary sensor will not trigger the alarm when in ``armed_night`` state. + - **sensor_type** (*Optional*, string): Sets the sensor type. One of ``delayed``, ``instant``, or ``interior_follower``. (``delayed`` is default if not specified) + - **chime** (*Optional*, boolean): When set ``true``, the chime callback will be called whenever the sensor goes from closed to open. (``false`` is the default if not specified) - **restore_mode** (*Optional*, enum): @@ -62,10 +64,14 @@ State Flow: b. ``arming_..._time`` is 0 or after the delay the state is ``ARMED_...`` 3. When the alarm is tripped by a sensor state changing to ``on`` or ``alarm_control_panel_pending_action`` invoked - - a. ``pending_time`` greater than 0 the state is ``PENDING`` - b. ``pending_time`` is 0 or after the ``pending_time`` delay the state is ``TRIGGERED`` - + 1. If sensor_type is set to ``delayed``: + 1. ``pending_time`` greater than 0 the state is ``PENDING`` + 2. ``pending_time`` is 0 or after the ``pending_time`` delay the state is ``TRIGGERED`` + 2. If sensor_type is set to ``instant``: + 1. The state is set to ``TRIGGERED`` + 3. If the sensor_type is set to ``interior_follower``: + 1. If the current state is ``ARMED_...`` the state will be set to ``TRIGGERED`` + 2. If the current state is ``PENDING`` then nothing will happen and it will stay in the ``PENDING`` state. 4. If ``trigger_time`` greater than 0 and no sensors are ``on`` after ``trigger_time`` delay the state returns to ``ARM_...`` @@ -95,8 +101,16 @@ Example: trigger_time: 5min binary_sensors: - input: zone_1 + chime: true + sensor_type: delayed - input: zone_2 + chime: true + sensor_type: delayed + - input: zone_3 bypass_armed_home: true + sensor_type: interior_follower + - input: zone_4 + sensor_type: instant - input: ha_test on_state: then: @@ -108,6 +122,15 @@ Example: on_cleared: then: - switch.turn_off: siren + on_ready: + then: + - lambda: !lambda |- + ESP_LOGD("TEST", "Sensor ready change to: %s", + (id(acp1).get_all_sensors_ready())) ? (const char *) "True" : (const char *) "False"); + on_chime: + then: + - lambda: !lambda |- + ESP_LOGD("TEST", "Zone with chime mode set opened"); binary_sensor: - platform: gpio @@ -121,14 +144,30 @@ Example: - platform: gpio id: zone_2 name: Zone 2 - device_class: motion + device_class: door pin: number: D2 mode: INPUT_PULLUP inverted: True + - platform: gpio + id: zone_3 + name: Zone 3 + device_class: motion + pin: + number: D3 + mode: INPUT_PULLUP + inverted: True + - platform: gpio + id: zone_4 + name: Zone 4 + device_class: door + pin: + number: D4 + mode: INPUT_PULLUP + inverted: True - platform: homeassistant id: ha_test - name: Zone 3 + name: HA Test entity_id: input_boolean.test_switch switch: From 64a42f72e4c82c910602df2edbaa61db09b8b386 Mon Sep 17 00:00:00 2001 From: Steve Rodgers Date: Sat, 4 Nov 2023 13:45:36 -0700 Subject: [PATCH 02/10] Update template.rst Fix formatting errors --- components/alarm_control_panel/template.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/alarm_control_panel/template.rst b/components/alarm_control_panel/template.rst index a3399aeedc..befc1205a3 100644 --- a/components/alarm_control_panel/template.rst +++ b/components/alarm_control_panel/template.rst @@ -65,13 +65,17 @@ State Flow: 3. When the alarm is tripped by a sensor state changing to ``on`` or ``alarm_control_panel_pending_action`` invoked 1. If sensor_type is set to ``delayed``: + 1. ``pending_time`` greater than 0 the state is ``PENDING`` 2. ``pending_time`` is 0 or after the ``pending_time`` delay the state is ``TRIGGERED`` 2. If sensor_type is set to ``instant``: + 1. The state is set to ``TRIGGERED`` 3. If the sensor_type is set to ``interior_follower``: + 1. If the current state is ``ARMED_...`` the state will be set to ``TRIGGERED`` 2. If the current state is ``PENDING`` then nothing will happen and it will stay in the ``PENDING`` state. + 4. If ``trigger_time`` greater than 0 and no sensors are ``on`` after ``trigger_time`` delay the state returns to ``ARM_...`` From 77711c0006227ca1be3d68aebe6f573416f6ba34 Mon Sep 17 00:00:00 2001 From: Steve Rodgers Date: Sat, 4 Nov 2023 13:48:07 -0700 Subject: [PATCH 03/10] Update template.rst Fix formatting --- components/alarm_control_panel/template.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/alarm_control_panel/template.rst b/components/alarm_control_panel/template.rst index befc1205a3..dd2f906ee4 100644 --- a/components/alarm_control_panel/template.rst +++ b/components/alarm_control_panel/template.rst @@ -68,9 +68,11 @@ State Flow: 1. ``pending_time`` greater than 0 the state is ``PENDING`` 2. ``pending_time`` is 0 or after the ``pending_time`` delay the state is ``TRIGGERED`` + 2. If sensor_type is set to ``instant``: 1. The state is set to ``TRIGGERED`` + 3. If the sensor_type is set to ``interior_follower``: 1. If the current state is ``ARMED_...`` the state will be set to ``TRIGGERED`` From 1f84b62e3f890c82d1ca0863a0b42b1707570224 Mon Sep 17 00:00:00 2001 From: Steve Rodgers Date: Sat, 4 Nov 2023 15:28:15 -0700 Subject: [PATCH 04/10] Update index.rst Add on_ready and on_chime_triggers. Document get_all_sensors_ready() --- components/alarm_control_panel/index.rst | 39 +++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/components/alarm_control_panel/index.rst b/components/alarm_control_panel/index.rst index 24610ace1d..88d4ea6607 100644 --- a/components/alarm_control_panel/index.rst +++ b/components/alarm_control_panel/index.rst @@ -44,6 +44,11 @@ Configuration variables: when the alarm state changes to ``disarmed``. See :ref:`alarm_control_panel_on_disarmed_trigger`. - **on_cleared** (*Optional*, :ref:`Action `): An automation to perform when the alarm clears. See :ref:`alarm_control_panel_on_cleared_trigger`. +- **on_ready** (*Optional*, :ref:`Action `): An automation to perform + when the logical 'and' of all the zone sensors change state. See :ref:`alarm_control_panel_on_ready_trigger`. +- **on_chime** (*Optional*, :ref:`Action `): An automation to perform + when a zone has been marked as chime in the configuration, and it changes from closed to open. + See :ref:`alarm_control_panel_on_chime_trigger`. Automation: @@ -184,8 +189,38 @@ This trigger is activated when the alarm changes from to disarmed. then: - logger.log: "Alarm Disarmed!" -.. _alarm_control_panel_arm_away_action: +.. _alarm_control_panel_on_ready_trigger: +``on_ready`` Trigger +*********************** + +This trigger is activated when the logical 'and' of all the alarm sensors change state. This is useful for implementing alarm ready LED's. +Once this trigger is called, you can get the ready state by calling get_all_sensors_ready() in a lambda block. + +.. code-block:: yaml + + alarm_control_panel: + # ... + on_disarmed: + then: + - lambda: !lambda |- + ESP_LOGI("AlarmPanel", "Sensor ready change to: %s", ((id(acp1).get_all_sensors_ready()) ? (const char *) "True" : (const char *) "False")); + +.. _alarm_control_panel_on_chime_trigger: +``on_chime`` Trigger +*********************** + +This trigger is activated when a zone sensor marked with chime:true changes from closed to open. This is useful for implementing keypad chimes when a zone +opens. + +.. code-block:: yaml + alarm_control_panel: + # ... + on_disarmed: + then: + - logger.log: "Alarm Disarmed!" + +.. _alarm_control_panel_arm_away_action: ``arm_away`` Action ******************* @@ -296,6 +331,7 @@ From :ref:`lambdas `, you can call the following methods: - ``arm_home(code)`` - ``arm_night(code)`` - ``disarm(code)`` +-- ``get_all_sensors_ready()`` .. code-block:: cpp @@ -303,6 +339,7 @@ From :ref:`lambdas `, you can call the following methods: id(acp1).arm_home(); id(acp1).arm_night(); id(acp1).disarm(std::string("1234")); + bool all_sensors_ready = id(acp1).get_all_sensors_ready(); Platforms From 8c8bb6c9aeec6af2c1c1e91ceecd254bec6d3d37 Mon Sep 17 00:00:00 2001 From: Steve Rodgers Date: Sat, 4 Nov 2023 15:33:11 -0700 Subject: [PATCH 05/10] Update index.rst Fix formatting errors --- components/alarm_control_panel/index.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/alarm_control_panel/index.rst b/components/alarm_control_panel/index.rst index 88d4ea6607..22eec27070 100644 --- a/components/alarm_control_panel/index.rst +++ b/components/alarm_control_panel/index.rst @@ -190,6 +190,7 @@ This trigger is activated when the alarm changes from to disarmed. - logger.log: "Alarm Disarmed!" .. _alarm_control_panel_on_ready_trigger: + ``on_ready`` Trigger *********************** @@ -206,6 +207,7 @@ Once this trigger is called, you can get the ready state by calling get_all_sens ESP_LOGI("AlarmPanel", "Sensor ready change to: %s", ((id(acp1).get_all_sensors_ready()) ? (const char *) "True" : (const char *) "False")); .. _alarm_control_panel_on_chime_trigger: + ``on_chime`` Trigger *********************** From 15f720b10de640c7f8080870b762ac6c8e5a836b Mon Sep 17 00:00:00 2001 From: Steve Rodgers Date: Sat, 4 Nov 2023 15:38:47 -0700 Subject: [PATCH 06/10] Update index.rst Fix typos in on_chime section --- components/alarm_control_panel/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/alarm_control_panel/index.rst b/components/alarm_control_panel/index.rst index 22eec27070..8cad5153d7 100644 --- a/components/alarm_control_panel/index.rst +++ b/components/alarm_control_panel/index.rst @@ -218,9 +218,9 @@ opens. alarm_control_panel: # ... - on_disarmed: + on_chime: then: - - logger.log: "Alarm Disarmed!" + - logger.log: "Alarm Chime!" .. _alarm_control_panel_arm_away_action: ``arm_away`` Action From 2903dcba400aafdb7d1f195e55e247096c4624d6 Mon Sep 17 00:00:00 2001 From: Steve Rodgers Date: Sat, 4 Nov 2023 15:58:06 -0700 Subject: [PATCH 07/10] Update index.rst Fix get all sensors ready formatting issue. --- components/alarm_control_panel/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/alarm_control_panel/index.rst b/components/alarm_control_panel/index.rst index 8cad5153d7..a07fe01229 100644 --- a/components/alarm_control_panel/index.rst +++ b/components/alarm_control_panel/index.rst @@ -333,7 +333,7 @@ From :ref:`lambdas `, you can call the following methods: - ``arm_home(code)`` - ``arm_night(code)`` - ``disarm(code)`` --- ``get_all_sensors_ready()`` +- ``get_all_sensors_ready()`` .. code-block:: cpp From 91d004d584289ef123ed7e0b2df483ec5bb401f2 Mon Sep 17 00:00:00 2001 From: clydebarrow <2366188+clydebarrow@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:57:59 +1100 Subject: [PATCH 08/10] * In search, clicking on excerpt text goes to the corresponding anchor, if there is one. * Fix image paths in search * Bump pagefind version --- Makefile | 2 +- _templates/searchbox.html | 48 ++++++++++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index fc19d468db..77c13090ca 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ESPHOME_PATH = ../esphome ESPHOME_REF = 2024.10.2 -PAGEFIND_VERSION=1.1.0 +PAGEFIND_VERSION=1.1.1 PAGEFIND=pagefind NET_PAGEFIND=../pagefindbin/pagefind diff --git a/_templates/searchbox.html b/_templates/searchbox.html index 95495c1246..bd3c7c81ba 100644 --- a/_templates/searchbox.html +++ b/_templates/searchbox.html @@ -60,7 +60,7 @@ if (!inpel) return; - var mobileWidth = getComputedStyle(document.body).getPropertyValue("--mobile-width-stop"); + const mobileWidth = getComputedStyle(document.body).getPropertyValue("--mobile-width-stop"); function isMobile() { return window.innerWidth <= mobileWidth; @@ -74,26 +74,39 @@ const margin = 20; + function getLink(location, anchors, url) { + anchor = anchors.filter(a => a.location === location)[0]; + if (anchor) { + return url + "#" + anchor.id; + } + return null; + } + const resultTemplate = (result) => { - let wrapper = new El("li").class("pagefind-modular-list-result"); + const wrapper = new El("li").class("pagefind-modular-list-result"); - let thumb = new El("div").class("pagefind-modular-list-thumb").addTo(wrapper); - if (result?.meta?.image) { + const thumb = new El("div").class("pagefind-modular-list-thumb").addTo(wrapper); + let image = result?.meta?.image; + if (image) { + if (image.includes("/_images/")) + image = image.substring(image.indexOf("/_images/")); new El("img").class("pagefind-modular-list-image").attrs({ - src: result.meta.image, + src: image, alt: result.meta.image_alt || result.meta.title }).addTo(thumb); } - let inner = new El("div").class("pagefind-modular-list-inner").addTo(wrapper); - let title = new El("p").class("pagefind-modular-list-title").addTo(inner); + const inner = new El("div").class("pagefind-modular-list-inner").addTo(wrapper); + const title = new El("p").class("pagefind-modular-list-title").addTo(inner); new El("a").class("pagefind-modular-list-link").text(result.meta?.title).attrs({ href: result.meta?.url || result.url }).addTo(title); - let excerpt = new El("p").class("pagefind-modular-list-excerpt").addTo(inner); + const excerpt = new El("p").class("pagefind-modular-list-excerpt").addTo(inner); + const locations = result.weighted_locations.sort((a, b) => b.weight - a.weight); + const url = getLink(locations[0]?.location, result.anchors, result.url) || result.meta?.url || result.url; new El("a").class("pagefind-modular-list-link").html(result.excerpt).attrs({ - href: result.meta?.url || result.url + href: url }).addTo(excerpt); return wrapper.element; @@ -102,9 +115,9 @@ function resizeTarget() { const searchPos = inpel.getBoundingClientRect(); - var leftPos; - var topPos; - var maxWidth = 650; + let leftPos; + let topPos; + const maxWidth = 650; target.style.width = "auto;" target.style.height = "fit-content"; target.style.maxWidth = maxWidth + "px"; @@ -171,7 +184,7 @@ const clickCallback = (event) => { const path = event.composedPath(); - if (path.includes(target) || path.includes(inpel)) + if (path.includes(inpel)) return; hideTargets(); }; @@ -184,5 +197,14 @@ } }); } + input_field = document.querySelector("#pfmod-input-0"); + if (input_field) { + input_field.focus({preventScroll: true}); + input_field.addEventListener("blur", () => { + setTimeout(() => { + input_field.focus({preventScroll: true}); + }, 100); + }) + } }); From e9e11bdf8eb3b56741687c1cb99b8862c5e98978 Mon Sep 17 00:00:00 2001 From: clydebarrow <2366188+clydebarrow@users.noreply.github.com> Date: Thu, 19 Jun 2025 14:22:16 +1000 Subject: [PATCH 09/10] [changelog] Add breaking change note about CPU frequency --- changelog/2025.6.0.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/2025.6.0.rst b/changelog/2025.6.0.rst index 90d5b8f050..80d369924a 100644 --- a/changelog/2025.6.0.rst +++ b/changelog/2025.6.0.rst @@ -188,6 +188,7 @@ Breaking Changes - Optimize Component and Application state storage from uint32_t to uint8_t :esphomepr:`9082` by :ghuser:`bdraco` (breaking-change) - Reduce entity memory usage by eliminating field shadowing and bit-packing :esphomepr:`9076` by :ghuser:`bdraco` (breaking-change) - Optimize Application ``area_`` from ``std::string`` to ``const char*`` :esphomepr:`9085` by :ghuser:`bdraco` (breaking-change) +- The default CPU frequency for ESP32 is now 160MHz for both ESP-IDF and Arduino (was 240MHz for Arduino) :esphomepr:`8542` by :ghuser:`clydebarrow` (breaking-change) Beta Changes ^^^^^^^^^^^^ From 878ace5eaf42f54c4978773540a54829f1be7013 Mon Sep 17 00:00:00 2001 From: clydebarrow <2366188+clydebarrow@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:13:04 +1000 Subject: [PATCH 10/10] Add paragraph for CPU frequency change --- changelog/2025.6.0.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog/2025.6.0.rst b/changelog/2025.6.0.rst index 637f598edd..41d059064b 100644 --- a/changelog/2025.6.0.rst +++ b/changelog/2025.6.0.rst @@ -151,6 +151,11 @@ focus on three key areas: These optimizations are part of an ongoing effort to make ESPHome more efficient and reliable. More performance improvements are planned for future releases. +Arduino Platform Default CPU Frequency +--------------------------------------------- + +The default CPU frequency for ESP32 is now 160MHz for both ESP-IDF and Arduino (was 240MHz for Arduino). This can +be configured in the ``esp32`` block using the ``cpu_frequency`` option. See :doc:`/components/esp32`. BME68x BSEC2 Arduino Independence ---------------------------------