[SOLVED}Automation fails to wait for mqtt message to be received if any payload already present

This is part of my automation to keep an ESP device from going back to sleep when it wakes and instead turn on a pump. It should wait at the wait for trigger which is mqtt message with payload “ON” but it continues if there is any message in the solarplantwatering/birth field either ON/OFF/offline. The device is still asleep so automation finishes without pump ever switching on.The only thing to prevent it continuing on early is if I delete solarplantwatering/birth topic by mqttexplorer. Anybody got a clue?

alias: Water Plant Pump 2
sequence:
  - service: mqtt.publish
    data:
      topic: solarplantwatering/ota_mode
      payload: "ON"
      qos: "1"
      retain: true
  - service: mqtt.publish
    data:
      topic: solarplantwatering/sleepearly
      payload: "OFF"
      qos: "1"
      retain: true
  - wait_for_trigger:
      - platform: mqtt
        topic: solarplantwatering/birth
        payload: "ON"
    continue_on_timeout: false
    timeout:
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.plant_watering2

I seemed to have solved the problem by changing the wait_for_trigger to a different mqtt topic. There may have be something special about the birth_message that prevents me doing what I was trying to or more likely I just made a mistake somewhere. Had to create a new topic sent from ESP device when it woke and deep sleep was disabled to allow the pumps to start. I tried to create a on_connect: (to mqtt broker) message but couldn’t get that to send anything. Lastly I had to add a publish mqtt to show the ESP device was offline when I sent it back to deep sleep.

mqtt:
  broker: 
  username: 
  password: 
  birth_message:
    topic: solarplantwatering/birth
    payload: 'ON'
  will_message:
    topic: solarplantwatering/willdisable
    payload: disable
  discovery: true
  discovery_retain: false   
  on_message:
    - topic: solarplantwatering/ota_mode
      payload: 'ON'
      then:
        - logger.log: 'OTA Mode ON - Deep sleep DISABLED'
        - deep_sleep.prevent: deep_sleep_1
        - mqtt.publish:
            topic: solarplantwatering/available_mode
            payload: online 
    - topic: solarplantwatering/sleepearly
      payload: 'ON'
      then:
        - deep_sleep.enter: deep_sleep_1