Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar Entries are not rendered #95

Open
Texugooftomorrow2 opened this issue Nov 17, 2023 · 6 comments
Open

Calendar Entries are not rendered #95

Texugooftomorrow2 opened this issue Nov 17, 2023 · 6 comments

Comments

@Texugooftomorrow2
Copy link

I've had sucess running the docker container, but any widget that involves calendar entries (calendar.xxxxxx) and/or some icons (like extended wheater forecast) don't get rendered at :5000, I've tried it with the native calendar card, atomic card, and lovelace home feed card, they show perfectly on the dashboard in kyosk mode, but vanish on the screenshot at :5000

@sibbl
Copy link
Owner

sibbl commented Nov 20, 2023

Please try setting RENDERING_DELAY to either 2500 or 5000 (2.5s or 5s). It let's the website settle after it's indicated that the website has been rendered for the given time. Sometimes Javascript code is executed with a short delay, which maybe too long for the Docker container. I hope it helps!

@rgegriff
Copy link

I ran into the same issue and set RENDERING_DELAY to 5000.

Watching the logs, It still seems to snapshot as soon as the page loads. It doesn't even load in all of the cards, let alone load the calendar data

@beeh5
Copy link
Contributor

beeh5 commented Mar 28, 2024

@sibbl I have run into the same issue, curiously enough also with the Calendar widget. I have set my RENDERING_DELAY to a whopping 20000ms (20 seconds), but the Calendar widget still only shows the calendar entries about half of the time...

Not sure if the delay timeout actually works, but just from looking at the code, it looks okay. I was briefly considering that maybe the version of Pupeteer has become to old to work with current HA, but then again, my screen is shown correctly half of the time...

Any further ideas?

@beeh5
Copy link
Contributor

beeh5 commented Mar 28, 2024

I ran the Docker Compose file on my local machine (M1 MacBook Air). Interestingly, once I set RENDERING_DELAY to a value higher than 0, I do not seem to get any calendar events in the screenshot at all. If I leave it at 0, the calendar events do get shown... Which is super weird, because you would expect that the additional timeout should give the program more time to render and not less...

That behaviour makes even less sense if you look at the code. From what I can tell, the only influence the rendering delay has is within the code statement below. How is this supposed to kill off the Calendar events from the view? I am really confused :D

    if (pageConfig.renderingDelay > 0) {
      await page.waitForTimeout(pageConfig.renderingDelay);
    }

@beeh5
Copy link
Contributor

beeh5 commented Apr 3, 2024

@sibbl For testing purposes, I locally upgraded to a Node 18 image and the latest version of Puppeteer. It still shows that weird behaviour described before. (though they have removed the method page.waitForTimeout() in the meantime and require you to bring your own implementation).

What I noticed is that the calendar stuff indeed loads relatively late in the stage. And there are gaps of more than 500ms of network inactivity (thus networkidle0 is likely fired prematurely in many cases). Still, why would adding the timeout make things worse? Maybe HomeAssistant has some UI logic that is being interfered with by having the timeout? Visibility detection?

I keep digging some more.

@beeh5
Copy link
Contributor

beeh5 commented May 23, 2024

@sibbl thanks for merging and releasing the fix so quickly. :-) At least for me, this has resolved the issue.
I think you can close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants