Files
Home-Assistant-Configs/packages/lighting.yaml

162 lines
4.8 KiB
YAML

input_boolean:
shower_mode:
name: Shower Mode
icon: mdi:shower
automation:
- id: 6fe64356-00a2-4cad-bb85-f6dd05f29de7
alias: Upstairs Bathroom Motion Lights
description: Turns up lights in the upstairs bathroom at night when someone walks into the room.
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.upstairs_bathroom_motion
to: 'on'
id: motion-on
- platform: state
entity_id: binary_sensor.upstairs_bathroom_motion
to: 'off'
id: motion-off
for:
hours: 0
minutes: 1
seconds: 30
condition:
- condition: state
entity_id: input_boolean.early_night_mode
state: 'on'
- condition: state
entity_id: input_boolean.shower_mode
state: 'off'
action:
- if:
- condition: trigger
id: motion-on
then:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: Adaptive
- if:
- condition: trigger
id: motion-off
then:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: >-
{% if is_state('input_boolean.early_night_mode','on') and is_state('input_boolean.night_mode','off') %}
Nightlight
{% elif is_state('input_boolean.night_mode','on') %}
Single Nightlight
{% else %}
Adaptive
{% endif %}
- id: f52eca30-c2e4-43dc-b220-7e9be96b465a
alias: Shower Mode
description: Temporarily override upstairs bathroom motion lights for the purpose of taking a shower
trigger:
- platform: state
entity_id: input_boolean.shower_mode
from: 'off'
to: 'on'
id: shower-on
- platform: state
entity_id: input_boolean.shower_mode
from: 'on'
to: 'off'
id: shower-off
action:
- if:
- condition: trigger
id: shower-on
then:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: Bright
- if:
- condition: trigger
id: shower-off
then:
- if:
- condition: state
entity_id: input_boolean.early_night_mode
state: 'on'
then:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: Adaptive
else:
- service: light.turn_off
target:
entity_id: light.upstairs_bathroom_lights
- service: switch.turn_on
target:
entity_id: switch.adaptive_lighting_upstairs_bathroom
- service: input_text.set_value
target:
entity_id: input_text.upstairs_bathroom_selected_scene
data:
value: Adaptive
- id: 477e6e8a-4e33-4268-8c2d-f39902c0d64f
alias: Living Room Night Lighting
description: Provide nighting in case anyone needs to go downstairs in the middle of the night.
trigger:
- platform: state
entity_id: binary_sensor.living_room_motion
from: 'off'
to: 'on'
id: motion-on
- platform: state
entity_id: binary_sensor.living_room_motion
from: 'on'
to: 'off'
for:
hours: 0
minutes: 10
seconds: 0
id: motion-off
condition:
- condition: state
entity_id: binary_sensor.people_present
state: 'on'
- condition: state
entity_id: input_boolean.night_mode
state: 'on'
action:
- if:
- condition: trigger
id: motion-on
then:
- service: light.turn_on
target:
entity_id: light.first_floor_lights
- service: input_select.select_option
target:
entity_id:
- input_select.living_room_scenes
- input_select.tina_lamp_scenes
- input_select.mud_room_scenes
- input_select.downstairs_bathroom_scenes
data:
option: Adaptive
- service: input_select.select_option
target:
entity_id: input_select.dining_room_lamp_modes
data:
option: Reset
- if:
- condition: trigger
id: motion-off
then:
- service: light.turn_off
target:
entity_id: light.first_floor_lights