More security and motion-lighting tweaks

This commit is contained in:
2022-06-05 22:33:35 -04:00
parent 11d3d86d9d
commit ebe69ec660
4 changed files with 72 additions and 18 deletions

View File

@ -1,3 +1,8 @@
input_boolean:
shower_mode:
name: Shower Mode
icon: mdi:shower
automation:
- id: 6fe64356-00a2-4cad-bb85-f6dd05f29de7
alias: Upstairs Bathroom Motion Lights
@ -14,12 +19,15 @@ automation:
id: motion-off
for:
hours: 0
minutes: 2
seconds: 0
minutes: 1
seconds: 30
condition:
- condition: state
entity_id: light.upstairs_bathroom_lights
entity_id: input_boolean.early_night_mode
state: 'on'
- condition: state
entity_id: input_boolean.shower_mode
state: 'off'
action:
- if:
- condition: trigger
@ -46,3 +54,54 @@ automation:
{% 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