Doorbell rang
The Doorbell rang trigger reacts when someone rings a doorbell. It works with event entities that have the doorbell device class, such as the doorbell button of a video doorbell.
Use it to get a notification when someone is at the door, or to turn on a light at the front door when someone rings.
Using this trigger from the user interface
If you prefer building automations visually, Home Assistant walks you through this trigger step by step. You pick what to watch, tweak a few options, and save. No YAML knowledge required.
To use this trigger in an automation:
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- In the When section, select Add trigger.
- From the search box, search for and select Doorbell rang.
- Select what you want to monitor. Under By target (see Targets), pick the doorbell you want to monitor, or the area it is in, like your hallway or entrance. You can also select a floor, a device, a specific entity, or a label.
- Select Save.
Options in the UI
This trigger has no additional options beyond the target.
Using this trigger in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.
In YAML, refer to this trigger as doorbell.rang. A basic example looks like this:
trigger: doorbell.rang
target:
entity_id: event.front_door_doorbell
This reacts every time someone rings the doorbell of event.front_door_doorbell.
Options in YAML
This trigger has no additional YAML options beyond the target.
Targets of the trigger
This trigger requires a target. The target is the object that Home Assistant will watch. You can select a single entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], a device, an area, a floor, or a label as a target, and Home Assistant will watch every matching event entity behind that target.
-
Entity: one specific event entity, such as
event.living_room. - Device: every event entity that belongs to a device.
- Area: every event entity in a room or area.
- Floor: every event entity on a floor.
- Label: every event entity that shares a label.
You can also select different target types in one trigger. For example, you can add a specific entity and an area as targets in the same trigger to monitor both of them at once.
Trigger variables
When the trigger fires, the trigger variable identifies the entity that caused it to fire. This is useful when a target contains multiple entities, such as a device, area, floor, or label.
The following trigger-specific variables are available:
| Template variable | Data |
|---|---|
trigger.entity_id |
Entity ID of the entity that caused the trigger to fire. |
trigger.from_state |
Previous state object of that entity. |
trigger.to_state |
New state object of that entity. |
trigger.for |
Timedelta object of how long the trigger criteria was met, if applicable. |
For example, use {{ trigger.to_state.name }} in an action to include the name of the entity that caused the trigger in a notification.
The trigger variable describes the entity that caused the trigger to fire; it does not contain all entities resolved from the configured target.
Good to know
- If you select a device, an area, a floor, or a label, Home Assistant only watches the doorbell event entities behind that target, and skips entities marked as configuration or diagnostic entities.
- The trigger only reacts to the Ring event type. Other event types of the same entity don’t start the automation.
- If you select several doorbells, the trigger reacts every time any one of them rings.
- The first ring after Home Assistant starts also counts, even if the doorbell showed Unknown before. If a doorbell comes back from Unavailable, that recovery doesn’t count as a ring.
- To react to other event types that your integration provides, use the Event received trigger instead.
Try it yourself
Ready to test this? Go to Settings > Automations & scenes, create a new automation, and add this trigger. Save the automation, then change the state of the targeted entity to watch the trigger fire on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more].
More examples
Real scenarios where this trigger fires in automations and scripts. Copy any example and adapt it to your setup.
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 notification when someone rings the doorbell
Get a notification on your phone when someone rings the front door, so you know someone is there even when you can’t hear the chime.
-
Trigger: Doorbell rang
- Target: Front door doorbell
-
Action: Send a notification message
-
Target: My Device (
notify.my_device)
-
Target: My Device (
YAML example for a doorbell notification
alias: "Notify when someone rings the doorbell"
triggers:
- trigger: doorbell.rang
target:
entity_id: event.front_door_doorbell
actions:
- action: notify.send_message
target:
entity_id: notify.my_device
data:
message: "Someone rang the front door doorbell."
Automation: turn on the porch light when someone rings after sunset
When someone rings the doorbell after sunset, turn on the porch light so you can see who is at the door.
-
Trigger: Doorbell rang
- Target: Front door doorbell
-
Condition: State
- Entity: Sun
- State: Below horizon
-
Action: Turn on light
- Target: Porch light
YAML example for turning on the porch light
alias: "Turn on the porch light when someone rings after sunset"
triggers:
- trigger: doorbell.rang
target:
entity_id: event.front_door_doorbell
conditions:
- condition: state
entity_id: sun.sun
state: "below_horizon"
actions:
- action: light.turn_on
target:
entity_id: light.porch
Still stuck?
The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the trigger you’re using and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain triggers or suggest the right one when you describe what you want in plain language.
Related triggers
Explore related triggers:
- Event received: Triggers when one or more event entities receive a matching event type.