Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.33k stars 247 forks source link

Feature Request: Screensaver customization #1065

Closed Jimmyboy83 closed 8 months ago

Jimmyboy83 commented 11 months ago

Hi! Thank You for this awesome work!!! It will be cool to add customization to screensaver. Not just screen off, but some information, like time or outside temperature. I have tried to add time to screensaver page in Nextion Editor (copy from home page), but it only left blank rectangle without time I have also edited dimming settings for screensaver page, added int brightness=100,brightness_dim=40 and replace font 6 with bigger one

Can You help me with time object on screensaver?

edwardtfn commented 11 months ago

Currently, the time string is created in ESPHome and sent to the display (page Home) every minute. You can try to customize that routine to send it also to the your new time component on "screensaver" page, however, as that would add one more point for maintenance, I would instead add a timer to that page with interval of 60000 (every minute) and in the timer event actions I would add a line to copy the text from home.time to your new component. Also, to set the brightness you have to set the variable dim.

In summary:

  1. On the "Preinitialize Event" on page screensaver, very first line, change from dim=0 to dim=40. This is defining the brightness when the screensaver is shown.
  2. Add a timer (on the "Toolbox" area in the left and on that timer, in the attribute box, set tim to 60000 (1 min). (you can reduce this later, maybe 10s / 10000 or even less will work better).
  3. On that timer, in the "Timer Event" area, add something like: your_time_component.txt=home.time.txt.

With that, when the screensaver page is visible, it will copy the content of the time from the home page every minute (or any interval you set).

Please let me know if it worked.

Jimmyboy83 commented 11 months ago

I added timer on screensaver page and event trigger screensaver.clock.txt=home.time.txt It didn't work

edwardtfn commented 11 months ago

Do you have any error message? Is the timer enabled? On attributes, make sure en is 1.

Jimmyboy83 commented 11 months ago

Error in esphome logs? when enable screensaver:

19:07:02][E][nextion:535]: ERROR: Received numeric return but next in queue "set_component_value" is not a valid sensor type 0 [19:07:02][E][nextion:260]: Nextion queue is empty! [19:07:02][W][component:204]: Component nextion.display took a long time for an operation (0.10 s). [19:07:02][W][component:205]: Components should block for at most 20-30ms. [19:07:12][W][nextion:345]: Nextion reported picture ID invalid!

Timer is enabled

edwardtfn commented 11 months ago

Do you mind sharing your HMI file or an export of page screensaver?

Jimmyboy83 commented 11 months ago

It doesn't matter now, after updating esphome to latest version tft file update again starts freeze at 23% Cleanup build files did not help :-)

edwardtfn commented 11 months ago

Sounds like this one: https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1061#issue-1905619363

Jimmyboy83 commented 11 months ago

After several attempts, and alternation between blank and nspanel files, it works again (no logic) I upload my hmi and page files to github https://github.com/Jimmyboy83/nspanel/

plasterer41 commented 11 months ago

Really cool idea. +1 from me 👍🏼Sent from my iPadOn 21 Sep 2023, at 12:02, Jimmyboy83 @.***> wrote: Hi! Thank You for this awesome work!!! It will be cool to add customization to screensaver. Not just screen off, but some information, like time or outside temperature. I have tried to add time to screensaver page in Nextion Editor (copy from home page), but it only left blank rectangle without time I have also edited dimming settings for screensaver page, added int brightness=100,brightness_dim=40 and replace font 6 with bigger one Can You help me with time object on screensaver?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

edwardtfn commented 11 months ago

Please take a look: https://github.com/Jimmyboy83/nspanel/pull/1

Jimmyboy83 commented 11 months ago

IMG_20230921_223547 Looks great, 176 bold ubuntu font Make it configurable and add as a feature!

Jimmyboy83 commented 11 months ago

Maybe outdoor temperature sensor will be good to add.

edwardtfn commented 11 months ago

Make it configurable and add as a feature!

🤣

I will take a look...

Jimmyboy83 commented 11 months ago

Thank You!!!

edwardtfn commented 11 months ago

Maybe outdoor temperature sensor will be good to add.

But then why not disabling Sleep and have the Home page dimmed?

Jimmyboy83 commented 11 months ago

The panel is on the bedside table and at night my wife can't see small text without glasses. Time and temperature outside, that's all she need at night and in the morning. I planned to turn on the screensaver mode at night through automation, but in version 4 the mechanism has changed and now it's not very convenient to do it

We tested the new screensaver mode last night. It is very convenient

ondras76 commented 10 months ago

Hello, can you tell me how can I switch-off the screensaver? Thank you.

edwardtfn commented 10 months ago

Set Timeout Sleep to 0s.

Jimmyboy83 commented 10 months ago

Hi! Everything working fine, and i bought second NSPanel personally for myself. There are two little questions:

  1. For updating to new version of tft is enough to simply import home and screensaver pages in new HMI from my config and upload it to panel?
  2. Can you add refreshing of outdoor sensor on home page fo using it on screensaver page. I have added it on screensaver page like home.time.txt and in timer, but it only updates on start of screensaver
edwardtfn commented 10 months ago

For updating to new version of tft is enough to simply import home and screensaver pages in new HMI from my config and upload it to panel?

It should be. The Home page can be a bit more complex, as the changes of we changing something in an update are quite big, so maybe you want to just adjust your changes again (based on what changed). GitHub offers quite nice tools to see what changed from one version to other, so you might have to take a look at that on each release: image

For the screensaver page, the chances of a change from our side are really low, so you probably will be good.

Just make sure you don't change page's names and pages ids, as we use those in the code.

edwardtfn commented 10 months ago

2. Can you add refreshing of outdoor sensor on home page fo using it on screensaver page. I have added it on screensaver page like home.time.txt and in timer, but it only updates on start of screensaver

I've added that change to dev. It would be included in the next release.

Jimmyboy83 commented 10 months ago

Thank you! I've already use your fix. It work even on version 4.0. Replacing screensaver page also works fine, on home page I made only some cosmetics changes, so I can edit it again. Cannot find how export import txt files :-)

edwardtfn commented 10 months ago

Cannot find how export import txt files :-)

We use this: https://github.com/MMMZZZZ/Nextion2Text

thstorm commented 9 months ago

Set Timeout Sleep to 0s.

Can you tell me where to set this? Can't find it in the blueprint, do I have to set it in esphome?

edwardtfn commented 9 months ago

On Home Assistant, under Settings > Devices and Services > ESPHome.

edwardtfn commented 7 months ago