diff --git a/alarm_clock.yaml b/alarm_clock.yaml index af49a59..2cc528d 100644 --- a/alarm_clock.yaml +++ b/alarm_clock.yaml @@ -56,6 +56,11 @@ blueprint: selector: entity: domain: switch + presence: + name: presence + selector: + entity: + domain: input_boolean trigger_variables: alarm_time: !input alarm_time @@ -67,6 +72,7 @@ variables: target_light: !input target_light # has_woken_up: !input has_woken_up sleep_mode: !input sleep_mode + presence: !input presence trigger: - platform: template @@ -97,6 +103,9 @@ condition: action: - service: switch.turn_off entity_id: !input 'sleep_mode' + - service: input_boolean.turn_on + target: + entity_id: !input 'presence' - service: light.turn_on entity_id: !input 'target_light' data: @@ -106,10 +115,13 @@ action: - platform: state entity_id: !input alarmed_turned_off to: "on" - - wait_template: "{{ is_state(has_woken_up, 'on') }}" + # - wait_template: "{{ is_state(has_woken_up, 'on') }}" - delay: minutes: 10 - service: light.turn_off entity_id: !input 'target_light' data: - transition: 60 \ No newline at end of file + transition: 60 + - service: input_boolean.turn_off + target: + entity_id: !input 'presence' \ No newline at end of file