I have an automation which is triggered when someone presses my doorbell. It performs the following actions:
- Plays an mp3 chime on 3 Google Home speakers
- Plays an mp3 chime on a Logitech Squeezebox Boom media player
- Casts the doorbell video stream (from Blue Iris) to 2 Chromecast devices (this is done in the script referred to below)
- Changes the TV source to the Chromecast
- Changes the source on my Onkyo AV amplifier to the main Chromacast
- After a delay of a minute or so, stops casting the video streams to the Chromecasts.
My question is: will step 3 only be executed when the mp3 file has finished playing on the media players, or will it be executed as soon as the request has been sent to the media players? As the mp3 lasts for 5-10 seconds, I don’t want to delay execution of Step 3 for that long. But by the same token, Steps 1 & 2 are the highest priority as they are the primary alerting mechanism for my doorbell.
My automation is below:
alias: Doorbell Pressed
description: ''
trigger:
- platform: state
entity_id: binary_sensor.sage_doorbell_sensor
to: 'on'
condition: []
action:
- service: media_player.play_media
data:
media_content_id: http://www.mydomain.com/front-door.mp3
media_content_type: audio/mp3
target:
entity_id:
- media_player.lounge_speaker
- media_player.study_speaker_3
- media_player.kitchen_speaker
device_id:
- dcc47ea181329c3ae12855a8e26649b7
- 435c3bbba27f8992f5e79355837b22d6
- f6264fe7ca5404bf0767db98ddbde81a
- service: media_player.play_media
target:
entity_id: media_player.bedroom
data:
media_content_id: http://www.mydomain.com/front-door.mp3
media_content_type: music
- service: script.1642515823804
- service: switch.turn_on
target:
entity_id: switch.tv_hdmi2
- service: switch.turn_on
target:
entity_id: switch.onkyo_game
- delay:
hours: 0
minutes: 1
seconds: 30
milliseconds: 0
- service: media_player.turn_off
target:
entity_id:
- media_player.lounge_tv_2
mode: single