Making notifications conditional

I’m a yaml noob so I need some hep. I have the following script to automate watering of my trees:

alias: Water Trees Every Other Day
triggers:
  - at:
      - "10:00:00"
      - "10:30:00"
    trigger: time
  - event: start
    trigger: homeassistant
conditions:
  - condition: template
    value_template: "{{ (now() - as_datetime('19700101T00Z')).days % 2 == 0 }}"
actions:
  - target:
      entity_id: switch.irrigation_relay_r3_trees
    action: >-
      switch.turn_{{ iif(now().hour == 10 and 0 <= now().minute < 30, 'on',
      'off') }}
  - action: notify.mobile_app_pixel_9_pro_xl
    metadata: {}
    data:
      message: Tree irrigation start
  - action: assist_satellite.announce
    metadata: {}
    data:
      message: Tree irrigation start
    target:
      device_id: 3a43b09894311b0cffdc40767015101f

I right now the notification says “tree irrigation start” even when it’s ending. How can I make it say “tree irrigation end” under the end condition?

alias: Water Trees Every Other Day
triggers:
  - at:
      - "10:00:00"
      - "10:30:00"
    trigger: time
  - event: start
    trigger: homeassistant
conditions:
  - condition: template
    value_template: "{{ (now() - as_datetime('19700101T00Z')).days % 2 == 0 }}"
actions:
 - variables:
     mode: "{{ iif(now().hour == 10 and 0 <= now().minute < 30, 'on', 'off') }}"
     msg: "{{ iif(mode== 'on', 'start', 'end') }}"
  - target:
      entity_id: switch.irrigation_relay_r3_trees
    action: switch.turn_{{ mode }}
  - action: notify.mobile_app_pixel_9_pro_xl
    metadata: {}
    data:
      message: Tree irrigation {{ msg }}
  - action: assist_satellite.announce
    metadata: {}
    data:
      message: Tree irrigation {{ msg }}
    target:
      device_id: 3a43b09894311b0cffdc40767015101f