   return state;
 }
 
-
+void turnOnRelay() {
+ digitalWrite(relayPin, HIGH); // turn on relay with voltage HIGH 
+}
+
+void turnOffRelay() {
+  digitalWrite(relayPin, LOW);  // turn off relay with voltage LOW
+}


  HTTP.handleClient();
  delay(1);
  
  // if there's data available, read a packet
  // check if the WiFi and UDP connections were successful


String serial;
String persistent_uuid;
String device_name;

const int relayPin = D1;

boolean cannotConnectToWifi = false;

void setup() {
  Serial.begin(115200);

  // Setup Relay
  pinMode(relayPin, OUTPUT);
  
  prepareIds();
  
  // Initialise wifi connection
