<commit_before>- alias: 'Send Notification about Stay-at-Home Order'
  id: 12159f5c-0c00-41de-9353-feac3b9754de
  trigger:
    - platform: state
      entity_id: person.david
      from: 'home'
      to: 'not_home'
    - platform: time
      at: '21:00:00'
    - platform: template
      value_template: "{{ distance(states.person.david) < 15 }}"
  condition:
    - condition: state
      entity_id: person.david
      state: 'not_home'
    - condition: template
      value_template: "{{ distance(states.person.david) < 15 }}"
    - condition: or
      conditions:
        - condition: time
          after: '21:00:00'
          before: '00:00:00'
        - condition: time
          after: '00:00:00'
          before: '05:00:00'
  action:
    service: notify.mobile_app_iphone_von_david
    data_template:
      title: "Stay-at-home order in force"
      message: "Mind the stay-at-home order. The current 7-day incidence in Aachen is {{ states('sensor.coronavirus_aachen_cityregion_rki_incidence7') }}."
      data:
        tag: "stay-at-home-order"
        push:
          sound:
            name: default
            critical: 1
            volume: 1.0

- alias: 'Clear Notification about Stay-at-Home Order'
  id: 6635de6b-4e49-4426-bf3c-a6ca7093a04e
  trigger:
    - platform: state
      entity_id: person.david
      from: 'not_home'
      to: 'home'
    - platform: time
      at: '5:00:00'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"
      data:
        tag: "stay-at-home-order"

- alias: 'Send Notification about unclosed Outdoor Doors'
  id: 75546147-378a-4dbc-b2ca-f4d4f707da15
  trigger:
    platform: state
    entity_id:
      - binary_sensor.outdoor_frontdoor_contact
      - binary_sensor.outdoor_backdoor_contact
    to: 'on'
    for:
      minutes: 10
  condition:
    - condition: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      state: 'off'
    - condition: numeric_state
      entity_id: sensor.dark_sky_temperature
      below: 16
    - condition: not
      conditions:
        - condition: state
          entity_id:
            - binary_sensor.outdoor_frontdoor_contact
            - binary_sensor.outdoor_backdoor_contact
          state: 'on'
          for:
            minutes: 10
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      title: "Outdoor doors unclosed"
      message: "Close outdoor doors to keep it warm."
      data:
        tag: "unclosed-outdoor-doors"

- alias: 'Clear Notification about unclosed Outdoor Doors'
  id: 98cd6b76-8b4c-48f2-82c5-73d3e492e426
  trigger:
    platform: state
    entity_id:
      - binary_sensor.outdoor_frontdoor_contact
      - binary_sensor.outdoor_backdoor_contact
    to: 'off'
  condition:
    condition: state
    entity_id:
      - binary_sensor.outdoor_frontdoor_contact
      - binary_sensor.outdoor_backdoor_contact
    state: 'off'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"
      data:
        tag: "unclosed-outdoor-doors"

- alias: 'Send Notification about unclosed Bedroom Windows'
  id: 0c534f2d-72da-42fb-86e3-034ba16a16f0
  trigger:
    platform: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    to: 'on'
    for:
      minutes: 10
  condition:
    - condition: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      state: 'off'
    - condition: numeric_state
      entity_id: sensor.dark_sky_temperature
      below: 16
    - condition: not
      conditions:
        - condition: state
          entity_id:
            - binary_sensor.bedroom_window_left_contact
            - binary_sensor.bedroom_window_right_contact
          state: 'on'
          for:
            minutes: 10
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      title: "Bedroom windows unclosed"
      message: "Close bedroom windows to keep it warm."
      data:
        tag: "unclosed-bedroom-windows"

- alias: 'Clear Notification about unclosed Bedroom Windows'
  id: e77baedc-3316-4650-9565-82049ec3ace4
  trigger:
    platform: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    to: 'off'
  condition:
    condition: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    state: 'off'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"
      data:
        tag: "unclosed-bedroom-windows"

- alias: 'Send Notification about pending Bedroom Ventilation'
  id: 09ac3a7a-e198-4bd6-8892-6320aa9be819
  trigger:
    - platform: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      to: 'off'
      for:
        minutes: 30
    - platform: state
      entity_id:
        - binary_sensor.bedroom_window_left_contact
        - binary_sensor.bedroom_window_right_contact
      to: 'off'
      for:
        hours: 6
  condition:
    - condition: state
      entity_id: sensor.period_of_day
      state:
        - 'Sunrise'
        - 'Day'
        - 'Sunset'
    - condition: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      state: 'off'
      for:
        minutes: 30
    - condition: state
      entity_id:
        - binary_sensor.bedroom_window_left_contact
        - binary_sensor.bedroom_window_right_contact
      state: 'off'
      for:
        hours: 6
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      title: "Bedroom ventilation pending"
      message: "Open bedroom windows to get some fresh air."
      data:
        tag: "pending-bedroom-ventilation"

