 #define DEBUG_PRINT 0
 
 // ****************
+time_t getNtpTime();
 void callback(char* intopic, byte* inpayload, unsigned int length);
 String macToStr(const uint8_t* mac);
-time_t getNtpTime();
 void run_lightcmd();
 void changelight();
 void sendmqttMsg(char* topictosend, String payload);

int oldpirValue ;

/*
volatile int relaystatus    = LOW;
volatile int oldrelaystatus = LOW;
*/
volatile int relaystatus    = LOW;
int oldrelaystatus = LOW;



void run_lightcmd()
{
  //int topbuttonstatus =  ! digitalRead(TOPBUTTONPIN);
  if ( relayIsReady == HIGH  ) {
    //relaystatus = topbuttonstatus ;
    relaystatus = !relaystatus;
  }
  if (DEBUG_PRINT && ( relayIsReady == HIGH  )) {
    //Serial.print("run_lightcmd  => topbuttonstatus => ");
    //Serial.print(topbuttonstatus);
    Serial.print(" => relaystatus => ");
    Serial.println(relaystatus);
  }
