From 4b5eba3a2340744207d7fd08af701b690cfe2451 Mon Sep 17 00:00:00 2001 From: jhartworks Date: Wed, 4 Mar 2026 14:57:36 +0100 Subject: [PATCH] Add timestamp handling in SendTopic method to improve MQTT publishing logic --- Monitoring Client/module.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Monitoring Client/module.php b/Monitoring Client/module.php index 9121ccc..ba5f18c 100644 --- a/Monitoring Client/module.php +++ b/Monitoring Client/module.php @@ -120,6 +120,7 @@ class MonitoringClient extends IPSModule { return true; } // MQTT_Publish + public function SendTopic() { $mqttId = $this->ReadPropertyInteger("MqttCLientID"); @@ -169,7 +170,7 @@ class MonitoringClient extends IPSModule { $varname = IPS_GetName($childid); $topic = $catId["top"]. $parname."_".$varname; $payload = round(getvalue($childid), 2); - + $time = time(); if($changedtime > $time - $updatetime){ $this->MqttPublish($mqttId, $topic, $payload, false); } @@ -194,7 +195,7 @@ class MonitoringClient extends IPSModule { $varname = IPS_GetName($childid); $topic = $catId["top"].$varname; $payload = round(getvalue($childid), 2); - + $time = time(); if($changedtime > $time - $updatetime){ $this->MqttPublish($mqttId, $topic, $payload, false); }