     /* SET RELAY PINS AND INTERRUPTIONS - START */
     pinMode(relay1, OUTPUT);                                  //setup of relay1 as output on Photon
     pinMode(pushbutton1, INPUT_PULLUP);                      //setup pushbutton1 as an input with the Pullup resistor enabled (nomally high or 3V3)
-    
-    // attachInterrupt(pushbutton1, toggle_relay1, FALLING);   //attach the interruption to toggle the state_relay1 and happen when the negative edge of the signal from pushbutton1
+    attachInterrupt(pushbutton1, toggle_relay1, FALLING);   //attach the interruption to toggle the state_relay1 and happen when the negative edge of the signal from pushbutton1
 
     pinMode(relay2, OUTPUT);                                 //setup of relay2 as output on Photon
     pinMode(pushbutton2, INPUT_PULLUP);                     //setup pushbutton2 as an input with the Pullup resistor enabled (nomally high or 3V3)
-    
-    // attachInterrupt(pushbutton2, toggle_relay2, FALLING);  //attach the interruption to toggle the state_relay2 and happen when the negative edge of the signal from pushbutton2
-
+    attachInterrupt(pushbutton2, toggle_relay2, FALLING);  //attach the interruption to toggle the state_relay2 and happen when the negative edge of the signal from pushbutton2
     /* SET RELAY PINS AND INTERRUPTIONS - END */
 
     /* TURN OFF WiFi IF NO LUCK CONNECTING - START */



/* SEND AND GET INFORMATION FROM SERVER - START */
    
    if(digitalRead(pushbutton1) == LOW && digitalRead(pushbutton2) == HIGH){

        state_relay1 = !state_relay1;
        digitalWrite(relay1, state_relay1);  //Writes the state_relay1 to relay 1

        // Send auth data
        String jsonChangeSocketStatus = String(
          "{ \"apiKey\": \"" + String("{{{apiKey}}}") + "\"" +
           ",\"socketNum\": \"" + String(1) +  "\"}" );

        Particle.publish("changeSocketStatus", jsonChangeSocketStatus, PRIVATE);

        // Wait 4 seconds
        delay(4000);
    }

    if(digitalRead(pushbutton2) == LOW && digitalRead(pushbutton1) == HIGH){

        state_relay2 = !state_relay2;
        digitalWrite(relay2, state_relay2); //Writes the state_relay2 to relay 2

        // Send auth data
        String jsonChangeSocketStatus = String(
          "{ \"apiKey\": \"" + String("{{{apiKey}}}") + "\"" +
           ",\"socketNum\": \"" + String(2) +  "\"}" );

        Particle.publish("changeSocketStatus", jsonChangeSocketStatus, PRIVATE);

        // Wait 4 seconds
        delay(4000);
    }

    if (statuses[0] == String("Active") && Irms0 > 0) {
        // Send reading data
        String jsonSendSocketInformation = String(

int socket1Counter = 0;
int socket2Counter = 0;

/* VARIBLES TO CONTROL RELAY */
Timer changeSocketStatusSocket1Timer(1000, changeSocketStatusSocket1);
Timer changeSocketStatusSocket2Timer(1000, changeSocketStatusSocket2);

/* SEMI_AUTOMATIC SYSTEM MODE FOR WORKING OFFLINE - END */

/* CREATE INSTANCES OF THE EMONLIB LIBRARY */
