From b89447182897efd9caa49d1f30ff593b78d2b260 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Wed, 5 Nov 2025 17:14:02 -0800 Subject: [PATCH] Add configurable off delay to occupancy controlled lights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds off_delay input parameter allowing users to configure how long to wait after motion stops before turning lights off. Includes re-verification to prevent lights turning off if motion resumes during the delay period. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- occupancy_controlled_lights.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/occupancy_controlled_lights.yaml b/occupancy_controlled_lights.yaml index ab34a99..6add3f5 100644 --- a/occupancy_controlled_lights.yaml +++ b/occupancy_controlled_lights.yaml @@ -57,6 +57,16 @@ blueprint: default: true selector: boolean: + off_delay: + name: Off Delay + description: Time to wait after no motion before turning lights off + default: 0 + selector: + number: + min: 0 + max: 3600 + step: 1 + unit_of_measurement: seconds trigger: - trigger: state @@ -92,6 +102,11 @@ action: entity_id: !input occupancy_sensor state: "off" sequence: + - delay: + seconds: !input off_delay + - condition: state + entity_id: !input occupancy_sensor + state: "off" - action: light.turn_off target: !input lights data: