I have been trying to get the sleep mode on NSPanels for quite a while and could never get it to work, because data sent to the NSPanel, while the screen is sleeping is not updating when the screen wakes. You have to wait until a new entry is sent from HA to get the value to appear.
I tried multiple ways to get it work, but nothing seems to help.
Things tried:
Add an entry to call update_all_components() on_wake in the screen definition
Add a custom call for update_all_components() on button press
Added delays of 1 through 10 seconds to on wake and button press before update_all_components() gets called
created a button configured to trigger update_all_commands() at any point.
Number 4 is especially interesting. I had the NSPanel go to sleep and woke it up after 5 minutes - I show a clock on the screen and saw in the ESPHome log, updates were sent properly and were received by ESPHome. I hit the button to manually update all components before a new time came in from HA, but nothing changed. The log showed propery, that the button was pressed, but nothing changed on the screen until a new update came from HA.
Either I am not understanding how this works, or it doesn't work. I tried looking at the code, and I am not in sleep, I don't ignore the command in setup and the screen is woken up (I even added sleep(0) in option 4 - and I know it works, because pressing the button with the screen sleeping- it would wake up).
How should one get the Nextion screen to update data on waking up from sleep?
After pressing the button:
'nspanel-04 Update all data' Pressed.
After waking up without manual trigger of data update:
13:08:05 [D] [nextion:468]
Got touch at x=255 y=206 type=PRESS
13:08:06 [D] [nextion:468]
Got touch at x=255 y=206 type=RELEASE
13:08:06 [D] [nextion:822]
all_components_send_state_
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The problem
I have been trying to get the sleep mode on NSPanels for quite a while and could never get it to work, because data sent to the NSPanel, while the screen is sleeping is not updating when the screen wakes. You have to wait until a new entry is sent from HA to get the value to appear.
I tried multiple ways to get it work, but nothing seems to help. Things tried:
Number 4 is especially interesting. I had the NSPanel go to sleep and woke it up after 5 minutes - I show a clock on the screen and saw in the ESPHome log, updates were sent properly and were received by ESPHome. I hit the button to manually update all components before a new time came in from HA, but nothing changed. The log showed propery, that the button was pressed, but nothing changed on the screen until a new update came from HA.
Either I am not understanding how this works, or it doesn't work. I tried looking at the code, and I am not in sleep, I don't ignore the command in setup and the screen is woken up (I even added sleep(0) in option 4 - and I know it works, because pressing the button with the screen sleeping- it would wake up).
How should one get the Nextion screen to update data on waking up from sleep?
Which version of ESPHome has the issue?
2023..
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
Every one this year. I had this for a long time.
What platform are you using?
ESP32
Board
NSPanel (multiple hardware revisions)
Component causing the issue
Nextion
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response