Problema accensione luce da html

Il mio problema è questo: quando accendo il led dal sito, il led si accende. Quando però spengo il led dalla seriale, il led si spegne, ma al refresh automatico, dato che sull'url rimane la richiesta html "?L1=1", il led si riaccende. Come posso risolevere il problema

Questa è solo una parte di programma dato che quello totale è da più di 800

void controlloLuci() {                                                                //Controllo luci dal sito
  if (luce1)
  {
    digitalWrite(LSOGG, HIGH);
    statoLSOGG = true;
    accHtml=false;
    luce1 = NULL;
  }
  if (!luce1) {
    digitalWrite(LSOGG, LOW);
    statoLSOGG = false;
    speHtml=false;
    luce1 = NULL;
  }

 EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      boolean currentLineIsBlank = true;
      if (client.available()) {
        char c = client.read();
        //read char by char HTTP request
        if (readString.length() < 100) {
          //store characters to string
          readString += c;
          //Serial.print(c);
        }
        //if HTTP request has ended
        if (c == '\n'  && currentLineIsBlank) {
          //CREA LA PAGINA HTML (VERRA' AGGIORNATA AD OGNI ISTRUZIONE NUOVA)
          Serial.print("2");
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 10");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println(F("<html><head> <title> Casa Domotica </title> <meta charset=UTF-8/></head><body style=background-color:powderblue;>"));

          client.println(F("<h1 align=center style=color:red>Casa Domotica</h1> "));

          client.println(F("<div align=center valign=middle>"));

          client.println(F("<table>"));

          client.println(F("<tr>"));
          client.println(F("<td >Luce Soggiorno</td>"));
          client.println(F("<td><a href='?L1=1' name=L1 value=1><button> Accendi </button></a></td> "));
          if (statoLSOGG) {
            client.println(F("<td style=background-color:lime;> &#160 &#160 &#160 &#160 &#160 &#160</td>"));
          }
          else {
            client.println(F("<td style=background-color:red;>  &#160 &#160 &#160 &#160 &#160 &#160</td>"));
          }
          client.println(F("<td><a href='?L1=0' name=L1 value=0><button> Spegni </button></a></td>"));

        
          client.println(F("</tr>"));

          client.println(F("</table>"));

          client.println(F("</div>"));

          //CHIUDE I TAG HTML PER LA PAGINA
          client.println(F("</body></html>"));

          if (readString.indexOf("L1=1") > 0)
          {
            luce1 = true;
          }
          else if (readString.indexOf("L1=0") > 0)
          {
            luce1 = false;
          }
          controlloLuci();
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    //SI PREPARA PER UNA NUOVA ISTRUZIONE
    readString = "";
    delay(1);
    //TERMINA LE OPERAZIONI CLIENTE
    client.stop();
}

>lucagg: vedo che NON ti basta che te lo abbiano già detto nella sezione Inglese (QUI) te lo devo ripetere anche io nella sezione Italiana ...

... in conformità al REGOLAMENTO, punto 13, il cross-posting è proibito (anche tra lingue diverse) e tu hai già posto la stessa domanda QUI.

Non solo, in quel thread ti stanno già rispondendo ed è veramente poco cortese abbandonare una discussione e chi ti stava aiutando, per venire di qua a porre la stessa domanda ...

Infine, per rispetto verso chi ti stava già aiutando nell'altro thread, questo tuo thread viene chiuso e ti chiedo di continuare dove avevi cominciato.

Guglielmo

N.B.: Alla prossima violazione del regolamento sarò costretto a prendere provvedimenti!