--- # blueprints/automation/presence_mode_reset.yaml # # Presence-Based Mode and Manual Control Reset # # Automatically resets lighting mode and clears manual control when room # becomes unoccupied for a configurable duration. # # Use Cases: # - Reset Theater mode to Adaptive when leaving living room # - Clear manual brightness boosts when bedroom becomes empty # - Return bathroom to normal AL after presence ends # # Requirements: # - Binary sensor(s) for occupancy/presence detection # - Adaptive Lighting switch (optional - for manual control reset) # - Mode input_select (optional - for mode reset) # # Reference: ADAPTIVE_LIGHTING_CONTROL_SYSTEM_DESIGN.md lines 437-451, # 709-719 blueprint: name: Presence-Based Mode and Manual Control Reset description: >- Reset lighting modes and AL manual control when room becomes empty domain: automation input: occupancy_sensors: name: Occupancy Sensors description: Binary sensor(s) that detect room occupancy selector: entity: domain: binary_sensor device_class: occupancy multiple: true empty_delay: name: Empty Delay description: How long room must be empty before reset default: 5 selector: number: min: 0 max: 60 step: 1 unit_of_measurement: minutes adaptive_lighting_switch: name: Adaptive Lighting Switch (Optional) description: AL switch to reset manual control. Leave empty to skip. default: {} selector: entity: domain: switch integration: adaptive_lighting mode_input_select: name: Mode Input Select (Optional) description: Mode selector to reset to Adaptive. Leave empty to skip. default: {} selector: entity: domain: input_select default_mode: name: Default Mode description: Mode to reset to when room becomes empty default: "Adaptive" selector: text: mode: restart trigger: - platform: state entity_id: !input occupancy_sensors to: 'off' for: minutes: !input empty_delay condition: # Ensure ALL sensors are off (room is truly empty) - condition: template value_template: >- {{ expand(occupancy_sensors) | selectattr('state', 'eq', 'on') | list | count == 0 }} action: - variables: occupancy_sensors: !input occupancy_sensors al_switch: !input adaptive_lighting_switch mode_select: !input mode_input_select default_mode: !input default_mode # Reset manual control if AL switch provided - if: - condition: template value_template: "{{ al_switch not in [none, {}, ''] }}" then: - service: adaptive_lighting.set_manual_control data: entity_id: "{{ al_switch }}" manual_control: false # Reset mode if input_select provided - if: - condition: template value_template: "{{ mode_select not in [none, {}, ''] }}" then: - service: input_select.select_option target: entity_id: "{{ mode_select }}" data: option: "{{ default_mode }}"