From ed74f58897d6ab0faf46366cd7613dc3c611229a Mon Sep 17 00:00:00 2001 From: sen Date: Tue, 5 Sep 2023 18:07:37 +0800 Subject: [PATCH] Added Any Presence Timeout.(feedback from ferbulous, code contributed by athua.) --- 2a/yaml/beta/human-sensor-2a-beta-github.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/2a/yaml/beta/human-sensor-2a-beta-github.yaml b/2a/yaml/beta/human-sensor-2a-beta-github.yaml index 39c9e23..06b52e4 100644 --- a/2a/yaml/beta/human-sensor-2a-beta-github.yaml +++ b/2a/yaml/beta/human-sensor-2a-beta-github.yaml @@ -88,7 +88,6 @@ web_server: text_sensor: -# 公共代码部分(23年9月2日_11时53分_) - platform: debug reset_reason: name: "ESP Reset Reason" @@ -139,6 +138,20 @@ text_sensor: update_interval: 1000s number: + - platform: template + name: "Any Presence Timeout" + id: any_presence_timeout + min_value: 0 + max_value: 600 + mode: box + device_class: duration + entity_category: config + unit_of_measurement: s + icon: mdi:timer-off + step: 1 + optimistic: True + initial_value: 0 + restore_value: True - platform: template name: "Zone1 Timeout" id: zone1_x_timeout @@ -469,6 +482,9 @@ binary_sensor: name: "Any Presence" id: any_target_exsits device_class: occupancy + filters: + - delayed_off: !lambda |- + return id(any_presence_timeout).state * 1000.0; - platform: template name: "Zone1 Presence" id: zone1_target_exsits