Skip to main content
Selora Homes Selora Homes
Recipe · v1.0.0 · Released Aug 28, 2026

Pause Media on Doorbell

Installs a Home Assistant automation that pauses whatever is playing the moment someone rings the doorbell, so you hear it over the film. Add your TV and streaming box so they pause too, and an outdoor light that comes on to greet the caller.

The doorbell you miss is the one that rings during the loud part. This recipe pauses whatever is playing the instant someone rings, so the bell lands in a quiet room rather than under the film. Point it at the speakers and screens in the rooms where a ring would otherwise go unheard, and a caller no longer has to lean on the button.

By default it pauses and leaves it there for you to pick back up when you are ready. If you would rather it carried on by itself, set an auto-resume time and it starts again after that many seconds, but only the players it actually paused, so it never kicks an idle speaker into life.

Bringing in the TV and a light

Add your TV and streaming box as the optional roles and they pause on a ring too, so a film stops rather than rolling on while you get the door. Add an outdoor light and it comes on with the ring after dark, so whoever is at the door gets a lit doorway rather than a dark step, and it only comes on when it is actually dark out.

Files Selora AI's pipeline reads to install this recipe. The manifest declares roles, inputs, and integrations; the package files are Jinja-templated YAML applied to Home Assistant.

# Pause Media on Doorbell — pause the media players on a doorbell press, with
# the TV and streaming box brought in as optional players and an optional
# outdoor light.
#
# The doorbell role is a binary_sensor whose on state is the press. The players
# to pause are the required media-player role plus optional TV and streaming
# roles, all media_player entities combined into one list. An optional
# auto-resume, off by default, plays back only the players still paused. The
# outdoor light is gated to after dark by the sun.
slug: pause-media-on-doorbell
version: 1.0.0
title: Pause Media on Doorbell
tagline: A doorbell ring pauses whatever is playing, so you hear it over the film.
description: >-
  Pauses the media players you pick the moment the doorbell is pressed, so a
  ring is heard rather than lost under the sound. Optionally pauses the TV and
  streaming box too, resumes on its own after a delay, and lights the doorway
  after dark.
author: Selora AI
released: "2026-08-28"
min_integration_version: "0.12.0"
tags: [media, doorbell, convenience]
roles:
  # Doorbell — the press trigger. binary_sensor, on = pressed. min_count 1.
  - id: doorbells
    title: Doorbell
    kind: binary_sensor
    min_count: 1
    selection: required
    description: >-
      The doorbell whose press pauses the media.
  # Media players to pause — multi-select. media_player. min_count 1.
  - id: media_players
    title: Speakers and players
    kind: media_player
    min_count: 1
    selection: required
    description: >-
      The speakers or players paused on a ring.
  # Optional TV, also a media_player. min_count 0.
  - id: tvs
    title: TV
    kind: media_player
    min_count: 0
    selection: required
    description: >-
      Optional. Your TV, paused on a ring alongside the speakers. Leave empty to
      skip.
  # Optional streaming box, also a media_player. min_count 0.
  - id: streamers
    title: Streaming box
    kind: media_player
    min_count: 0
    selection: required
    description: >-
      Optional. A streaming box or stick, paused on a ring too. Leave empty to
      skip.
  # Optional outdoor light lit with the ring after dark. kind light.
  - id: outdoor_lights
    title: Outdoor light
    kind: light
    min_count: 0
    selection: required
    description: >-
      Optional. An outdoor light that comes on with the ring after dark. Leave
      empty to skip.
inputs:
  # Auto-resume delay in seconds. 0 pauses only, leaving it to you to resume.
  # Above 0, the recipe plays back after the delay, but only the players still
  # paused, so it never starts an idle speaker.
  - id: auto_resume_seconds
    type: number
    label: Auto-resume after (seconds)
    description: >-
      Seconds after the ring to resume playback. 0 pauses only and leaves it to
      you.
    default: 0
    min: 0
    max: 3600
  # Whether the outdoor light only comes on after dark.
  - id: lights_only_after_dark
    type: boolean
    label: Light only after dark
    description: >-
      When on, the optional outdoor light only comes on if it is dark outside.
    default: true
