NodeMCU <-> sound sensor, delay between readings

Hi.

I've interfaced a LM393 Sound Detection Sensor with my NodeMCU, for push notifications through Blynk.
I have it placed in my garage. While I could use a PIR sensor, the sound sensor would send a notification even if someone unsuccessfully tried to enter the garage.

I have attached the code I originally ran, but it pushes notifications several times per seconds. Is there some way to stop after first interrupt, delay for X seconds, then check for interrupt again?

I've tried with "delay(15000L)" and SimpleTimer, but it still gets multiple inputs for the period of time it is active.

#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;

char auth[] = "d6bf4xxxxx4";
char ssid[] = “XXXXXX";
char pass[] = “xxxxxxtx";

void notifyOnButtonPress()
{
  // Invert state, since button is "Active LOW"
  int isButtonPressed = !digitalRead(5);
  if (isButtonPressed==1) {
    Serial.println("Lyd oppdaget i garasje!");
    Blynk.notify("Lyd oppdaget i garasje!");
  }
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);

  pinMode(5, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(5), notifyOnButtonPress, CHANGE);
   
}

void loop()
{
  Blynk.run();
}

Easy. Just use millis(). Declare an unsigned long variable to hold the time at which the last push notification was sent. When notification is sent, update the variable to the current value of millis(). When checking for a sensor detection, also check the time difference between the variable and the current value of millis(). If this is less than 15s, don't send the push notification.

I would also say that using interrupts for this purpose is completely uneccessary and using long-executing code like Serial.println() and Blynk.notify() inside an interrupt is a bad idea. So delete the attachInterrupt() and call notifyOnButtonPress() in loop().

Also well done for using code tags and remembering to XXX out your passwords in the code.

I did as you suggested and it works better now, thanks!
I have no previous experience with programming so it's pretty hit and miss at this point, but at least it's not total greek anymore.