I am trying to modify my current automation for notification of messages at the end of a condition, but although I have added the lines you described with the appropriate changes to my addresses, the result remains unchanged.
The notification arrives but the jingle does not play, I do not understand where I am wrong.
Below the lines used:
action:
- data_template:
message: Il microonde primo piano ha terminato!
title: Casa
service: notify.notify
- service: media_player.play_media
data:
entity_id: media_player.mini_tutti
media_content_id: https://myduckdnsaddress:myport/local/airplane-ding-dong.mp3
media_content_type: music
- service: tts.google_translate_say
entity_id: media_player.mini_tutti
data:
message: "Il microonde al primo piano ha terminato!"
Thank you for for the replies.
Later on returning home I will try.
To understand, should I put a generic pause of even 0.5 seconds or should I put a pause identical to the duration of the running mp3?
yes it worked.
first i tried it with 10 seconds and it made the sound.
so I went down to 5 seconds, up to 2 seconds which seems to be the minimum time to hear the sound.
I wanted to try 1.5 seconds but I don’t know how to set it with delay.
However, I do not know if it is a coincidence that it has to wait a little more than the duration of the mp3 to run.
Now that everything seems to work as I wanted, I realized that this function makes me comfortable on all the automations and packages that I have active.
How can I do to recall these lines with a simple command within the active automation?
should i create a script or a separate automation?
I would put it in a script then call the script using
service: script.ding_dong
Calling it this way rather than `script.turn_on’ will cause your automation to stop processing until the script has ended.
This may however slightly affect the timing and cause a longer pause between the ding dong and the TTS (it my not be noticeable though) while the system waits for various states to catch up, you will have to experiment!