Refreshin Sitemaps after changes

Hi,

it’s a general problem. As example if I use a Selection in the Sitemap this will not refresh the sitemap. I have to press F5 and then I see the change.

I have made an ugly solution that the sitemap could be refreshed every 5 seconds:

My HTML-Code

<!DOCTYPE html>
<html>
<head>
    <title>Automatische Seitenaktualisierung</title>
    <script type="text/javascript">
        // JavaScript, um die Seite alle 5 Sekunden neu zu laden
        setInterval(function() {
            window.top.location.reload();
        }, 5000); // 5000 Millisekunden (5 Sekunden)
    </script>
</head>
<body>
</body>
</html>

I found out that window.location.reload(); only reloads my Webview. So I changed it to window.top.location.reload();.

The big advantage is that if you open as example the Menu from a Selection the page could be refreshed and this will close the Selection before you have selected anything.

I added this to my Sitemap:

Webview url="/static/sitemaps/auto_reloader.html" icon=none

I have one more thought. Maybe it is possible to divide some things into different frames and reload single frames at the end instead of the whole sitemap. But I still have no idea how to implement this.

Is there another solution? I have also thought about writing a script that simply generates HTML pages with JavaScript / jQuery code for sitemaps, which are then reloaded asynchronously.

Love greetings
Michael

Don’t think the same.
I’m not changing my sitemaps daily several times. only when I develop something new, but not when just using my existing installation.
Therefore it’s more an “issue” during development and not in real life from my perspective.

My online banking will also not refresh automatically, when there is a new transaction coming in and I need to reload the page. That’s nothing openhab specific.

There are also plugins for browsers that allow you to reload pages with a certain interval.