no message

This commit is contained in:
2025-07-03 16:20:10 +02:00
parent 6817dc2bd8
commit 727e4a9ed8
2 changed files with 21 additions and 4 deletions

View File

@@ -37,6 +37,7 @@
</div>
<script>
function Apply(data) {
console.log("Neue Daten:", data);
document.getElementById('barCons').style.width = data.prodCons + '%';
document.getElementById('barFeed').style.width = data.prodFeed + '%';
document.getElementById('barPV').style.width = data.consPV + '%';
@@ -64,15 +65,18 @@
if (typeof registerMessageHandler === 'function') {
registerMessageHandler(handleMessage);
} else {
console.warn("registerMessageHandler nicht verfügbar");
}
// Live-Aktualisierung alle 30 Sekunden
// Polling: hole alle 30 Sekunden frische Daten
function pollData() {
if (typeof IPS !== 'undefined') {
console.log("Poll: RequestAction(update)");
IPS.RequestAction('update', '');
}
}
setInterval(pollData, 30000);
</script>
</body>
</html>
</html>