long time no see, because of being happy until a few days. since the last weekend I though about having the OLEDs of my ESPs only active for a few hours per day, with different time ranges at the weekend and during the week. I tried a lot, but didn't find a solution, I hope to get something running like the one below, but was not able:
Code: Select all
on Clock#Time=All,**:** do
LogEntry,"Processing One-Minute Clock Event: Time is %systm_hm%, Day=%sysweekday%"
if %sysweekday%>=1 and %sysweekday%<=7
if %sysweekday%>1 and %sysweekday%<7 // Allowed Date Range, Mon=2, Fri=6
LogEntry,"Mon(2)-Fri(6) Detected, (Day=%sysweekday%)"
if %systm_hm% > 18:00 and %systm_hm% < 21:00 // 6PM - 09:00PM Time Range
LogEntry,"Oled Display Turn On Time"
OledFramedCmd,display,on
endif
endif
if %sysweekday%>1 and %sysweekday%<7 // Allowed Date Range, Mon=2, Fri=6
LogEntry,"Mon(2)-Fri(6) Detected, (Day=%sysweekday%)"
if %systm_hm% > 06:00 and %systm_hm% < 08:00 // 6AM - 8:00AM Time Range
LogEntry,"Oled Display Turn On Time"
OledFramedCmd,display,on
endif
endif
if %sysweekday%=1 or %sysweekday%=7 // Allowed Date Range, Sun=1, Sat=7
LogEntry,"Sun(1) or Sat(7) Detected, (Day=%sysweekday%)"
if %systm_hm% > 09:00 and %systm_hm% < 20:00 // 9AM - 8:00PM Time Range
LogEntry,"Oled Display Turn On Time"
OledFramedCmd,display,on
endif
endif
else
LogEntry,"Oled Display Turn Off Time"
OledFramedCmd,display,off
endif
endon
BTW: The idea was outside the ranges above the OLEDs should be off.
Thanks already for your ideas already and have a nice evening
marstu