Implement three core blueprints using convention-based entity lookup:
- apply_lighting_mode: Dynamic mode application with behavior polymorphism
- weekend_mode_schedule: Auto-enable/disable based on day of week
- weekend_mode_apply_settings: Apply AL adjustments for weekends
Blueprints use convention over configuration, allowing unlimited custom
modes without code changes. Modes discovered via naming pattern:
input_text.adaptive_lighting_settings_{{mode}}
86 lines
2.1 KiB
YAML
86 lines
2.1 KiB
YAML
blueprint:
|
|
name: Weekend Mode Apply Settings
|
|
description: Adjust AL settings when weekend mode toggles
|
|
domain: automation
|
|
|
|
input:
|
|
weekend_mode_boolean:
|
|
name: Weekend Mode Boolean
|
|
description: Toggle helper for weekend mode
|
|
selector:
|
|
entity:
|
|
domain: input_boolean
|
|
|
|
adaptive_lighting_switch:
|
|
name: Adaptive Lighting Switch
|
|
description: AL switch to adjust
|
|
selector:
|
|
entity:
|
|
domain: switch
|
|
integration: adaptive_lighting
|
|
|
|
sunrise_time:
|
|
name: Weekend Sunrise Time
|
|
description: Delayed sunrise time for weekends
|
|
default: "10:00:00"
|
|
selector:
|
|
time:
|
|
|
|
sunset_time:
|
|
name: Weekend Sunset Time
|
|
description: Extended sunset time for weekends
|
|
default: "01:00:00"
|
|
selector:
|
|
time:
|
|
|
|
max_brightness:
|
|
name: Weekend Max Brightness
|
|
description: Reduced max brightness for weekends
|
|
default: 60
|
|
selector:
|
|
number:
|
|
min: 1
|
|
max: 100
|
|
step: 1
|
|
unit_of_measurement: "%"
|
|
|
|
mode: restart
|
|
max_exceeded: silent
|
|
|
|
trigger:
|
|
- platform: state
|
|
entity_id: !input weekend_mode_boolean
|
|
- platform: homeassistant
|
|
event: start
|
|
|
|
variables:
|
|
weekend_boolean: !input weekend_mode_boolean
|
|
al_switch: !input adaptive_lighting_switch
|
|
sunrise_time: !input sunrise_time
|
|
sunset_time: !input sunset_time
|
|
max_brightness: !input max_brightness
|
|
weekend_active: "{{ is_state(weekend_boolean, 'on') }}"
|
|
|
|
action:
|
|
- choose:
|
|
# Weekend mode ON - Apply adjustments
|
|
- conditions: "{{ weekend_active }}"
|
|
sequence:
|
|
- service: adaptive_lighting.change_switch_settings
|
|
target:
|
|
entity_id: "{{ al_switch }}"
|
|
data:
|
|
sunrise_time: "{{ sunrise_time }}"
|
|
sunset_time: "{{ sunset_time }}"
|
|
max_brightness: "{{ max_brightness }}"
|
|
use_defaults: current
|
|
|
|
# Weekend mode OFF - Reset to defaults
|
|
- conditions: "{{ not weekend_active }}"
|
|
sequence:
|
|
- service: adaptive_lighting.change_switch_settings
|
|
target:
|
|
entity_id: "{{ al_switch }}"
|
|
data:
|
|
use_defaults: configuration
|