- alias: 'Clear Notification about pending Bedroom Ventilation'
  id: 279a2bf7-b4cc-4095-a3d4-b3b6e10619bc
  trigger:
    platform: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    to: 'on'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"<commit_msg>Fix automation to clear notification about pending bedroom ventilation<commit_after>- alias: 'Send Notification about Stay-at-Home Order'
  id: 12159f5c-0c00-41de-9353-feac3b9754de
  trigger:
    - platform: state
      entity_id: person.david
      from: 'home'
      to: 'not_home'
    - platform: time
      at: '21:00:00'
    - platform: template
      value_template: "{{ distance(states.person.david) < 15 }}"
  condition:
    - condition: state
      entity_id: person.david
      state: 'not_home'
    - condition: template
      value_template: "{{ distance(states.person.david) < 15 }}"
    - condition: or
      conditions:
        - condition: time
          after: '21:00:00'
          before: '00:00:00'
        - condition: time
          after: '00:00:00'
          before: '05:00:00'
  action:
    service: notify.mobile_app_iphone_von_david
    data_template:
      title: "Stay-at-home order in force"
      message: "Mind the stay-at-home order. The current 7-day incidence in Aachen is {{ states('sensor.coronavirus_aachen_cityregion_rki_incidence7') }}."
      data:
        tag: "stay-at-home-order"
        push:
          sound:
            name: default
            critical: 1
            volume: 1.0

- alias: 'Clear Notification about Stay-at-Home Order'
  id: 6635de6b-4e49-4426-bf3c-a6ca7093a04e
  trigger:
    - platform: state
      entity_id: person.david
      from: 'not_home'
      to: 'home'
    - platform: time
      at: '5:00:00'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"
      data:
        tag: "stay-at-home-order"

- alias: 'Send Notification about unclosed Outdoor Doors'
  id: 75546147-378a-4dbc-b2ca-f4d4f707da15
  trigger:
    platform: state
    entity_id:
      - binary_sensor.outdoor_frontdoor_contact
      - binary_sensor.outdoor_backdoor_contact
    to: 'on'
    for:
      minutes: 10
  condition:
    - condition: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      state: 'off'
    - condition: numeric_state
      entity_id: sensor.dark_sky_temperature
      below: 16
    - condition: not
      conditions:
        - condition: state
          entity_id:
            - binary_sensor.outdoor_frontdoor_contact
            - binary_sensor.outdoor_backdoor_contact
          state: 'on'
          for:
            minutes: 10
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      title: "Outdoor doors unclosed"
      message: "Close outdoor doors to keep it warm."
      data:
        tag: "unclosed-outdoor-doors"

- alias: 'Clear Notification about unclosed Outdoor Doors'
  id: 98cd6b76-8b4c-48f2-82c5-73d3e492e426
  trigger:
    platform: state
    entity_id:
      - binary_sensor.outdoor_frontdoor_contact
      - binary_sensor.outdoor_backdoor_contact
    to: 'off'
  condition:
    condition: state
    entity_id:
      - binary_sensor.outdoor_frontdoor_contact
      - binary_sensor.outdoor_backdoor_contact
    state: 'off'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"
      data:
        tag: "unclosed-outdoor-doors"

- alias: 'Send Notification about unclosed Bedroom Windows'
  id: 0c534f2d-72da-42fb-86e3-034ba16a16f0
  trigger:
    platform: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    to: 'on'
    for:
      minutes: 10
  condition:
    - condition: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      state: 'off'
    - condition: numeric_state
      entity_id: sensor.dark_sky_temperature
      below: 16
    - condition: not
      conditions:
        - condition: state
          entity_id:
            - binary_sensor.bedroom_window_left_contact
            - binary_sensor.bedroom_window_right_contact
          state: 'on'
          for:
            minutes: 10
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      title: "Bedroom windows unclosed"
      message: "Close bedroom windows to keep it warm."
      data:
        tag: "unclosed-bedroom-windows"

- alias: 'Clear Notification about unclosed Bedroom Windows'
  id: e77baedc-3316-4650-9565-82049ec3ace4
  trigger:
    platform: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    to: 'off'
  condition:
    condition: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    state: 'off'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"
      data:
        tag: "unclosed-bedroom-windows"

- alias: 'Send Notification about pending Bedroom Ventilation'
  id: 09ac3a7a-e198-4bd6-8892-6320aa9be819
  trigger:
    - platform: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      to: 'off'
      for:
        minutes: 30
    - platform: state
      entity_id:
        - binary_sensor.bedroom_window_left_contact
        - binary_sensor.bedroom_window_right_contact
      to: 'off'
      for:
        hours: 6
  condition:
    - condition: state
      entity_id: sensor.period_of_day
      state:
        - 'Sunrise'
        - 'Day'
        - 'Sunset'
    - condition: state
      entity_id:
        - input_select.away_mode
        - input_select.bed_mode
      state: 'off'
      for:
        minutes: 30
    - condition: state
      entity_id:
        - binary_sensor.bedroom_window_left_contact
        - binary_sensor.bedroom_window_right_contact
      state: 'off'
      for:
        hours: 6
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      title: "Bedroom ventilation pending"
      message: "Open bedroom windows to get some fresh air."
      data:
        tag: "pending-bedroom-ventilation"

- alias: 'Clear Notification about pending Bedroom Ventilation'
  id: <PASSWORD>
  trigger:
    platform: state
    entity_id:
      - binary_sensor.bedroom_window_left_contact
      - binary_sensor.bedroom_window_right_contact
    to: 'on'
  condition:
    condition: not
    conditions:
      - condition: state
        entity_id:
          - binary_sensor.bedroom_window_left_contact
          - binary_sensor.bedroom_window_right_contact
        state: 'on'
  action:
    service: notify.mobile_app_iphone_von_david
    data:
      message: "clear_notification"
{'fraction_non_alphanumeric': 0.08171114599686029, 'fraction_numerical': 0.033830455259026684, 'mean_word_length': 2.352894736842105, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2464594', 'n_tokens_mistral': 4407, 'n_tokens_neox': 4122, 'n_words': 856}