 
   The current state is stored in EEPROM and restored on bootup
 
+  Pins 2->7 are used as input (switch) detection. Their state are published on domogik/relayArduinoPin1
+
 */
 #include <Ethernet.h>
 #include <PubSubClient.h>
 #include <EEPROM.h>
+#include <Bounce2.h>
 
 // Update these with values suitable for your network.
 byte mac[]    = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE };

  if (!client.connected()) {
    reconnect();
  }
  client.loop();
}


  22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
};       // an array of pin numbers to which LEDs are attached
int pinCount = 32;

#define PIN_DETECT_1 2
#define PIN_DETECT_2 3
#define PIN_DETECT_3 4
#define PIN_DETECT_4 5
#define PIN_DETECT_5 6
#define PIN_DETECT_6 7
Bounce debounce1 = Bounce();
Bounce debounce2 = Bounce();
Bounce debounce3 = Bounce();
Bounce debounce4 = Bounce();
Bounce debounce5 = Bounce();
Bounce debounce6 = Bounce();


void setup_ethernet() {

