Simple leak automation with notification and tts

I had some issues due to my cohabitant washing her wholly clothes and clogging up my pipes in the bathroom due to a large amount of fluff, resulting in water running down on the tiles, and i tried find some automations that fit my need.
I didnt really, so i tried make one myself.
At least on my own network it works fine.
Ill just link it here in case someone gets any use out of it.

Sorry if its already been done.

blueprint:
  name: Leak Alert (Action Selector)
  description: >
    Triggered by a leak sensor.
    1. Runs your custom Notification Actions (add your phones here).
    2. Checks if Residents are home.
    3. If home, plays TTS on selected speakers.
  domain: automation
  input:
    leak_sensor:
      name: Water Leak Sensor
      selector:
        entity:
          domain: binary_sensor
          device_class: moisture
    
    # THE FIX: This lets you use the standard UI buttons to find your phone
    notification_actions:
      name: Notification Actions
      description: >
        Click 'Add Action' below. Search for "Notify" and pick your specific phone 
        (e.g., 'Notifications: Send to mobile_app_fold7').
        You can add multiple devices here.
      selector:
        action: {}

    people_to_check:
      name: Residents (Presence Check)
      description: TTS will only play if one or more of these people are home.
      default: []
      selector:
        entity:
          domain: person
          multiple: true
    
    speakers:
      name: TTS Speakers
      description: Select speakers for the audio warning.
      selector:
        target:
          entity:
            domain: media_player
            
    tts_message:
      name: TTS Audio Message
      default: "Warning. Water leak detected. Please check immediately."
      selector:
        text:

variables:
  people_var: !input people_to_check

trigger:
  - platform: state
    entity_id: !input leak_sensor
    to: "on"
    from: "off"
    for:
      seconds: 5

action:
  # 1. Run the custom actions you defined in the UI (Phones, SMS, etc.)
  - choose: []
    default: !input notification_actions

  # 2. Check Presence & Play TTS
  - if:
      - condition: template
        value_template: >
          {{ expand(people_var) | selectattr('state', 'eq', 'home') | list | count > 0 }}
    then:
      - service: tts.cloud_say
        target: !input speakers
        data:
          cache: false
          message: !input tts_message

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

|edit| i had some stuff hardcoded, and then suddenly i couldnt get it to work. Now i tested and works. Slightly modified the notification on phones. Doesnt look as nice but seems to work.