      
      char buffer[4];
      sprintf(buffer, "%s", ambilightValue);
-     publishRetained(DEVICE_1_OFF_RAMP_VALUE,  buffer);     
+     publishRetained(DEVICE_1_ON_RAMP_VALUE,  buffer);     
   }
 }
 

// Global status variabels
boolean fadeStepFlag = false;
boolean publishSensorsFlag = false;
boolean fadeStepToTargetColorFlag = false;

int fadecounter = 0;
int fadetToTargetCounter = 0;

void fadeLoop() {
  ambilightHue = ambilightHue < 360 ? ambilightHue+1 : 0;
   
//   Serial.println(ambilightHue);
  char buffer[6];
  sprintf(buffer, "%f", 1.0*ambilightHue*(255.0/360));
  //spublishRetained(DEVICE_1_ON_RAMP_HUE,  buffer);
}

void sensorLoop(){
