maykar / custom-header

Custom Header adds enhancements and customization options to Home Assistant's Lovelace header.
https://maykar.github.io/custom-header
MIT License
256 stars 107 forks source link

Header temporarily stops updating when screen turns off on Samsung device #225

Closed manuelo1983 closed 4 years ago

manuelo1983 commented 4 years ago

I have the custom header active in my Home Assistant and if i don't do anything on the tablet for a while, the time is not displayed currently. There is always a few minutes delay. Only if you keep the tablet on longer, the time will be updated correctly. I have a Samsaung T590 and have also disabled all battery saving options. Screen lock is also disabled. I can perform all other actions immediately after turning on the display without delay.

I have following settings:

- custom_header:
  background: 'rgba(155, 155, 155, 0.25)'
  header_text: XXXXXXXX
  button_text:
    options: '{{ hours12 }}:{{ minutesLZ }}'

Greetings

github-actions[bot] commented 4 years ago

Important:

Issues that don't provide the necessary information listed below may not get a reply and will be closed until the info is provided.

Release is the current version of Custom Header. Be sure that you are using the latest version by checking your browser's dev tools console (usually found by pressing F12). If this doesn't display the current version either clear your cache or reinstall.

If you haven't yet done so, please read the "Before Posting an Issue" section of the docs site.

Include as much of the following info as you can to help me replicate and investigate your issue:

When pasting in your config always place 3 backticks ``` above the first line of your config and after the last line. Doing this will format it correctly so that I may find any formatting errors in your config.

maykar commented 4 years ago

From what little research I've done, this seems to be a common issue with Samsung devices.

Things to check:

Even with these settings people complain that apps and network activity can stop when the screen is off.

Let me know if any of that helps the issue, if not I can try adding a listener for visibility changes to update the header.

manuelo1983 commented 4 years ago

Thank you for your research, but I've tried all your settings, but it just won't work. A garage to open works immediately after I wake up the tablet, but the clock sometimes takes up to 40 seconds to update itself. I think an optimization at this point would be perfect, otherwise the clock won't work there. unfortunately. Thank you

maykar commented 4 years ago

One of two things is happening when your screen turns off:

Hopefully when the screen turns back on a visibility change event is triggered in the browser.

manuelo1983 commented 4 years ago

One thing was not correct from my side. I use the Home Assistant app on the tablet, not google chrome. I only use chrome to configure Home Assistant. This morning I tried the whole thing again after the tablet was not on for the whole night. When I got up it was 7:14am. I double clicked on the tablet and it was 7:08 am. After 20 seconds it was updated, When I do nothing on the tablet. If I press an action button e.g. opening the Garage, it is the same Situation. Okay if I chance to another view the clock changes directly when I press the other section view.

This is the current situation with all settings as you sent them to me yesterday. thanks a lot

manuelo1983 commented 4 years ago

@maykar: Do you have any news for me. I have tested this issue now the whole week and this is always happening. So the clock is not really usefull. Thank you

maykar commented 4 years ago

When I get the chance I will. This is not the only project or issue I have and I also have little free time. Thanks for understanding.

manuelo1983 commented 4 years ago

That sounds very good!!!! Thanks a lot...

maykar commented 4 years ago

Added config update on the visibilitychange event to the latest pre-release 1.5.9. To view pre-releases in HACS go to the Custom Header listing under "Frontend", click the 3 dots in the right hand corner, select "Reinstall", turn on "Show beta versions", select 1.5.9, and hit "Install". Clear cache afterwards just in case.

If this doesn't fix your issue, then I believe the only other remedy would be to rewrite how CH implements it's clock. This isn't something that I would be willing to do for an edge case issue on one specific device.

Another option would be to use something like browser-mod to blackout the screen rather than letting the screen turn off.

manuelo1983 commented 4 years ago

Thank you for your quick change. I have tried at the moment, but it seems that the result is the same as before. Many thanks anyway.

maykar commented 4 years ago

Sorry that didn't work out for you, give browser-mod a try. It's got some really cool features aside from blackout as well.

manuelo1983 commented 4 years ago

But this works only when I use Home Assistant via browser not in the app?

maykar commented 4 years ago

I believe it would work with the app just fine as well. Something else you might want to check out is Fully Kiosk Browser.

maykar commented 4 years ago

HA's current beta 0.112.0 added a feature that may actually help with your issue. It automatically disconnects when a tab has been inactive for 5 minutes. I'd be interested to know if this has any effect on your issue.

manuelo1983 commented 4 years ago

Ok thank you for that. I will try it. It is really strange because it is never more than 5-10 minutes in the past when I make a double click on the tablet. So it seams that it works something in the background also if the tablet is on stand by.