Cast - Size of Cards too big on Full HD Screen

Hi,
I’ve setup a view in Lovelace that I want to cast to a device.
Here’s how it looks on an 10" Android Tablet (1280*800 resolution)


When casting to a Full HD Device, sizing of Cards is wrong, and much less information can be displayed:

Any idea what’s happening? Or maybe a parameter that I’ve overlooked (scaling?)
Thanky for any advice.

Ever find a solution for this?

Still no answers? This will determine whether this feature is viable for me or not…

Never found an answer to this (but I didn’t look into this either)

I’m sorry, I know the thread’s over 2 years old. I’m having this issue still, is there any solution that was ever found?

try the lovelace horizontal stack card and force 4 across?

It’s a bit hacky, but works for me. I’m using it to just target TVs as my layout is fine on my hub

  1. add a file to /config/www called overrides.js and paste in this
class ResizeCast {
    constructor() {
        const home_assistant_main = document.querySelector("hc-main");
        home_assistant_main.style.setProperty('zoom', 0.75); // zoom out to 75%
        window.dispatchEvent(new Event('resize'));
        const bg_element = home_assistant_main.shadowRoot.children[0];
        bg_element.style.setProperty('min-height', '200vh');  // makes sure background goes the the bottom of the display by making it 200% high
    }
}

const isTouchDevice = () => {  
    return (('ontouchstart' in window) ||  
        (navigator.maxTouchPoints > 0) ||  
        (navigator.msMaxTouchPoints > 0));  
}  

const bases = [
    customElements.whenDefined('hc-main')
];

Promise.race(bases).then(() => {
    // don't bother if we're on a hub
    if (!isTouchDevice) {
        window.setTimeout(() => {
            window.resize_cast = window.resize_cast || new ResizeCast();
        }, 1000); // apply after 1000ms
    }
});
  1. Go to settings / dashboards / resources and add a javascript module with the path /local/overrides.js
  2. Restart your chromecast devices and your dashboards should now be 75% of their normal size.
1 Like

I tried to use your script but it didn’t work, were there any changes or updates?

Add WTH still not able to set resolution when casting dashboard to UHD Chromecast to Month of WTH.

2 Likes

What were you trying it with? Chrome cast, chrome tv, or one of the hubs?

I’m trying on a tv with buildin chromecast

Also doesn’t work for me unfortunately. I am using Chromecast with Google TV 4K on a 27 inch 4k monitor.

Displays way too big on my built in Chromecast too!

Also cannot control anything with the remote?

What’s the point of this functionality?

Hi, i also tried to fit my dashboard on a 43Inch 4K Display. You only can a small part of the dashboard. Does anyone know, if there will be a feature for this in future? I would like to show some stats and weather casts on my screen vis Google chromecast.

Digging up graves as well. This seems like a great feature to have. Searching for a way to solve it on my Chromecast Ultras on both 1080 and 4K displays, where the content casted is far too large.

Good solution is Android Debug Bridge and command
am start -a android.intent.action.VIEW -d https://your.url