       delay(5000);
     }
   }
-}+}

    delay(500);
    ESP.restart();
  } else if (payloadStr.equals(F("custom_action1"))) {         
    client.publish(TOPIC_T, "Custom action 1 run");
  } else if (payloadStr.equals(F("custom_action2"))) {
    client.publish(TOPIC_T, "Custom action 2 run");
  } else if (payloadStr.equals(F("custom_action3"))) {
    client.publish(TOPIC_T, "Custom action 3 run");
  } else if (payloadStr.equals(F("custom_action4"))) {
    client.publish(TOPIC_T, "Custom action 4 run");
  } else if (payloadStr.equals(F("custom_action5"))) {
    client.publish(TOPIC_T, "Custom action 5 run");
  }
}



  // powerOff
  if (payloadStr.equals(F("powerOff"))) {
    motionControlStop();
  // powerOn
  } else if (payloadStr.equals(F("powerOn"))) {
    motionControlStart();
  // getStatus
  } else if (payloadStr.equals(F("getStatus"))) {
      // snprintf (msg, 20, "PowerState: %i", curState);
