Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Delay between services in action - TTS and Play media

$
0
0

@Serg wrote:

Hi guys,

I have the following action in my “Good morning automation” - once motion is detected it sends TTS message to my google home and then says the weather - this worked fine for a long time. Now I want to play a random MP3 in the end. The problem is that it starts playing an MP3 file immediately without finishing TTS.

  action:
  - service: tts.google_say
    entity_id: media_player.living_room_speaker
    data_template:
      message:  "HERE COMES MY WEATHER FORECAST"
  - service: media_player.play_media 
    data_template:                 
      entity_id: media_player.living_room_speaker            
      media_content_id: "https://MYDOMAIN.duckdns.org/local/mp3/intros/{{range(1, 20)|random}}.mp3"
      media_content_type: 'audio/mp3'

I undertand why it is doing that but is there a solution for this?
I know that I can add a delay between services (delay: 00:00:20), but my weather text could be just 15 seconds or could be 30 seconds, the same delay interval is not a nice solution.

Is there a way to call the second service after google home stopped saying the text?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>