cancel
Showing results for 
Search instead for 
Did you mean: 

action after delay doesn't start

namelessthing
Community Member

Hi, I've started experimenting with scripts and tried to insert a pause between two actions. However, if I set a 5 min delay, the first action is interrupted and the next one (spotify) starts. But if I set a longer delay (e.g. 15 min) the action before the delay is executed completely, but spotify simply doesn't run! Any ideas? I launch the routine on my google mini (v2) speaker.

 

metadata:
  name: Début de journée au travail # Choose a short name that summarizes important starters and actions, like “Sunset lights”.
  description: routine du matin lorsque je travail # Write a detailed description that includes everything the automation does, like “At sunset, on weekdays, close blinds, turn on lights to 50%, and play the sunset playlist on certain speakers.”

automations:
  # “starters” and “actions” are required; “conditions” are optional.
  # Use Ctrl + Space to see autocomplete suggestions.

  # ---- STARTERS ---- #
  # Starters describe events that will start the automation.
  # To add more than one starter, duplicate the "- type" section under "starters".
  # If you add multiple starter events, any one of them happening will start the automation.
  starters:
    - type: assistant.event.OkGoogle
      eventData: query
      is: "Hi"

  # ---- CONDITIONS ---- #
  # Conditions are optional. Delete this section if it’s empty.
  # Conditions will prevent an automation from starting if the conditions aren’t met.
  # See g.co/home/script-editor-docs for documentation about how to use logical operators like “and”, “or”, and “not”.
  # condition:
  #  type:

  # ---- ACTIONS ---- #
  # Actions will start when a starter event takes place and all conditions are met.
  # Actions will start in the order they appear in the script and with any delay specified.
  # To add more than one action, duplicate the "- type" section under "actions".
  actions:
    - type: assistant.command.OkGoogle
      okGoogle: "avoir le programme de la journée"
      devices: Bureau - Bureau
    - type: assistant.command.OkGoogle
      okGoogle: "Météo pour aujourd'hui?"
      devices: Bureau - Bureau
    - type: assistant.command.OkGoogle
      okGoogle: "Me dire les tâches d'aujourd'hui?"
      devices: Bureau - Bureau
    - type: assistant.command.OkGoogle
      devices:
        - Bureau - Bureau
      okGoogle: "joue l'actualité"
    - type: time.delay
      # Adjust duration as needed. Supported units: sec, min, hour
      for: 15min
    - type: assistant.command.OkGoogle
      devices:
        - Bureau - Bureau
      okGoogle: "Play music I like on spotify"

 

5 REPLIES 5

arm_dpe
Solutions Expert
Solutions Expert

Google Assistant might interrupt the action ("playing news") if the delay is short (e.g., 5 minutes) because it's busy processing the entire automation sequence and may not get the correct data like how long is the news section?

Can you replace news with other command like weather and see if issue still remain with playing Spotify command?

 

namelessthing
Community Member

Indeed, if I switch news with weather it work!  Thank you.

namelessthing
Community Member

Finally, I tested a little more, so it seems that the problem is playing the news. No matter in which order I place this action, it becomes problematic.

For example, if I place it in the middle of different actions. Then it starts playing and is immediately interrupted by the next action. I can't wait for Google to improve this behavior...

BillieJaskolsk
Community Member

It sounds like the behavior you’re seeing is less about the script itself and more about how Google Assistant routines are handled in the background, especially when they’re triggered from a Google Mini. From an NBI perspective (non-blocking vs. blocking execution), delays in Assistant routines don’t behave like true blocking waits.

yeah bro i think this is not script issue, more like google routine system problem. long delay break the flow so last action not run. better you split into 2 routine instead of 15min delay. same like process in NBI Clearance Centers, they also not depend on long waiting step, everything go step by step.