Change widget properties on nodemcu

Hello
I am doing a project on smart planting system and I have got some problem on the Blynk widget properties setting.

In case, I want to control the LED color due to the user selection. When Auto mode is chosen, the user cannot make any changes in the menu below and the LED will be in weight light. When personalize is chosen, the user can choose ornament foe weight light and Irrigation for red and blue light.

When I am trying to use I double switch , It will has an error "a function-definition is not allowed here before ‘{’ token "

    BLYNK_WRITE(V7) {
  int value = param.asInt();
  if (value == 1)
  {
    //Automatic
    {
      BLYNK_WRITE(V8);
      BlynkParamAllocated items(128); // list length, in bytes
      Blynk.setProperty(V8, "None", "None");
      BLYNK_WRITE(V8){
      switch (param.asInt())
      {
        case 1:
          {
        //WS2812B
        for (int i = 0; i <= 15; i++)
        {

          pixels.setPixelColor(i, pixels.Color(150, 150, 150));
          pixels.show();
        }
        break;
      }
   }

   }
   }
  }

  if (value == 2) // Personalize
  {
    BLYNK_WRITE(V8);
    BlynkParamAllocated items(128); // list length, in bytes
    Blynk.setProperty(V8, "Ornament", "Irrigation");
    BLYNK_WRITE(V8){
    switch (param.asInt())
    {
  case 1: // Ornament
    {
      //WS2812B
      for (int i = 0; i <= 15; i++)
      {

        pixels.setPixelColor(i, pixels.Color(150, 150, 150));
        pixels.show();

      }
      break;
    }


  case 2: // Irrigation
    {
      //WS2812B
      for (int i = 0; i <= 15; i++)
      {
        if (i % 2 == 1) //using modular operator for finding odd numbers
        {
          pixels.setPixelColor(i, pixels.Color(0, 0, 150));
          pixels.show();
        }
      }

      for (int i = 0; i <= 15; i++)
      {
        if (i % 2 == 0) //using modular operator for finding even numbers
        {
          pixels.setPixelColor(i, pixels.Color(150, 0, 0));
          pixels.show();

        }

      }
      break;


    }
}

}
}
}

Is there any method can solve it?

The BLYNK_WRITE(Vpin) function is in effect a callback that is triggered when the Blynk library detects a change in value of the Vpin data on the server.

You cant put one callback within another, so the compiler is complaining because you have BLYNK_WRITE(V8) within the BLYNK_WRITE(V7) callback. To make matters even worse, you then have another BLYNK_WRITE(V8) callback nested inside this BLYNK_WRITE(V8) callback.

I think you need to do more research about how and when to use the BLYNK_WRITE(Vpin) callbacks, as you are clearly using them in completely the wrong way at present.

Pete.