Help with Basic Timer Script

I know i am missing a step for the event when the timer set goes off. I start the 10 min timer as the first action but for the 3rd action i’d like it to wait until the 10 minute timer goes off I just can’t figure out how.

I was jus using a delay for 00:10:00 but that has not been very reliable.

10 Min Timer
sequence:
  - action: timer.start
    metadata: {}
    data: {}
    target:
      entity_id: timer.10_min_timer
    enabled: true
  - data:
      target:
        - media_player.theater_echo
        - media_player.lr_echo
        - media_player.kitchen_echo
        - media_player.bed_echo
        - media_player.office_echo
      data:
        type: tts
      message: 10 Min Timer Started!
    action: notify.alexa_media
  - device_id: 6c788c907b60b0d59d547740f514e371
    domain: mobile_app
    type: notify
    title: 10 Min Timer Started
    message: Started @ {{ now().strftime("%I:%M %p") }}
  - data:
      target:
        - media_player.theater_echo
        - media_player.lr_echo
        - media_player.kitchen_echo
        - media_player.bed_echo
        - media_player.office_echo
      data:
        type: tts
      message: 10 Min Timer is up!
    action: notify.alexa_media
  - device_id: 6c788c907b60b0d59d547740f514e371
    domain: mobile_app
    type: notify
    message: Timer is up
    title: 10 MINS!

Hi,
The script reads like this…

  • start the timer
  • send a message to some speakers
  • send a message to an app
  • send a message to some speakers
  • send a message to an app

Can you talk a little more about what you are trying to achieve?

Nick

So the entire script runs, I would like a 10 min delay between the first sets of speakers and notification and the 2nd.

start the timer
send a message to some speakers
send a message to an app
---- Wait for 10 min timer to end-----
send a message to some speakers
send a message to an app

In more simple terms when I press a button I want it to set a 10 min timer.

I may be misinterpreting your situation, but wouldn’t this be simpler

sequence:
  - action: notify.alexa_media
    data:
      target:
        - media_player.xxxx_echo_show
      data:
        type: tts
      message: 10 Min Timer Started!
  - delay:
      hours: 0
      minutes: 10
      seconds: 0
  - action: notify.alexa_media
    data:
      target:
        - media_player.xxxx_echo_show
      data:
        type: tts
      message: 10 Min Timer ended!
  - action: notify.mobile_app_xxxx
    metadata: {}
    data:
      message: Timer is up
      title: 10 MINS!
alias: Alexa Timer
description: ""

Why is a delay not reliable? Unless you’re actively reloading scripts (by for example restarting HASS), a delay should work just fine.

A timer would make absolutely zero difference to a script. For it to make any difference, you would need to make it an automation instead.

The delay always seems to work with the 10-minute timer, maybe 50% of the time with a 20 or 30 min timer but yes perhaps its a re-load or reset. I’ll be sure to watch closer now.

That’s what i had been doing but the longer timer (I have a 20 min one) doesn’t always seem to go off perhaps its related to resetting the HA server as someone else mentioned, I am going to keep an eye on it now.