Get Scroll Distance

Hi everyone,

Do you know if there is a way to get the window.scrollY distance of a specific lovelace view and dynamically update it to an input number?

Thank you!

That would require a client side code running, like a javascript.
HA does not have such javascripts, so you would have to make one yourself.

Do you know how could I integrate that into Home Assistant? Or at least point me in the right direction? I’ve seen something about custom panels… Would that be a viable solution in this case?

Thank you.

I hve no idea.

I guess javascript are powsibl in lovelace cards and it should be possible to transfer the value through a web socket into HA, but how to do it more precisely is not something ai can help with.