Window

The Window integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides dedicated triggers and conditions for windows in Home Assistant. It works with binary sensors and covers that use the window device class, so you can react when a window opens or closes, or check whether one is open before running an automation.

Note

Building block integration

This window is a building block integration that cannot be added to your Home Assistant directly but is used and provided by other integrations.

A building block integration differs from the typical integration that connects to a device or service. Instead, other integrations that do integrate a device or service into Home Assistant use this window building block to provide entities, services, and other functionality that you can use in your automations or dashboards.

If one of your integrations features this building block, this page documents the functionality the window building block offers.

List of triggers

The Window integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following triggers. Each link below opens a dedicated page with examples, fields, and a step-by-step UI walkthrough.

  • Window closed (window.closed) Triggers after one or more windows close.

  • Window opened (window.opened) Triggers after one or more windows open.

For an overview of every trigger across all integrations, see the triggers reference.

List of conditions

The Window integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following conditions. Each link below opens a dedicated page with examples, fields, and a step-by-step UI walkthrough.

For an overview of every condition across all integrations, see the conditions reference.

List of actions

This integration does not provide any documented actions yet. See the actions reference for actions from other integrations.

Window automation examples

You can use these triggers and conditions to protect your home, avoid wasting energy, and get timely reminders.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Automation: send a reminder if a window opens after sunset

If a kitchen window opens after dark, you might want a quick reminder so you can check whether everything is fine before going to bed.

  • Trigger: Window opened
  • Target: Kitchen window sensor
  • Action: Send a mobile notification
YAML example for an evening window reminder
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Notify when the kitchen window opens after sunset"
triggers:
  - trigger: window.opened
    target:
      entity_id: binary_sensor.kitchen_window
    options:
      behavior: any
      for: "00:00:00"
conditions:
  - condition: sun
    after: sunset
actions:
  - action: notify.mobile_app_phone
    data:
      title: "Kitchen window opened"
      message: "The kitchen window was opened after sunset."

Automation: turn heating back on after bedroom window is closed

If you open a bedroom window to air out the room, you can wait until it is closed again before turning the heating back on.

  • Trigger: Window closed
  • Target: Bedroom window sensor
  • Action: Climate: Set HVAC mode to heat
YAML example for restoring heating after a window closes
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Resume bedroom heating when the window closes"
triggers:
  - trigger: window.closed
    target:
      entity_id: binary_sensor.bedroom_window
    options:
      behavior: any
      for: "00:02:00"
actions:
  - action: climate.set_hvac_mode
    target:
      entity_id: climate.bedroom
    data:
      hvac_mode: heat