feat: Support HA event entities as triggers (#2506)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent f1fad59a89
commit 4b72fcd629
9 changed files with 371 additions and 19 deletions
+14 -7
View File
@@ -148,18 +148,25 @@ human interaction with the card; this behavior can be configured via the
> action is taken immediately. If multiple cameras are triggered at startup, they
> are all marked as triggered, but the action is only taken for the first one.
| Option | Default | Description |
| ------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `actions` | | The actions to take when a camera is triggered. See [Trigger action configuration](#trigger-action-configuration). |
| `filter_selected_camera` | `true` | If set to `true` will only trigger on the currently selected camera. |
| `show_trigger_status` | `false` | Whether or not the `live` view should show a visual indication that it is triggered (a pulsing border around the camera edge). |
| `untrigger_delay_seconds` | `0` | The number of seconds to continue to consider the camera triggered after the entity/event/state has reset, before considering the camera untriggered and taking the configured `untrigger` action. |
| `untrigger_force_seconds` | `0` | The number of seconds after a camera first triggers before force untriggering that camera. Set to `0` to disable. |
| Option | Default | Description |
| ------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `actions` | | The actions to take when a camera is triggered. See [Trigger action configuration](#trigger-action-configuration). |
| `filter_selected_camera` | `true` | If set to `true` will only trigger on the currently selected camera. |
| `show_trigger_status` | `false` | Whether or not the `live` view should show a visual indication that it is triggered (a pulsing border around the camera edge). |
| `untrigger_delay_seconds` | `0` | The number of seconds to continue to consider the camera triggered after the source ends, before taking the configured `untrigger` action. For instantaneous trigger sources (e.g. HA `event.*` entities, or a doorbell button that only briefly pulses on) this is effectively the entire visible "active" duration — the source itself provides no on-period of its own. |
| `untrigger_force_seconds` | `0` | The number of seconds after a camera first triggers before force untriggering that camera. Set to `0` to disable. |
> [!WARNING] If `untrigger_force_seconds` is used to untrigger a camera, the
> state will need to 'reset' (e.g. an entity would need to change state to
> `off`) before it will trigger again.
> [!TIP] When pairing `trigger: call` with `untrigger: call` (the
> "ring-then-end-if-unanswered" pattern), the ring lasts until the source ends
> plus `untrigger_delay_seconds`. With an instantaneous trigger source (event
> entity, brief switch pulse) and the default of `0`, the call would start and
> end in the same tick. In these cases, set a positive value (e.g. `30`) for a
> meaningful ring duration.
### Trigger action configuration
| Option | Default | Description |
+10 -9
View File
@@ -361,7 +361,9 @@ elements:
### Inbound call on doorbell press
This example uses [`view.triggers.actions.trigger: call`](configuration/view.md?id=triggers) to turn an dashboard into a phone-like ringer when somebody presses the doorbell. The intended deployment is a wall-mounted tablet sitting on the dashboard.
This example uses [`view.triggers.actions.trigger: call`](configuration/view.md?id=triggers) to turn a dashboard into a phone-like ringer when somebody presses the doorbell. The intended deployment is a wall-mounted tablet sitting on the dashboard.
The trigger entity is an [HA `event.*` entity](https://www.home-assistant.io/integrations/event/#device-class) with `device_class: doorbell` — the officially supported way modern integrations (ONVIF, UniFi Protect, Reolink, MQTT, etc.) expose a doorbell press. A press fires the entity instantaneously; the card treats it as a momentary signal and rings for `untrigger_delay_seconds`. A `switch.*` or `binary_sensor.*` entity that goes on/off with each press works will also work fine.
The Frigate camera's stock event triggers (`occupancy`, `motion`, `events`) are explicitly turned off so casual motion doesn't make the card ring — only an actual doorbell press does.
@@ -378,22 +380,21 @@ cameras:
motion: false
events: []
entities:
- switch.door_bell
- event.front_door_doorbell
view:
default: live
triggers:
show_trigger_status: true
# Keeps the trigger "active" this long after the switch goes off.
# A doorbell button typically gives a brief ON pulse, so the chime
# would stop almost immediately if this were small -- this value
# is effectively how long the chime keeps ringing after the press.
# How long the chime keeps ringing after a press before the call is
# auto-ended (if still unanswered). A doorbell press is instantaneous,
# so this value is effectively the ring duration.
untrigger_delay_seconds: 30
actions:
# Call when triggered.
trigger: call
# On release (after the untrigger_delay): end the call if it is
# still ringing. An answered call survives this and must be ended
# manually.
# When the trigger naturally ends (after untrigger_delay_seconds): end
# the call if it's still ringing. An answered call survives this and
# must be ended manually.
untrigger: call
# Ring even when somebody is actively using the card.
interaction_mode: all