From 89d268b3f4875817f97e5ff46a10d7a38f38ed92 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Wed, 5 Nov 2025 17:23:24 -0800 Subject: [PATCH] Fix trigger to use domain-based filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces template variable in trigger entity_id with domain/device_class trigger and condition filter. This properly handles dynamic sensor selection from target selector. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- occupancy_controlled_lights.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/occupancy_controlled_lights.yaml b/occupancy_controlled_lights.yaml index 15c4d67..a224060 100644 --- a/occupancy_controlled_lights.yaml +++ b/occupancy_controlled_lights.yaml @@ -81,9 +81,12 @@ variables: trigger: - trigger: state - entity_id: "{{ sensors }}" + domain: binary_sensor + device_class: occupancy -condition: [] +condition: + - condition: template + value_template: "{{ trigger.entity_id in sensors }}" action: - choose: