alias: Open Windows Alert
description: Tell me to open the upstairs windows when it's hot outside
trigger:
  - platform: time
    at:
      - "16:30:00"
      - "16:40:00"
      - "16:50:00"
      - "17:00:00"
      - "17:10:00"
      - "17:20:00"
      - "17:30:00"
      - "17:40:00"
      - "17:50:00"
      - "18:10:00"
      - "18:20:00"
      - "18:30:00"
      - "18:40:00"
      - "18:50:00"
      - "19:00:00"
      - "19:10:00"
      - "19:20:00"
      - "19:30:00"
      - "19:40:00"
      - "19:50:00"
      - "20:00:00"
      - "20:10:00"
      - "20:20:00"
      - "20:30:00"
      - "20:40:00"
      - "20:50:00"
      - "21:00:00"
      - "21:10:00"
      - "21:20:00"
      - "21:30:00"
      - "21:40:00"
      - "21:50:00"
      - "22:00:00"
      - "22:10:00"
      - "22:20:00"
      - "22:30:00"
      - "22:40:00"
      - "22:50:00"
      - "23:00:00"
      - "23:10:00"
      - "23:20:00"
      - "23:30:00"
      - "23:40:00"
      - "23:50:00"
condition:
  - condition: state
    entity_id: input_boolean.temperature_alert
    state: "off"
  - condition: numeric_state
    entity_id: sensor.upstairs_temperature_template
    above: 75
  - condition: numeric_state
    entity_id: sensor.forecast_temperature_template
    above: 62
  - condition: template
    value_template: >-
      {{ states('sensor.upstairs_temperature_template') >
      states('sensor.KMOP_temperature') }}      
action:
  - service: notify.mobile_app_neals_iphone
    data:
      message: Open the Windows
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.temperature_alert
mode: single