Alert is a nice feature to repeating action but is limited to notifiers only.
I suggest alert allow take more action than notifiers only.
I have a buzzer that is triggered by mqtt and I can’t use with alerts because is not a “notifier”.
I create my own solution with automation because I can’t use with alerts.
- id: 'notify_door_open'
action:
- service: script.turn_on
entity_id: script.alarm_buzzer_gate_open # this script publish a mqtt msg
- delay: '00:02:00' ## Wait 2 minute
- event: event_call_buzzer # Start the event (loop)
alias: 'Notify Buzzer: Door Opened'
hide_entity: True
trigger:
- platform: event
event_type: event_call_buzzer # Execute automation when Event was Started
- platform: state
entity_id: sensor.front_door
to: 'Open'
condition: # This is necessary to prevent buzzer be called with door closed
- condition: or
conditions:
- condition: state
entity_id: sensor.front_door
state: 'Open'