From b61241247076e53c1585f51882c9eec27d119d21 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Wed, 5 Nov 2025 17:25:58 -0800 Subject: [PATCH] Fix trigger to use event-based state monitoring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces unsupported domain/device_class trigger with event-based approach that listens to state_changed events and filters for selected occupancy sensors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- occupancy_controlled_lights.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/occupancy_controlled_lights.yaml b/occupancy_controlled_lights.yaml index 0d6b41a..9d65fd2 100644 --- a/occupancy_controlled_lights.yaml +++ b/occupancy_controlled_lights.yaml @@ -80,13 +80,16 @@ variables: {% endif %} trigger: - - trigger: state - domain: binary_sensor - device_class: occupancy + - platform: event + event_type: state_changed + event_data: + domain: binary_sensor condition: - condition: template - value_template: "{{ trigger.entity_id in sensors }}" + value_template: "{{ trigger.event.data.entity_id in sensors }}" + - condition: template + value_template: "{{ state_attr(trigger.event.data.entity_id, 'device_class') == 'occupancy' }}" action: - choose: