Files
home-assistant-blueprints/blueprints/automation/presence_mode_reset.yaml
John Ogle 5eec41a43c Add button actions and presence reset blueprints
- Add inovelli_button_actions blueprint for multi-tap controls
  - Double-tap up: brightness boost (+50%)
  - Double-tap down: return to adaptive lighting
  - Triple-tap up: max brightness (100%, 4000K)
  - Triple-tap down: night light (5%, warm red)
  - Configurable auto-reset timeout

- Add presence_mode_reset blueprint for occupancy integration
  - Auto-reset manual control when room empty
  - Optional mode reset to default
  - Configurable empty delay
  - Multiple occupancy sensor support

- Fix entity name in living room template (light.living_room_lights)
2025-12-21 14:30:41 -08:00

118 lines
3.1 KiB
YAML

---
# 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 }}"