RemoteWebViewClient icon indicating copy to clipboard operation
RemoteWebViewClient copied to clipboard

[Feature Request] Display turn off timer

Open woody4165 opened this issue 1 year ago • 12 comments

Hi and thanks for your project, very interesting

And working well for me

Is there any possibility to have a display turn off timer directly in EspHome code to have the display turn off after X minutes and turns on with a touch of the screen?

Thanks

woody4165 avatar Oct 26 '25 07:10 woody4165

Yes, it possible. I made the modification in my fork. I will rebase my fork an submit a pull request to strange-v branch: https://github.com/steigerbalett/RemoteWebViewClient

steigerbalett avatar Oct 27 '25 07:10 steigerbalett

@woody4165, you need to define what “turning the display off” means for you.

Overall, the primary goal of creating the ESPHome component was to let users utilize all native ESPHome capabilities as scripts, interacting with the display, touchscreen, etc. I’m a big fan of the single-responsibility principle. RWV should do only its own work and interact with other components as little as necessary to achieve its main task — displaying images from the server.

The same approach applies to documentation and examples: they should only explain how to configure RWV, not how to use ESPHome. The reason is simple — maintenance time. If something in ESPHome changes and I have a screenshot of the old UI, I’d need to update it. I have many ongoing projects I work on in my free time, and I’d rather spend that time on what I’m currently interested in than on updating outdated examples.

strange-v avatar Oct 27 '25 08:10 strange-v

@woody4165: I made two examples for the ESPHome displays:

  • Always on: https://github.com/steigerbalett/RemoteWebViewClient/blob/main/examples/esp32-4848s040-alwayson.yaml
  • Turn off the display back light after x seconds: https://github.com/steigerbalett/RemoteWebViewClient/blob/main/examples/esp32-4848s040-autooff.yaml

@strange-v: I tweaked your example a little bit to be more easier to configure. I hope to lower the entry barrier for the project, so more people could use it.

steigerbalett avatar Oct 27 '25 08:10 steigerbalett

Thanks @steigerbalett and @strange-v !!

@strange-v I appreciate your work and I understand your point regarding the main goal of this project

I will take a look at @steigerbalett second link about turning off the display back light after x seconds and I will implement in my version.

I will close this issue, since I've got all the clarifications

woody4165 avatar Oct 27 '25 16:10 woody4165

This may be useful for ya'll

script:
  - id: auto_off_timer
    then:
      - if:
          condition: 
            switch.is_off: screen_stay_on
          then:
          - delay: 60s # 60 seconds (1 minute)
          - light.turn_off: back_light

switch:
  - platform: template
    name: "Keep Screen On"
    id: screen_stay_on
    optimistic: True
    on_turn_on: 
      then:
        - light.turn_on: back_light
        - script.stop: auto_off_timer
    on_turn_off: 
      then:
        - script.execute: auto_off_timer

touchscreen:
  platform: gt911
  on_touch: 
      - light.turn_on: back_light

vantreeseba avatar Nov 07 '25 01:11 vantreeseba

@woody4165: I made two examples for the ESPHome displays:

  • Always on: https://github.com/steigerbalett/RemoteWebViewClient/blob/main/examples/esp32-4848s040-alwayson.yaml
  • Turn off the display back light after x seconds: https://github.com/steigerbalett/RemoteWebViewClient/blob/main/examples/esp32-4848s040-autooff.yaml

@strange-v: I tweaked your example a little bit to be more easier to configure. I hope to lower the entry barrier for the project, so more people could use it.

Great example, but I have one problem. If the backlight is off, when I try to activate it by pressing it, I always hit one of the buttons and the command is triggered. Maybe I can make the pressing inactive when the backlight is off?

geo903 avatar Nov 12 '25 18:11 geo903

@geo903: I tried, but without any luck...

steigerbalett avatar Nov 23 '25 21:11 steigerbalett

I've tried to address the "trigger a button on resume" issue by using Lvgl and on_idle to overwrite a button across the whole screen when it dims and on_resume to delete the button. My assumption was that as the last object written to the screen the button would take precedence over RWV but sadly that's not the case, the RWV button under the lvgl button still activates :-(

Not sure where to go with this now as it's an amazing project that makes presenting great wall panels very easy but I don't want my panel on all the time so without a way to get round the false triggers on resume I may have to once again look at lvgl.

pay4property avatar Nov 26 '25 23:11 pay4property

I'll add a way to enable/disable touch in RWV soon. When disabled, RWV will ignore all input events.

strange-v avatar Nov 27 '25 05:11 strange-v

@strange-v Thanks, that will be amazing and save me so much work. It's the final element that makes this project really useable.

I'm presuming there will be something that we can add to the display on/off scripts which will allow us to simply disable RWV touch response when dimmed and re-enable once the screen turns back on again.

To prevent burn-in on the screen I'd also like to use lvgl to write random "snow" on the screen when dimmed which I can manage myself but is there also a way to force a full RWV screen refresh when the screen turns back on otherwise I only get the few tiles appearing that are updated?

I want to put numerous panels around the house and really wasn't looking forward to having to sort out multiple lvgl configurations; using a HA dashboard is so much simpler and quicker and your fantastic project makes this easy. Thank-you!

pay4property avatar Nov 27 '25 12:11 pay4property

@pay4property, check the new release.

Regarding burn-in: early ESP32-S2 displays had that issue, but I haven’t heard of it with modern IPS panels. Mine has been running 24/7 for a few months without any noticeable degradation.

What you're describing could be added in the context of #18, but it's a low priority for me.

strange-v avatar Nov 27 '25 12:11 strange-v

@strange-v Thank you so much! The new disable_touch function works perfectly when combined with the screen on/off scripts.

Hopefully your right too on IPS not getting burn in now :-)

pay4property avatar Nov 27 '25 14:11 pay4property