diff --git a/automations.yaml b/automations.yaml index 22355f6..696bcc5 100644 --- a/automations.yaml +++ b/automations.yaml @@ -178,8 +178,17 @@ entity_id: binary_sensor.internet state: 'off' action: - - service: script.family_is_home - data: {} + - if: + - 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 - id: '1641102018783' alias: Family Has Left diff --git a/packages/presence.yaml b/packages/presence.yaml index 541430d..69fbbb3 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -323,8 +323,8 @@ script: - service: script.security_arm_away mode: single icon: mdi:shield-lock - family_is_home: - alias: Family Is Home + family_is_home_day: + alias: Family Is Home Day sequence: - service: switch.turn_off target: @@ -336,11 +336,15 @@ script: - 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: script.welcome_home - if: - - condition: state - entity_id: input_boolean.early_night_mode - state: 'on' + - 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: @@ -366,41 +370,6 @@ script: entity_id: input_select.dining_room_lamp_scenes data: 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 target: area_id: @@ -412,5 +381,57 @@ script: - basement_studio - downstairs_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 icon: mdi:home-account \ No newline at end of file