Garage door reverts back to "closing" after closed. Whats wrong with my code?

Everything works as I’d like it to until the end. When I close the door, it goes from “open” to “closing” and then to “closed.” but after a moment or two, it reverts back to “closing” and stays there…

  - platform: gpio
    pin:
      number: 19
      inverted: true
      mode:
        input: true
        pullup: true
    name: "Garage Door No.1 Open Sensor"
    id: open_endstop_binary_sensor_1
    internal: true
    on_press:
       - cover.template.publish:
           id: garage_door_1
           state: OPEN
           current_operation: IDLE
       - binary_sensor.template.publish:
          id: is_jammed_1
          state: OFF
    on_release: 
       - cover.template.publish:
           id: garage_door_1
           current_operation: CLOSING  
       - delay: 12s
       - if:
           condition:
             binary_sensor.is_off: close_endstop_binary_sensor_1
           then: 
              - binary_sensor.template.publish:
                  id: is_jammed_1
                  state: ON

[12:15:59][D][cover:170]: ‘No.1’ - Publishing:
[12:15:59][D][cover:176]: State: OPEN
[12:15:59][D][cover:186]: Current Operation: IDLE
[12:15:59][D][binary_sensor:036]: ‘Garage Door No.1 Open Sensor’: Sending state OFF
[12:15:59][D][cover:170]: ‘No.1’ - Publishing:
[12:15:59][D][cover:176]: State: OPEN
[12:15:59][D][cover:186]: Current Operation: CLOSING
[12:16:10][D][sensor:094]: ‘WiFi Signal’: Sending state -43.00000 dBm with 0 decimals of accuracy
[12:16:11][D][cover:170]: ‘No.1’ - Publishing:
[12:16:11][D][cover:178]: State: CLOSED
[12:16:11][D][cover:186]: Current Operation: CLOSING
[12:16:48][D][esp32.preferences:114]: Saving 1 preferences to flash…
[12:16:48][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed

Post your whole config… I dont understand why people do this. You obviously dont know why its not working correctly and you only post the part of the config that is all jacked up. Are people just supposed to guess what you’ve done with the rest? We need to see the whole cover and the logic, not just 2 sensors that you think is the problem.

Idk even understand why you are trying to work out the state logic from 2 gpio binary sensors, it doesnt make any sense and it makes even less sense why you tgought this is all the config people needed to see. You’ve got a mess there, post it all and quit playing games.

If you’re just going to be a right prick, don’t bother commenting. It’s people like you who make a whole community look toxic.

Yes, its my fault! How dare I be outraged that you basically post half a story and then have the audacity to ask whats wrong with your story, knowing full well that you left the majority of it out so no one can make heads or tails of it.

I did basically the same thing last week! I went to the pet groomer to get my dog a haircut. When it was my turn, they called my name and i walked up there and handed them a dog leash and said, “figure it out, thats all you get!”

Welcome to Home Assistant Community — thanks for contributing!

Be kind to your fellow community members.

Does your reply improve the conversation?

Constructive criticism is welcome, but criticize ideas, not people.

For more, see our community guidelines.