[SOLVED] Unable to access value of progress bar

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
MadeInFck
New user
Posts: 9
Joined: 05 Apr 2020, 20:53
Location: France
Contact:

[SOLVED] Unable to access value of progress bar

#1 Post by MadeInFck » 05 Apr 2020, 21:18

Hello,
I'm a new comer here.
Started 2 weeks ago to use EspEasy to grow a domotic setup for my home.
Many ideas and sensors are on their way.
But of course to control it overally, I need a display which led me to Nextion screen.
So I finally managed to change the content of my textfields using parameters sent via UDP between all my units.
One last thing still bothering me, updating a progress bar with the Nextion Command Statements section of the device:

Line 1: meteo.t4.txt="[DHT11#Tint]°C" // works fine
Line 2: meteo.j0.val=[DHT11#Hext] // can't work that out

Any help would be appreciated.
thanks in advance.
Last edited by MadeInFck on 06 Apr 2020, 21:54, edited 1 time in total.
MadeInFck
Hobbyist in DIY & Coding
madeinfck.com

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Unable to access value of progress bar

#2 Post by ThomasB » 05 Apr 2020, 22:28

In the Nextion IDE, change j0.val to global scope. If it already is global, then post a screenshot of ESPEasy's DHT11 device page for review.

BTW, I recommend that your Nextion vars include the page number that defines it. For example, if t4.txt and j0.val are both on Nextion page 0, then the syntax would be:

Code: Select all

Line 1: meteo.page0.t4.txt="[DHT11#Tint]°C"
Line 2: meteo.page0.j0.val=[DHT11#Hext] 
- Thomas

MadeInFck
New user
Posts: 9
Joined: 05 Apr 2020, 20:53
Location: France
Contact:

Re: Unable to access value of progress bar

#3 Post by MadeInFck » 05 Apr 2020, 22:52

Actually, meteo is the name of the page where I want to change the components (on the same page "meteo").
j0 is already global.
Is it useful to write ?

Code: Select all

 meteo.page0

Code: Select all

Line 1: meteo.t4.txt="[DHT11#Tint]°C" //device connected directly to this Espeasy
Line 2: meteo.page0.j0.val=[DHT22#Hext] // data received from another device via UDP
Here are the snapshots requested.
Capture d’écran 2020-04-05 à 22.50.05.png
Capture d’écran 2020-04-05 à 22.50.05.png (274.09 KiB) Viewed 6807 times
Capture d’écran 2020-04-05 à 22.46.36.png
Capture d’écran 2020-04-05 à 22.46.36.png (305.05 KiB) Viewed 6807 times
Here's the page of Nextion device, check line 7:
Capture d’écran 2020-04-05 à 23.04.09.png
Capture d’écran 2020-04-05 à 23.04.09.png (231.9 KiB) Viewed 6806 times
MadeInFck
Hobbyist in DIY & Coding
madeinfck.com

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Unable to access value of progress bar

#4 Post by ThomasB » 05 Apr 2020, 23:32

Actually, meteo is the name of the page where I want to change the components (on the same page "meteo").
If "meteo" is the Nextion page's name (renamed default PageX) then your existing syntax is fine.
j0 is already global.
OK.

You originally mentioned that the following line did not work:

Code: Select all

Line 2: meteo.j0.val=[DHT11#Hext] // can't work that out
This line has a typo (wrong var name). But I don't see your Nextion lines using that statement.

BTW, your DHT11 humidity is #Hint, and DHT22 is #Hext. The expected syntax for the DHT22 humidity sensor device would be:

Code: Select all

Line 2: meteo.j0.val=[DHT22#Hext]
And I see that your screenshot shows the proposed syntax (on line 7). Do your existing seven Nextion lines work? If not, which are giving you trouble?

Keep in mind that Nextion's Line Statements are periodically updated using the Nextion Plugin's Interval value. A large value will needlessly delay screen updates. Since one of your Line Statements displays systime, I suggest using a value of 1 (one second).

The web log may provide some information that can help with troubleshooting the problem. So review the messages to see if there's anything helpful.

- Thomas

MadeInFck
New user
Posts: 9
Joined: 05 Apr 2020, 20:53
Location: France
Contact:

Re: Unable to access value of progress bar

#5 Post by MadeInFck » 06 Apr 2020, 08:02

Thank you Thomas.
Actually, only line 7 is giving me trouble.

if I set it statically like following, it works :
line7: meteo.j0.val=25

If I use it via a http request, it works:
IP/control?cmd=InterfaceNextion,meteo.j0.val=80

But dynamically within the command statements, it doesn't work with this syntax(as shown in previous picture).
Here is what I get in the log, showing that the data is being received correctly.
I'm already using 1 second interval update (worked that out to have systime updated everything second of course).
Capture d’écran 2020-04-06 à 07.59.43.png
Capture d’écran 2020-04-06 à 07.59.43.png (25.09 KiB) Viewed 6771 times
Even tried with the rules:
On DHT22#Hext do
xxxxxInterfaceNextion,meteo.j0.val=[DHT22#Hext]
endon

Actually, everything works fine except line 7. Still bugging whatever I try.
MadeInFck
Hobbyist in DIY & Coding
madeinfck.com

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Unable to access value of progress bar

#6 Post by ThomasB » 06 Apr 2020, 17:54

Very strange. In the web log you will be able to see the InterfaceNextion printing actions (ACT:). They will allow you to see exactly what is being sent to the Nextion. So check the logged meteo.j0.val action. What is being sent?

Also:
1. Does the progress bar work if Statement Line 7 uses [DHT11#Hint] instead of [DHT22#Hext]?
2. Does the humidity data appear when you send [DHT22#Hext] to a Nextion text field instead of the progress bar field?
3. Try changing this line in your rules:

From:

Code: Select all

InterfaceNextion,meteo.j0.val=[DHT22#Hext]
To:

Code: Select all

InterfaceNextion,'meteo.j0.val=[DHT22#Hext]'
- Thomas

MadeInFck
New user
Posts: 9
Joined: 05 Apr 2020, 20:53
Location: France
Contact:

Re: Unable to access value of progress bar

#7 Post by MadeInFck » 06 Apr 2020, 20:59

So to answer your questions, yes I see the action related to the progress bar in the log:
Capture d’écran 2020-04-06 à 20.53.12.png
Capture d’écran 2020-04-06 à 20.53.12.png (17.13 KiB) Viewed 6723 times
and the value is OK. Don't be surprised I changed the name of my device from InterfaceNextion to Nextion to gain room.

Also in reference to your questions :
1. no it doesn't work by replacing [DHT22#Hext] by [DHT11#Hint]
2. yes [DHT22#Hext] works (line 5 in Nextion command statements) so the data is correctly called and works fine for textfields
3. doesn't work either

Thanks again for your help.
Once again, that's weird!
MadeInFck
Hobbyist in DIY & Coding
madeinfck.com

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Unable to access value of progress bar

#8 Post by ThomasB » 06 Apr 2020, 21:27

The weblog shows that the Nextion command string for meteo.j0.val is being sent to the Nextion. So far so good.

Just a hunch, but I suspect the issue is because the data is sent as a float value. I believe the progress bar expects an integer between 0 and 100.

So edit the two DHT plugins and change the #Hint and #Hext values to have "0" decimals. The web log should now show the Nextion ACT to have an int value (no decimal). And hopefully the progress bar works too.

- Thomas

MadeInFck
New user
Posts: 9
Joined: 05 Apr 2020, 20:53
Location: France
Contact:

Re: Unable to access value of progress bar

#9 Post by MadeInFck » 06 Apr 2020, 21:45

Thomas, you made my day!!!
Indeed, that an issue with progress bar accepting only integers.
And actually I had already tried to have no decimal on the DHT22 device ESPEAsy itself but not in the virtual device received on my interface device (Nextion).

It works finally! Many thanks for your help.
MadeInFck
Hobbyist in DIY & Coding
madeinfck.com

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Unable to access value of progress bar

#10 Post by ThomasB » 06 Apr 2020, 21:53

You're welcome. Glad to hear you solved it.

- Thomas

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest