Reworked "Give Me Darkness" script

This commit is contained in:
2022-12-24 10:59:24 -05:00
parent 5ff883b556
commit 5b67c1fa7f

View File

@ -30,6 +30,45 @@ give_me_darkness:
target: target:
area_id: area_id:
- dining_room - dining_room
- choose:
- conditions:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
sequence:
- service: light.turn_off
target:
area_id:
- kallen_bedroom
- master_bedroom
- living_room
- emma_bedroom
- downstairs_bathroom
data: {}
- conditions:
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
sequence:
- service: light.turn_off
target:
area_id:
- kallen_bedroom
- master_bedroom
- emma_bedroom
- downstairs_bathroom
data: {}
alias: Leave living room light on
alias: Turn off lights, leave living room light on if guest mode is on
- service: input_select.select_option
target:
entity_id:
- input_select.upstairs_hallway_scenes
- input_select.mud_room_scenes
- input_select.upstairs_bathroom_scenes
data:
option: Nightlight
alias: Set nightlights
- service: switch.turn_on - service: switch.turn_on
target: target:
entity_id: entity_id:
@ -45,31 +84,19 @@ give_me_darkness:
option: Night Mode option: Night Mode
target: target:
entity_id: input_select.tina_desk_scenes entity_id: input_select.tina_desk_scenes
- service: input_select.select_option - if:
target: - condition: template
entity_id: value_template: "{% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home')
- input_select.upstairs_hallway_scenes %}\n true\n{% else %}\n false\n{% endif %}"
- input_select.mud_room_scenes alias: Both adults are home
- input_select.upstairs_bathroom_scenes then:
data: - service: script.activate_alexa_actionable_notification
option: Nightlight data_template:
- service: light.turn_off text: Would you like me to arm the security system?
target: event_id: actionable_notification_night_security_arm
area_id: alexa_device: '{{ states(''sensor.last_alexa'') }}'
- kallen_bedroom alias: Ask to arm security
- master_bedroom alias: Ask to arm security if both adults are home
- living_room
- emma_bedroom
- downstairs_bathroom
data: {}
- condition: template
value_template: "{% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home')
%}\n true\n{% else %}\n false\n{% endif %}"
- service: script.activate_alexa_actionable_notification
data_template:
text: Would you like me to arm the security system?
event_id: actionable_notification_night_security_arm
alexa_device: '{{ states(''sensor.last_alexa'') }}'
mode: single mode: single
icon: mdi:weather-night icon: mdi:weather-night
start_youtube: start_youtube:
@ -369,8 +396,8 @@ max_brightness_cleanup:
data: {} data: {}
target: target:
entity_id: entity_id:
- input_boolean.shower_mode - input_boolean.shower_mode
- input_boolean.tina_desk_lights - input_boolean.tina_desk_lights
- service: input_boolean.turn_on - service: input_boolean.turn_on
data: {} data: {}
target: target: