       syslogPayload += lightoffmin;
       sendUdpSyslog(syslogPayload);
     }
-  }  
+  }
 }
 
 void setup() {

  }
}

boolean reconnect() {
  if (!client.connected()) {
    if (client.connect((char*) clientName.c_str(), willTopic, 0, true, willMessage)) {
      client.publish(willTopic, "1", true);
      if ( ResetInfo == LOW) {
        client.publish(hellotopic, (char*) getResetInfo.c_str());
        ResetInfo = HIGH;
      } else {
        client.publish(hellotopic, "hello again 1 from switch");
      }

      client.loop();
      for (int i = 0; i < 3; ++i) {
        client.subscribe(substopic[i]);
        client.loop();
      }

      if (DEBUG_PRINT) {
        sendUdpSyslog("---> mqttconnected");
      }
    } else {
      if (DEBUG_PRINT) {
        syslogPayload = "failed, rc=";
        syslogPayload += client.state();
        sendUdpSyslog(syslogPayload);
      }
    }
  }

bool bupdateLightStatus;

/////////////
WiFiClientSecure sslclient;
PubSubClient client(mqtt_server, 8883, callback, sslclient);
WiFiUDP udp;

long lastReconnectAttempt = 0;
