Evening lighting improvements #71
This commit is contained in:
@ -907,6 +907,12 @@ script:
|
|||||||
alias: 'Evening on First Floor'
|
alias: 'Evening on First Floor'
|
||||||
sequence:
|
sequence:
|
||||||
- choose:
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.early_night_mode
|
||||||
|
state: 'off'
|
||||||
|
sequence:
|
||||||
|
- stop: "This scene does nothing during daytime"
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.give_me_darkness
|
entity_id: input_boolean.give_me_darkness
|
||||||
@ -985,6 +991,12 @@ script:
|
|||||||
alias: 'Evening on Second Floor'
|
alias: 'Evening on Second Floor'
|
||||||
sequence:
|
sequence:
|
||||||
- choose:
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.early_night_mode
|
||||||
|
state: 'off'
|
||||||
|
sequence:
|
||||||
|
- stop: "This scene does nothing during daytime"
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.give_me_darkness
|
entity_id: input_boolean.give_me_darkness
|
||||||
|
106
scripts.yaml
106
scripts.yaml
@ -26,88 +26,34 @@ give_me_darkness:
|
|||||||
target:
|
target:
|
||||||
entity_id: input_boolean.give_me_darkness
|
entity_id: input_boolean.give_me_darkness
|
||||||
alias: Turn on input boolean
|
alias: Turn on input boolean
|
||||||
- service: light.turn_on
|
|
||||||
data: {}
|
|
||||||
target:
|
|
||||||
area_id:
|
|
||||||
- dining_room
|
|
||||||
alias: Turn on Dining Room Lamp
|
|
||||||
- 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
|
|
||||||
target:
|
|
||||||
entity_id:
|
|
||||||
- switch.adaptive_lighting_sleep_mode_dining_room
|
|
||||||
data: {}
|
|
||||||
alias: Turn on night mode for Dining Room Lamp
|
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: person.christina_stork
|
entity_id: input_boolean.guest_mode
|
||||||
state: home
|
state: 'off'
|
||||||
alias: Check if Christina is home
|
|
||||||
then:
|
then:
|
||||||
- service: input_select.select_option
|
- if:
|
||||||
data:
|
- condition: template
|
||||||
option: Night Mode
|
value_template: "{% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home')
|
||||||
target:
|
%}\n true\n{% else %}\n false\n{% endif %}"
|
||||||
entity_id: input_select.tina_desk_scenes
|
alias: Both adults are home
|
||||||
alias: Set Tina desk lights to Night Mode
|
then:
|
||||||
alias: If Christina is home, set her desk lights to night mode
|
- service: script.activate_alexa_actionable_notification
|
||||||
- choose:
|
data_template:
|
||||||
- conditions:
|
text: <voice name='Brian'><prosody rate='150%'>Would you like me to arm
|
||||||
- condition: state
|
the security system?</prosody></voice>
|
||||||
entity_id: input_boolean.guest_mode
|
event_id: actionable_notification_night_security_arm
|
||||||
state: 'off'
|
alexa_device: '{{ states(''sensor.last_alexa'') }}'
|
||||||
alias: If Guest Mode is off
|
alias: Ask to arm security
|
||||||
sequence:
|
alias: Ask to arm security if both adults are home
|
||||||
- service: light.turn_off
|
alias: If guest mode is off
|
||||||
target:
|
- wait_template: '{{ is_state(''input_boolean.give_me_darkness'',''on'') }}'
|
||||||
area_id:
|
continue_on_timeout: true
|
||||||
- kallen_bedroom
|
timeout:
|
||||||
- master_bedroom
|
seconds: 5
|
||||||
- living_room
|
- service: script.evening_on_first_floor
|
||||||
- emma_bedroom
|
data: {}
|
||||||
- downstairs_bathroom
|
- service: script.evening_on_second_floor
|
||||||
data: {}
|
data: {}
|
||||||
alias: Turn off the usual lights
|
|
||||||
- if:
|
|
||||||
- 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 %}"
|
|
||||||
alias: Both adults are home
|
|
||||||
then:
|
|
||||||
- service: script.activate_alexa_actionable_notification
|
|
||||||
data_template:
|
|
||||||
text: <voice name='Brian'><prosody rate='150%'>Would you like me to arm
|
|
||||||
the security system?</prosody></voice>
|
|
||||||
event_id: actionable_notification_night_security_arm
|
|
||||||
alexa_device: '{{ states(''sensor.last_alexa'') }}'
|
|
||||||
alias: Ask to arm security
|
|
||||||
alias: Ask to arm security if both adults are home
|
|
||||||
- conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.guest_mode
|
|
||||||
state: 'on'
|
|
||||||
alias: If Guest Mode is on
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_off
|
|
||||||
target:
|
|
||||||
area_id:
|
|
||||||
- kallen_bedroom
|
|
||||||
- master_bedroom
|
|
||||||
- emma_bedroom
|
|
||||||
- downstairs_bathroom
|
|
||||||
data: {}
|
|
||||||
alias: Same as other option, but leave living room light on
|
|
||||||
alias: Turn off lights, leave living room light on if guest mode is on, arm security
|
|
||||||
if not
|
|
||||||
mode: single
|
mode: single
|
||||||
icon: mdi:weather-night
|
icon: mdi:weather-night
|
||||||
start_youtube:
|
start_youtube:
|
||||||
@ -592,4 +538,4 @@ freeze_cleanup:
|
|||||||
target:
|
target:
|
||||||
entity_id: button.cleanup
|
entity_id: button.cleanup
|
||||||
mode: single
|
mode: single
|
||||||
icon: mdi:truck-snowflake
|
icon: mdi:truck-snowflake
|
||||||
|
Reference in New Issue
Block a user