           if (strcmp(root["state"], "ON") == 0) {
             arilux.turnOn();
           } else if (strcmp(root["state"], "OFF") == 0) {
+            startFade = false;
+            startFlash = false;
+            inFade = false; // Kill the current fade
             arilux.turnOff();
           }
         }

      }

      if (root.containsKey("color")) {
        int red_color = root["color"]["r"];
        int green_color = root["color"]["g"];
        int blue_color = root["color"]["b"];

        realBlue = arilux.getBlueValue();
      }


      if (root.containsKey("flash")) {
        startFade = true;
        inFade = false; // Kill the current fade
        flashLength = (int)root["flash"] * 1000;

        if (root.containsKey("brightness")) {
