   //set time (unix timestamp)
   pos = req.indexOf("ST=");
   if (pos > 0) {
-    setTime(req.substring(pos+3).toInt());
+    setTime(getNumVal(&req, pos));
   }
    
   //set countdown goal (unix timestamp)
   pos = req.indexOf("CT=");
   if (pos > 0) {
-    countdownTime = req.substring(pos+3).toInt();
+    countdownTime = getNumVal(&req, pos);
     if (countdownTime - now() > 0) countdownOverTriggered = false;
   }
    
   //set presets
   pos = req.indexOf("P1="); //sets first preset for cycle
-  if (pos > 0) presetCycleMin = req.substring(pos + 3).toInt();
+  if (pos > 0) presetCycleMin = getNumVal(&req, pos);
   
   pos = req.indexOf("P2="); //sets last preset for cycle
-  if (pos > 0) presetCycleMax = req.substring(pos + 3).toInt();
+  if (pos > 0) presetCycleMax = getNumVal(&req, pos);
    
   if (req.indexOf("CY=") > 0) //preset cycle
   {

  
  pos = req.indexOf("U0="); //user var 0
  if (pos > 0) {
    userVar0 = req.substring(pos + 3).toInt();
  }
  pos = req.indexOf("U1="); //user var 1
  if (pos > 0) {
    userVar1 = req.substring(pos + 3).toInt();
  }
  //you can add more if you need
   

      bri = briT;
    } else {
      nightlightActive = true;
      if (!aNlDef) nightlightDelayMins = getNumVal(&req, pos);
      nightlightStartTime = millis();
    }
  } else if (aNlDef)
