   Serial.println("sensor is starting..");
   Serial.print("Reading Analog...");
   Serial.println(analogRead(0));
-  //publishDebug("Initialising Motor");
   initMotor();
   initSwitches();
-  //publishDebug("Initialising Timers");
-  //initTimers();
   initTimers();
 //----------------- wifi_set_sleep_type(LIGHT_SLEEP_T);
 //----------------- gpio_pin_wakeup_enable(GPIO_ID_PIN(2),GPIO_PIN_INTR_HILEVEL);

// *************************************************************

void loop() {

  switch (state) {
    case MOTOR_SWITCH_DETECTED:

// Initialise motor

void initMotor() {
  publishDebug("Testing Motor");
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Setting Motor L");
