              "Content-Type": "application/json"
          },
          "json": {
-             "socketNum": "{{socketNum}}",
-             "apiKey": "{{apiKey}}"
+            "apiKey": "{{apiKey}}",
+            "socketNum": "{{socketNum}}"
          },
          "mydevices": true
      }



/* TOGGLE RELAY FUNCTIONS - START */
void toggle_relay1()
{
    /* Function to toggle_relay1 when the interruption from the falling edge signal from pushbutton1 happens */
    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);
    }
}


void toggle_relay2()
{
    /* Function to toggle_relay2 when the interruption from the falling edge signal from pushbutton2 happens */
    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);
    }
}

double get_Irms0_current(){


    Serial.print("Corrente1 (A): ");
    Serial.print(Irms0);                    // Irms0
    Serial.print("      ");
    Serial.print("Corrente2 (A): ");
    Serial.print(Irms1);                    // Irms1
    Serial.print("      ");
    Serial.print("Potencia1 (W): ");
