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

Scaling option won't change render scale at all #133

Open
Godigodi89 opened this issue Oct 23, 2024 · 2 comments
Open

Scaling option won't change render scale at all #133

Godigodi89 opened this issue Oct 23, 2024 · 2 comments

Comments

@Godigodi89
Copy link

Hello,
Thank you for your work!

So, for few months now, I noticed my kiosk render won't scale up anymore.
Changing SCALING to 2 or 3 or 0.5 won't affect the size of the content displayed.

Here is my configuration yaml:

HA_BASE_URL: https://192.168.1.XX:8123
HA_SCREENSHOT_URL: /lovelace/kindle?kiosk
HA_ACCESS_TOKEN: >-
  [mytoken]
LANGUAGE: fr
CRON_JOB: "* * * * *"
RENDERING_TIMEOUT: "60000"
RENDERING_DELAY: "0"
RENDERING_SCREEN_HEIGHT: 1448
RENDERING_SCREEN_WIDTH: 1072
BROWSER_LAUNCH_TIMEOUT: "30000"
ROTATION: 90
SCALING: 2
GRAYSCALE_DEPTH: "8"
IMAGE_FORMAT: png
COLOR_MODE: GrayScale
REMOVE_GAMMA: true
PREFERS_COLOR_SCHEME: light
HA_BATTERY_WEBHOOK: ""
ADDITIONAL_ENV_VARS: []

The content I'm trying to scale up is a Google Sheet integration on a lovelace view (panel)
Here is the content on /lovelace/kindle:

type: iframe
url: >-
  https://docs.google.com/spreadsheets/d/e/XXXXXXXXXXXXXXXX/pubhtml?gid=0&single=true&widget=true&headers=false
allow_open_top_navigation: false
aspect_ratio: "9:8"
show_name: false

Thank you in advance

@sibbl
Copy link
Owner

sibbl commented Oct 25, 2024

Hi @Godigodi89, thanks for reaching out!

Did you try another website to find out whether it may be only Google Spreadsheets related?

I heard they're using a specific technique to render their website content (via canvas elements), which may ignore the browser's built-in scaling and zooming features for cases like this.

We may want to find a solution for Google Spreadsheets then.

@Godigodi89
Copy link
Author

Godigodi89 commented Oct 26, 2024

Hi @sibbl, thank you for your reply.

I've tried with my main "Menu" lovelace view using kiosk, and scaling is working just fine with render. So I guess you are right.

Here is the idea I've been trying to work on so far on /lovelace/kindle:

type: iframe
url: >-
  https://docs.google.com/spreadsheets/d/e/XXXXXXXXXXXXXXXX/pubhtml?gid=0&single=true&widget=true&headers=false
allow_open_top_navigation: false
aspect_ratio: "9:8"
show_name: false
card_mod:
  style: |
    div#root iframe  {
      transform: scale(2);
      transform-origin: 0 0;
    }

Now if I use Firefox browser and Chrome browser to visit /lovelace/kindle?kiosk I get my spreadsheet rendered twice bigger as the original, as expected.
However, for some obscure reasons, the size won't change when rendered on your add-on, no matter the scaling value used.
I've also tried to set the RENDERING_DELAY to 10000 (10 seconds) just to test if the renderer was maybe a bit long to scale it up, with no success.

Could it be a difference between how Puppeteer/chromium is dealing with specific Google services?

Thanks in advance and have a great day!

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

2 participants