Split home arrival into two scripts for day and night #51

This commit is contained in:
2022-10-12 18:56:22 -04:00
parent c3a23754d4
commit 0b8fee1bb6
2 changed files with 73 additions and 43 deletions

View File

@ -178,8 +178,17 @@
entity_id: binary_sensor.internet entity_id: binary_sensor.internet
state: 'off' state: 'off'
action: action:
- service: script.family_is_home - if:
data: {} - condition: state
entity_id: input_boolean.early_night_mode
state: 'on'
then:
- service: script.family_is_home_night
data: {}
else:
- service: script.family_is_home_day
data: {}
alias: Check early night mode, choose which script to run
mode: restart mode: restart
- id: '1641102018783' - id: '1641102018783'
alias: Family Has Left alias: Family Has Left

View File

@ -323,8 +323,8 @@ script:
- service: script.security_arm_away - service: script.security_arm_away
mode: single mode: single
icon: mdi:shield-lock icon: mdi:shield-lock
family_is_home: family_is_home_day:
alias: Family Is Home alias: Family Is Home Day
sequence: sequence:
- service: switch.turn_off - service: switch.turn_off
target: target:
@ -336,11 +336,15 @@ script:
- switch.basement_echo_dot_do_not_disturb_switch - switch.basement_echo_dot_do_not_disturb_switch
- switch.living_room_echo_dot_do_not_disturb_switch - switch.living_room_echo_dot_do_not_disturb_switch
- switch.master_bedroom_echo_dot_do_not_disturb_switch - switch.master_bedroom_echo_dot_do_not_disturb_switch
- service: script.welcome_home
- if: - if:
- condition: state - condition: template
entity_id: input_boolean.early_night_mode value_template: >
state: 'on' {% set weather = states('weather.iron_nerd_weather_station') %}
{% if weather in ['cloudy','partlycloudy','rainy','snowy','hail','lightning','lightning-rainy','pouring','snowy-rainy'] %}
true
{% else %}
false
{% endif %}
then: then:
- service: light.turn_on - service: light.turn_on
target: target:
@ -366,41 +370,6 @@ script:
entity_id: input_select.dining_room_lamp_scenes entity_id: input_select.dining_room_lamp_scenes
data: data:
option: Full option: Full
else:
- if:
- condition: template
value_template: >
{% set weather = states('weather.iron_nerd_weather_station') %}
{% if weather in ['cloudy','partlycloudy','rainy','snowy','hail','lightning','lightning-rainy','pouring','snowy-rainy'] %}
true
{% else %}
false
{% endif %}
then:
- service: light.turn_on
target:
area_id:
- living_room
- dining_room
- mud_room
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- service: input_select.select_option
target:
entity_id:
- input_select.living_room_scenes
- input_select.tina_lamp_scenes
- input_select.mud_room_scenes
data:
option: Adaptive
- service: input_select.select_option
target:
entity_id: input_select.dining_room_lamp_scenes
data:
option: Full
- service: light.turn_off - service: light.turn_off
target: target:
area_id: area_id:
@ -412,5 +381,57 @@ script:
- basement_studio - basement_studio
- downstairs_bathroom - downstairs_bathroom
- upstairs_bathroom - upstairs_bathroom
- service: script.welcome_home
mode: single
icon: mdi:home-account
family_is_home_night:
alias: Family Is Home Night
sequence:
- service: switch.turn_off
target:
entity_id: switch.presence_simulation
- service: script.security_disarm
- service: switch.turn_off
target:
entity_id:
- switch.basement_echo_dot_do_not_disturb_switch
- switch.living_room_echo_dot_do_not_disturb_switch
- switch.master_bedroom_echo_dot_do_not_disturb_switch
- service: light.turn_on
target:
area_id:
- living_room
- dining_room
- mud_room
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- service: input_select.select_option
target:
entity_id:
- input_select.living_room_scenes
- input_select.tina_lamp_scenes
- input_select.mud_room_scenes
data:
option: Adaptive
- service: input_select.select_option
target:
entity_id: input_select.dining_room_lamp_scenes
data:
option: Full
- service: light.turn_off
target:
area_id:
- furnace_room
- kallen_bedroom
- nursery
- master_bedroom
- upstairs_hallway
- basement_studio
- downstairs_bathroom
- upstairs_bathroom
- service: script.welcome_home
mode: single mode: single
icon: mdi:home-account icon: mdi:home-account