 Bounce debouncerDeur = Bounce();
 Bounce debouncerWC = Bounce();
 
+AsyncDelay delay_8s;
+AsyncDelay delay_10s;
 
 // Update these with values suitable for your network.
 byte mac[]    = {  0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };

  wiegand.setPin1State(digitalRead(PIN_D1));
}

long count = 0;

// Notifies when a reader has been connected or disconnected.
// Instead of a message, the seconds parameter can be anything you want -- Whatever you specify on `wiegand.onStateChange()`


  if ( debouncerDeur.fell() ) {
    client.publish("domogik/deurdetect", "1");
  }
  if ( debouncerDeur.rose() ) {
    client.publish("domogik/deurdetect", "0");
  }
  debouncerWC.update();

  if ( debouncerWC.rose() ) {
    client.publish("domogik/wcdetect", "1");
  }
  if ( debouncerWC.fell() ) {
    client.publish("domogik/wcdetect", "0");
  }

  if (buttons.onPress(BUTTON_AN1))