package_files:
  - package/automations/doorbell.yaml.j2
{# Pause Media on Doorbell.

   On a doorbell press, pause the selected players (speakers plus optional TV
   and streaming box) that are actually playing. When an outdoor light is picked
   it comes on, gated to sun below the horizon unless the after-dark option is
   off.

   Pausing is per player and guarded on the playing state, the mirror of the
   resume block below. media_player.media_pause requires the PAUSE feature, and
   a player that is off or idle does not report it, so calling it across the
   whole list raises as soon as one is not playing and the rest of the run never
   happens: no doorway light, no resume. A TV switched off when the doorbell
   goes is the normal case, not the corner case.

   The auto-resume block is rendered only when the delay is above 0. It waits
   the delay, then plays back only the players this run paused and that are
   still paused, so a player that was already paused before the doorbell is
   never started, and one the homeowner resumed by hand is left alone. #}
{% set players = roles.media_players + roles.tvs + roles.streamers %}
automation:
  - id: selora_recipe_{{ slug | replace('-', '_') }}_doorbell
    alias: "Pause Media on Doorbell"
    description: >-
      When the doorbell is pressed, pause the media players and optionally light
      the doorway.
    # single, not restart: the pause and its resume are one transaction. Under
    # restart a second ring during the delay would cancel the run holding the
    # resume and re-sample an already-paused house, finding nothing playing and
    # leaving the media paused for good. max_exceeded: silent because a second
    # ring while the first is still resolving is ordinary, not a fault.
    mode: single
    max_exceeded: silent
    trigger:
{% for doorbell in roles.doorbells %}
      - platform: state
        entity_id: {{ doorbell }}
        to: "on"
{% endfor %}
    action:
      # The players this run actually pauses, captured before anything is
      # touched. Resuming whatever happens to be paused later would start a
      # player the homeowner had already paused before the doorbell rang, or
      # paused by hand while they answered the door.
      - variables:
          paused_by_us: "{% raw %}{{ expand({% endraw %}{% for player in players %}'{{ player }}'{{ ', ' if not loop.last else '' }}{% endfor %}{% raw %}) | selectattr('state', 'eq', 'playing') | map(attribute='entity_id') | list }}{% endraw %}"
      - repeat:
          for_each: "{% raw %}{{ paused_by_us }}{% endraw %}"
          sequence:
            # continue_on_error because the role takes any media_player and
            # media_pause needs the PAUSE feature. A player that reports playing
            # but cannot pause would otherwise raise, abort the repeat, and take
            # the rest of the run with it: the players after it stay loud, the
            # doorway light never comes on and nothing resumes.
            - service: media_player.media_pause
              continue_on_error: true
              target:
                entity_id: "{% raw %}{{ repeat.item }}{% endraw %}"
{% if roles.outdoor_lights %}
{% if inputs.lights_only_after_dark %}
      - if:
          - condition: state
            entity_id: sun.sun
            state: "below_horizon"
        then:
          - service: light.turn_on
            target:
              entity_id:
{% for light in roles.outdoor_lights %}
                - {{ light }}
{% endfor %}
{% else %}
      - service: light.turn_on
        target:
          entity_id:
{% for light in roles.outdoor_lights %}
            - {{ light }}
{% endfor %}
{% endif %}
{% endif %}
{% if inputs.auto_resume_seconds %}
      - delay:
          seconds: {{ inputs.auto_resume_seconds }}
      - repeat:
          for_each: "{% raw %}{{ paused_by_us }}{% endraw %}"
          sequence:
            # Still guarded on paused, so a player the homeowner resumed by hand
            # or switched off during the delay is left where they put it.
            - if:
                - condition: template
                  value_template: "{% raw %}{{ is_state(repeat.item, 'paused') }}{% endraw %}"
              then:
                # Same reasoning as the pause side: one player that cannot be
                # resumed must not strand the others paused.
                - service: media_player.media_play
                  continue_on_error: true
                  target:
                    entity_id: "{% raw %}{{ repeat.item }}{% endraw %}"
{% endif %}

Type to search across

↑↓ navigate ↵ open
⌘K search