From 19353549a017605c48890e6c3deb23faf899c106 Mon Sep 17 00:00:00 2001 From: EverythingSmartHome Date: Tue, 24 Oct 2023 17:36:19 +0100 Subject: [PATCH] Add configurable timeouts for PIR and Occupancy --- everything-presence-one-beta.yaml | 32 +++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/everything-presence-one-beta.yaml b/everything-presence-one-beta.yaml index 725baa7..06db14e 100644 --- a/everything-presence-one-beta.yaml +++ b/everything-presence-one-beta.yaml @@ -196,13 +196,13 @@ binary_sensor: id: pir_motion_sensor device_class: motion filters: - - delayed_off: ${pir_delay_off} + - delayed_off: !lambda 'return id(pir_off_latency).state * 1000.0;' - platform: template name: Occupancy id: occupancy device_class: occupancy filters: - - delayed_off: ${occupancy_delay_off} + - delayed_off: !lambda 'return id(occupancy_off_latency).state * 1000.0;' lambda: |- if ( id(mmwave).state or id(pir_motion_sensor).state) { return true; @@ -557,6 +557,34 @@ number: - delay: 1s - switch.turn_on: mmwave_sensor + - platform: template + name: Occupancy off latency + icon: mdi:clock-end + entity_category: config + id: occupancy_off_latency + min_value: 1 + max_value: 60 + initial_value: 15 + optimistic: true + step: 1 + restore_value: true + unit_of_measurement: seconds + mode: slider + + - platform: template + name: PIR off latency + icon: mdi:clock-end + entity_category: config + id: pir_off_latency + min_value: 1 + max_value: 60 + initial_value: 10 + optimistic: true + step: 1 + restore_value: true + unit_of_measurement: seconds + mode: slider + - platform: template name: "Temperature Offset" id: temperature_offset_ui