Kitchen Timer Announcement

Home Assistant Automation

One annoying thing with the Timers on Echo’s is that they only go off in the room they were set in.

This is a problem when you have a cake in the oven for 2 hours and are not in the kitchen when the timer goes off. The following script and automation will trigger other Echos to Announce the Kitchen timer is sounding.

Based on https://community.home-assistant.io/t/alexa-media-player-timers-as-a-trigger/140982

Script
alexa_timer_announce:
  alias: Kitchen Timer Announcement Loop
  mode: restart
  sequence:
  - delay: '{{ duration }}'
  - repeat:
      while:
      - condition: template
        value_template: '{{ states(''sensor.flex_kitchen_next_timer'') not in [''None'',
          ''unknown'', ''unavailable''] and as_timestamp(states(''sensor.flex_kitchen_next_timer''))
          < as_timestamp(now()) }}'
      sequence:
      - service: notify.alexa_media
        data_template:
          target:
          - media_player.dot_living_room
          - media_player.jane_s_sonos_beam          
          data:
            type: announce
          message: The kitchen timer is going off
      - delay:
          seconds: 10
Automation
- alias: Kitchen Timer Announcement
  mode: parallel
  trigger:
    platform: state
    entity_id: sensor.flex_kitchen_next_timer
  condition:
    condition: template
    value_template: '{{ trigger.to_state.state not in [''None'', ''unknown'', ''unavailable'']
      and trigger.from_state.state != trigger.to_state.state }}'
  action:
  - service: script.alexa_timer_announce
    data_template:
      duration: '{{ (as_timestamp(trigger.to_state.state) - now().timestamp() + 5)
        | timestamp_custom(''%H:%M:%S'', false) }}'