Sensor already High at boot not read 8266

My code work fine, but if my sensor is already close at boot, I got no message, I need to open the sensor circuit and close it to get the code to work again

binary_sensor:

  - platform: gpio
    pin: 
      number: 12
      mode:
        input: true
        pullup: true
    name: "Sump Pump Water Sensor"
    device_class: moisture
    filters:
      - invert:
      - delayed_on: 1s
    id: sump_pump_water_sensor
    on_press:
      then:
        - mqtt.publish:
            topic: "HassSumpump8266"
            payload: "Il y a de l'eau à la SumPump"
            retain: true
        - while:
            condition:
              binary_sensor.is_on: sump_pump_water_sensor
            then:
              - delay: 3s
              - mqtt.publish:
                  topic: "HassSumpump8266"
                  payload: "il y a toujours de l'eau à la SumPump"
                  retain: true