Notification bug?

Not sure if this is only me or something else. A while ago I setup some notifications in the event someone left the garage door open for over 5 minutes. It used to work without any issues, and then I performed an upgrade about 6 months ago and ever since it repeats notifications as if the garage open and closes.

Now if I open the garage and say leave it open for 3 minutes and then close it, I get a few emails stating that the garage was open, close, open and close again, etc. It makes no sense really.

Here is the code I use:

  - name: notify_email
    platform: smtp
    port: 25
    timeout: 15
    sender: [email protected]
      - [email protected]
    sender_name: Home Assistant
    debug: true

    name: Garage Door-25 is open
    done_message: Garage Door-25 was closed
    entity_id: binary_sensor.garage_door_25
    state: 'on'
    repeat: 5
    can_acknowledge: False
    skip_first: False
      - notify_email

Attached is a picture showing the garage entity status and as you can see there is not flapping, it is either open or close.


Any ideas?

Any way to do this with an automation also instead of manual entries in configuration.yaml?