OLED screen off timer rule

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
neffe
New user
Posts: 1
Joined: 02 Mar 2021, 20:10

OLED screen off timer rule

#1 Post by neffe » 02 Mar 2021, 20:30

Hi All,

I'm struggling with "rules" for the below situation, who can help me with the issue?

Goal:
After system boot, switch the OLED screen off after 30 seconds.
When motion is detected switch the screen on for 30 seconds and then switch off again.

Problem:
The OLED screen will only stay on for 1 sec, but not for 30 seconds as coded below after motion detection.

Current rule:
On System#Boot do //When the ESP boots, do
timerSet,1,30 //Set Timer 1 for the next event in 30 seconds
endon

On Rules#Timer=1 do //When Timer1 expires, do
OLEDCMD,off
endon

on Motion#Detection=1 do
timerSet,2,30
OLEDCMD,on
endon

on Rules#Timer=2 do
OLEDCMD,off
endon


Thanks!

marstu
Normal user
Posts: 37
Joined: 29 May 2021, 02:15

Re: OLED screen off timer rule

#2 Post by marstu » 31 May 2021, 23:35

neffe wrote: 02 Mar 2021, 20:30
Current rule:
On System#Boot do //When the ESP boots, do
timerSet,1,30 //Set Timer 1 for the next event in 30 seconds
endon

On Rules#Timer=1 do //When Timer1 expires, do
OLEDCMD,off
endon

on Motion#Detection=1 do
timerSet,2,30
OLEDCMD,on
endon

on Rules#Timer=2 do
OLEDCMD,off
endon
I am not an expert, but my rule for OLED on an off looks like that:

Code: Select all

on Clock#Time=All,22:00 do //will run once a day at noon
 oledframedcmd,display,off
endon

on Clock#Time=All,08:00 do //will run once a day at noon
 oledframedcmd,display,on
endon
--
ESP8266, ESPEasy (always latest mega release in use :D ), and Domoticz (only beta versions :) )

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED screen off timer rule

#3 Post by Ath » 01 Jun 2021, 15:45

Please be aware that if an OLED is turned on for prolonged time, the risk of image-burn-in is quite real.
So setting a display time-out, either by the configuration settings on the OLED(Framed) configuration using a button or sensor to wake-up, or by rules (when having more complex time-out requirements) is a 'good thing'.
/Ton (PayPal.me)

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

Re: OLED screen off timer rule

#4 Post by ThomasB » 01 Jun 2021, 18:41

Problem:
The OLED screen will only stay on for 1 sec, but not for 30 seconds as coded below after motion detection.
Your rules look legit. Perhaps you have a hidden unprintable character within your rules that is corrupting execution. Copy/past the entire rule file into an editor (e.g. notepad++) that shows native ASCII values. This will allow you to confirm the rule's text is clean.

- Thomas

marstu
Normal user
Posts: 37
Joined: 29 May 2021, 02:15

Re: OLED screen off timer rule

#5 Post by marstu » 06 Jun 2021, 00:10

Ath wrote: 01 Jun 2021, 15:45 Please be aware that if an OLED is turned on for prolonged time, the risk of image-burn-in is quite real.
So setting a display time-out, either by the configuration settings on the OLED(Framed) configuration using a button or sensor to wake-up, or by rules (when having more complex time-out requirements) is a 'good thing'.
Definitively, especially when it is located in the bedroom, because these small, little things are really bright. :D
--
ESP8266, ESPEasy (always latest mega release in use :D ), and Domoticz (only beta versions :) )

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 28 guests