Selective notifications

Hi All,

Some background, during lockdown we discovered we had a bunch of squirrels visiting the garden so we bought squirrel feeders and I put xiaomi door sensors on the lids so we can be notified when they are visiting.

The automation below works just fine, however I would like to improve it.

  1. I am wondering if there is a better way to do it.
  2. I would like to have a boolean switch for each google home which would control whether or not it made announcements for this automation. I have 5 google homes in the house.

Thanks for taking the time to read this

- id: 'Occupancy: Back Nut Hut Opened'
  alias: 'Occupancy: Back Nut Hut Opened'
  description: ''
  trigger:
  - type: opened
    platform: device
    device_id: e3d43cc43a7046d3959edd5e24bcf2ce
    entity_id: binary_sensor.back_nut_hut_lid_contact
    domain: binary_sensor
  condition:
  - condition: state
    entity_id: input_boolean.squirrel_notifications
    state: 'on'
  action:
  - service: notify.squiggley
    data:
      message: A Squirrel does be in da back nut hut!
  - service: tts.cloud_say
    data:
      message: Whoop Whoop! A Squirrely does be in the back nut hut!
      entity_id: media_player.office_display, media_player.kitchen_speaker, media_player.livingroom_speaker
      options:
        gender: male
  - wait_template: '{{ states.media_player.office_display.state == ''stop''  and  states.media_player.kitchen_speaker.state
      == ''stop'' and states.media_player.livingroom_speaker.state == ''stop'' }} '
    timeout: '10'
    continue_on_timeout: true
  - service: media_player.play_media
    data:
      media_content_id: ********
      media_content_type: image/jpg
    target:
      entity_id:
      - media_player.office_display
      - media_player.zaphod
      device_id:
      - 481789fc057211ebb57617da0dbf35c1
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - service: media_player.turn_off
    data: {}
    entity_id: media_player.office_display
  - service: media_player.media_stop
    target:
      device_id:
      - 481789fc057211ebb57617da0dbf35c1
      entity_id:
      - media_player.zaphod
  - delay: 00:05:00
  mode: single
  max: 10