user60103: I have a nextion display. I want to implement this issue of it. Start the program. If for example I don't touch the display for 15seconds, it should to turn off its brightness. If I touch the screen on any point, it should to increase its brightness.
For this I m build this code:
In PreinitializeEvent of page 0, I have insert this code:
tm0.tim=0
tm0.en=1
dim=30

In Touch Release Event of page 0, I have insert this code:
dims=100

But if I try to start the program, the brightness is always the same. Not increase.
/EDIT
I use Nextion Edito 0.58


user20245: The original question has been improved (which is appreciated) to include the IDE which the poster is using.  In this stackexchange.com space we primarily concern our selves with answering questions about developing using the Arduino IDE. While the Nextion Editor looks interesting, some may consider it off topic.
For those who come here interested in controlling the brightness of their Nextion Display and are using the Arduino IDE, there is this answer:
There appears to be several Nextion Arduino Library efforts to choose from.  If you are using this Nextion Display Library, here is the example code which set the screen brightness.  The part of the code which sets the screen brightness is rather simple and resides in the Arduino loop() function.  In the loop() function the brightness is set repeatedly as the program continues to run:
void loop() {
  int brightness = analogRead(A0);
  int bright = map(brightness, 0, 1024, 0, 100);
  String dim = "dim=" + String(bright);
  myNextion.sendCommand(dim.c_str());

}

For those of you using the Nextion editor and the Nextion Arduino Libraries, there is this github.com Issue which talks about adding multiple missing Nextion features including a screen brightness function. This issues appears to still be OPEN (Bad support? / Bad house-keeping?). But is over a year old so may have be incorporated.  If so, here is the example code from that link:
/**
* Set the brightness of the display.
*
* @param buffer - number (0 - 100).
*/
bool setBrightness(byte buffer);


60103: <p>I have a nextion display. I want to implement this issue of it. Start the program. If for example I don't touch the display for 15seconds, it should to turn off its brightness. If I touch the screen on any point, it should to increase its brightness.</p>

<p>For this I m build this code:</p>

<p>In PreinitializeEvent of page 0, I have insert this code:</p>

<pre><code>tm0.tim=0
tm0.en=1
dim=30
</code></pre>

<p>In Touch Release Event of page 0, I have insert this code:</p>

<pre><code>dims=100
</code></pre>

<p>But if I try to start the program, the brightness is always the same. Not increase.</p>

<p>/EDIT</p>

<p>I use Nextion Edito 0.58
<a href="https://i.stack.imgur.com/Pvgw9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pvgw9.jpg" alt="enter image description here"></a></p>
 20245: <p><em>The original question has been improved (which is appreciated) to include the IDE which the poster is using.  In this stackexchange.com space we primarily concern our selves with answering questions about developing using the Arduino IDE. While the Nextion Editor looks interesting, some may consider it off topic.</em></p>

<p><em>For those who come here interested in controlling the brightness of their Nextion Display and are using the Arduino IDE, there is this answer:</em></p>

<p>There appears to be several Nextion Arduino Library efforts to choose from.  If you are using <a href="https://github.com/bborncr/nextion" rel="nofollow noreferrer">this Nextion Display Library</a>, <a href="https://github.com/bborncr/nextion/blob/master/examples/DimScreen/DimScreen.ino" rel="nofollow noreferrer">here is the example code</a> which set the screen brightness.  The part of the code which sets the screen brightness is rather simple and resides in the Arduino loop() function.  In the loop() function the brightness is set repeatedly as the program continues to run:</p>

<pre><code>void loop() {
  int brightness = analogRead(A0);
  int bright = map(brightness, 0, 1024, 0, 100);
  String dim = "dim=" + String(bright);
  myNextion.sendCommand(dim.c_str());

}
</code></pre>

<p><em>For those of you using the <a href="https://nextion.tech/nextion-editor-ver-0-58/" rel="nofollow noreferrer">Nextion editor</a> and the <a href="https://github.com/itead/ITEADLIB_Arduino_Nextion" rel="nofollow noreferrer">Nextion Arduino Libraries</a>, there is <a href="https://github.com/itead/ITEADLIB_Arduino_Nextion/issues/43" rel="nofollow noreferrer">this github.com Issue</a> which talks about adding multiple missing Nextion features including a screen brightness function. This issues appears to still be OPEN (Bad support? / Bad house-keeping?). But is over a year old so may have be incorporated.  If so, here is the example code from that link:</em></p>

<pre><code>/**
* Set the brightness of the display.
*
* @param buffer - number (0 - 100).
*/
bool setBrightness(byte buffer);
</code></pre>
