Well you wrote some additional information. Still hard to analyse what is ging on on this small base of information.
To say it very clear and very explicit:
printing the values of
String command1 = "t10.txt=\""+String(tempCelsius1,1)+"\"";
Serial.print(command1);
to serial the monitor shows a changing value?
Your lines of code
look identic except for the variable-names and the nextion textfield-names
As you did not provide your nextion-project-file you will have to check if the textfield-name
is correct.
Another thing is to change the order of the printing and observe if always the textfield that comes first does not change
And at least posting what you really get in the serial monitor would be very helpful too
and posting pictures of what can be really seen on your nextion display will help.
For analysing your problem serial printing will be very useful.
But only under the pre-condition that you use Arduino IDE Version 1.8.19.
The new IDE Version 2.X.Y has a fundamental problem with the serial monitor
In Arduino-IDE-Version 2.X.Y the serial monitor is crippled .
You can't make effective use of it.
This is a problem that has been discussed for more than a half year now, but the Arduino-IDE-development-team refuses to work on a solution.
This means your solution is to work with Arduino-IDE 1.8.19. There is a possability to have Arduino-IDE 1.8.19 on the same computer without interfering with IDE 2.X.Y.
This is done through making the Arduino-IDE Version 1.8.19 as a portable version. The portable version 1.8.19 does not interfere with a Arduino-IDE 2.X.Y-Installation.
Arduino-IDE Version 1.8.19 does have less bells and whistles than IDE 2.X.Y but compiles and uploads just the same. And serial printing works like a charm.
You can read in this tutorial how to install Arduino-IDE 1.8.19 as portable version
tutorial how to install Arduino-IDE Version 1.8.19 as portable