ESPEasy Help + OLED SSD1306 + DHT + Rules
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 57
- Joined: 22 Sep 2022, 20:04
ESPEasy Help + OLED SSD1306 + DHT + Rules
First thing to know, I display the temperature and humidity perfectly on the display.
I use only two lines to have a readable size.
But I try to replace one of the lines temporarily with the command
oledframedcmd,<line>,<text>
in one of my rules.
It works perfectly, for example
oledframedcmd,1,122 %
Displays 122% correctly on the first line of the display.
What I can't do is to make the Temperature variable return
T: [DHT22#Temperature] °C
What I am trying to do is to display Temperature + Humidity and temporarily use line 1 or 2 to display another information but it does not stay there and it returns to the initial display.
Do you have an idea of what to do to be able to either do a Reset of the display, to restart the display of the Temperature/Humidity?
Regards
I use only two lines to have a readable size.
But I try to replace one of the lines temporarily with the command
oledframedcmd,<line>,<text>
in one of my rules.
It works perfectly, for example
oledframedcmd,1,122 %
Displays 122% correctly on the first line of the display.
What I can't do is to make the Temperature variable return
T: [DHT22#Temperature] °C
What I am trying to do is to display Temperature + Humidity and temporarily use line 1 or 2 to display another information but it does not stay there and it returns to the initial display.
Do you have an idea of what to do to be able to either do a Reset of the display, to restart the display of the Temperature/Humidity?
Regards
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
The Framed OLED plugin does allow for several "pages".
The task will switch to a new "page" when there are non-empty lines with a line nr larger than what can fit on a single page.
The "interval" setting determines how long a "page" will be shown.
About the degree symbol (not sure if that's also a problem you're facing) You can use {D} to make the degree symbol.
The task will switch to a new "page" when there are non-empty lines with a line nr larger than what can fit on a single page.
The "interval" setting determines how long a "page" will be shown.
About the degree symbol (not sure if that's also a problem you're facing) You can use {D} to make the degree symbol.
-
- Normal user
- Posts: 57
- Joined: 22 Sep 2022, 20:04
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
A first autoreply
My command
oledframedcmd,1, "T: [DHT22#Temperature] °C"
changes the display correctly
But no more automatic refresh of the temperature on line 1.
My command
oledframedcmd,1, "T: [DHT22#Temperature] °C"
changes the display correctly
But no more automatic refresh of the temperature on line 1.
-
- Normal user
- Posts: 57
- Joined: 22 Sep 2022, 20:04
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
Thanks TD-er
Ok I understand the workarround
oledframedcmd,4,122
then a delay
Then
oledframedcmd,4
Without message, only the first page is displayed.
This is not a stupid method, if there is no other.
Thanks for the tip.
I don't have a problem with the degree symbol at the moment, but I'll keep your comment in a corner.
Regards
Ok I understand the workarround
oledframedcmd,4,122
then a delay
Then
oledframedcmd,4
Without message, only the first page is displayed.
This is not a stupid method, if there is no other.
Thanks for the tip.
I don't have a problem with the degree symbol at the moment, but I'll keep your comment in a corner.
Regards
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
I hope you're not using the delay command, as that will block all execution of ESPEasy for the duration.
The page rotation delay is determined by the Interval setting on the display configuration. If you set that to 5 (seconds) that should be a reasonable refresh rate (default is 60, that's rather long).
Edit:
The alternative to delay is the use of a timer, so to set a message:
Code: Select all
on setmessage* do
oledframedcmd,4,"%eventvalue1%"
oledframedcmd,frame,2 // switch to the new message
timerset,1,60 // Clear message after 60 seconds using timer 1 (of 256)
endon
on rules#timer=1 do
oledframedcmd,4
endon
The text must be wrapped in quotes if it contains spaces or commas.
Last edited by Ath on 22 Sep 2022, 23:32, edited 2 times in total.
/Ton (PayPal.me)
-
- Normal user
- Posts: 57
- Joined: 22 Sep 2022, 20:04
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
no, Delay was just to indicate
I run the command
I wait for some time
then I restart the command to return to the initial state of the display.

I run the command
I wait for some time
then I restart the command to return to the initial state of the display.

-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
I edited my previous reply while you replied to that



/Ton (PayPal.me)
-
- Core team member
- Posts: 9921
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
Glad you didn't use the delay command in the rules.
I still need to get rid of that, or maybe set off some alarms, change the web UI background into flickering red etc.
As Ton suggested, you better use some timers to trigger time based or periodical events.
Maybe even looptimer as that one will automatically set the next timer based on when the previous one should have been executed, thus not introducing drift over time.
I still need to get rid of that, or maybe set off some alarms, change the web UI background into flickering red etc.

As Ton suggested, you better use some timers to trigger time based or periodical events.
Maybe even looptimer as that one will automatically set the next timer based on when the previous one should have been executed, thus not introducing drift over time.
-
- Normal user
- Posts: 57
- Joined: 22 Sep 2022, 20:04
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
Thanks for the example in the answer, it will help me to go faster.
But yes, that's the idea.
Display a one-time message for a moment, then go back to normal.
But yes, that's the idea.
Display a one-time message for a moment, then go back to normal.
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
After setting the message you can also use the command 'oledframedcmd,frame,2' to activate the second page/frame immediately. Then choosing a somewhat longer Interval is more useful, so the message will be displayed for some time. Once the message is cleared by the timer it will resume at the initial page.
/Ton (PayPal.me)
-
- Normal user
- Posts: 57
- Joined: 22 Sep 2022, 20:04
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
@Ath, not sure about your method, I just tested and nothing happens.
In the configuration of my OLED, I have only 2 lines configured, the third information is dynamic,
she comes according to several criteria, state of a sensor, MQTT information, others in the Rules.
In the configuration of my OLED, I have only 2 lines configured, the third information is dynamic,
she comes according to several criteria, state of a sensor, MQTT information, others in the Rules.
-
- Normal user
- Posts: 1018
- Joined: 10 Sep 2020, 16:02
- Location: germany
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
You are working on that to happen right now.

In case you forgot:
You do not have the required permissions to view the files attached to this post.
-
- Normal user
- Posts: 4341
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
updated the code above to show what I mean
/Ton (PayPal.me)
-
- Normal user
- Posts: 57
- Joined: 22 Sep 2022, 20:04
Re: ESPEasy Help + OLED SSD1306 + DHT + Rules
I keep all your suggestions in a corner, my code for the moment works (without this option).
I'm busy at the moment with the 3D design of the project and it takes a lot of time.
But as soon as everything is in the box, I will work on this part of the code for the display.
Thanks for all your feedback which is very precious.
Regards
I'm busy at the moment with the 3D design of the project and it takes a lot of time.
But as soon as everything is in the box, I will work on this part of the code for the display.
Thanks for all your feedback which is very precious.
Regards
Who is online
Users browsing this forum: Ahrefs [Bot], Anthropic Claude Bot [bot], OpenAI GPTBot [bot] and 1 guest