   
   if (beepEnabled)
   {
-    pinMode(4, OUTPUT);
-    beep(100);
-    beep(50);
-    beep(100);
-  }
-  
-  
-  
+    beepPin = 4;
+    pinMode(beepPin, OUTPUT);
+  }
   pinMode(nextionResetPin, OUTPUT);
   digitalWrite(nextionResetPin, HIGH);
   Serial.begin(115200);  // Serial - LCD RX (after swap), debug TX

const unsigned long telnetInputMax = 128;           // Size of user input buffer for user telnet session
bool motionEnabled = false;                         // Motion sensor is enabled
bool mdnsEnabled = true;                            // mDNS enabled
bool beepEnabled = true;
uint8_t motionPin = 0;                              // GPIO input pin for motion sensor if connected and enabled
bool motionActive = false;                          // Motion is being detected
const unsigned long motionLatchTimeout = 30000;     // Latch time for motion sensor

      mqttClient.publish(mqttStateJSONTopic, mqttButtonJSONEvent);
      if (beepEnabled)
      {
      OnTime = 500;                                
      OffTime = 100;
      beepCounter = 1;
      }
      
    }
