Motion TTS announcer

This simple blueprint uses tts.google_say and an entity with device_class: motion (use the customization panel if your sensor doesn’t have it).

blueprint:
  name: Motion TTS announcer
  domain: automation
  input:
    motion_entity:
      name: Motion Sensor
      description: Entity that causes announcement
      selector:
        entity:
          domain: binary_sensor
          device_class: motion
    speaker_target:
      name: Speaker
      description: Entity to announce motion on
      selector:
        target:
          entity:
            domain: media_player
    announcement_message:
      name: Announcement message
      description: What to say when motion is detected
    cooldown:
      name: Announcement cooldown
      description: The minimum time needed in between announcements
      default: 30
      selector:
        number:
          min: 0
          max: 600
          unit_of_measurement: seconds

mode: single

trigger:
  platform: state
  entity_id: !input motion_entity
  from: "off"
  to: "on"

action:
  - service: tts.google_translate_say
    target: !input speaker_target
    data:
      message: !input announcement_message
  - wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - delay: !input cooldown

It would be cool if you could figure out a way to return to whatever was playing before the notification occurred. Essentially this TTS announcement could interrupt your music, then return to playing the music. Not sure if that’s possible.

1 Like

There’s lots of solutions on the forums if you do a search.