Quick question. I have the following automation which gets triggered separately in homekit. The problem is that music doesn’t always start once the automation is triggered on the first try. I have to sometimes turn off the associated switch trigger and turn it back on several times. Is there a way for this automation to check whether music is playing after about 4-5 seconds, and if it’s not, run itself again?
- alias: Boys Bedtime Music On
trigger:
- platform: state
entity_id: input_boolean.boys_bedtime
from: 'off'
to: 'on'
action:
- service: media_player.volume_set
data_template:
entity_id: media_player.boys_echo
volume_level: 0.5
- service: media_player.play_media
data_template:
entity_id: media_player.boys_echo
media_content_id: "Boys Bedtime playlist"
media_content_type: AMAZON_MUSIC