diff --git a/Monitoring Client/module.php b/Monitoring Client/module.php index 9532bdd..b0840c1 100644 --- a/Monitoring Client/module.php +++ b/Monitoring Client/module.php @@ -148,14 +148,22 @@ class MonitoringClient extends IPSModule { $parname = IPS_GetName($catChild); foreach ($childids as $childid){ - - $varInfo = IPS_GetVariable($childid); + if (IPS_VariableExists($childid) != 1){ + if(IPS_LinkExists($childid) == 1){ + $linkInfo = IPS_GetLink($childid); + $linkTarget = $linkInfo["TargetID"]; + $childid = $linkTarget; + } + }else{ + $varInfo = IPS_GetVariable($childid); + } + $changedtime = $varInfo["VariableChanged"]; $varname = IPS_GetName($childid); $topic = $catId["top"]. $parname."_".$varname; $time = time(); $payload = round(getvalue($childid), 2); - if($changedtime > time() - $updatetime){ + if($changedtime > $time - $updatetime){ SEMC_MqttPublish($this->InstanceID,$mqttId, $topic, $payload, false); } diff --git a/library.json b/library.json index d3a6b20..9d153c0 100644 --- a/library.json +++ b/library.json @@ -8,6 +8,6 @@ "date": 1491343200 }, "version": "2.0", - "build": 0, + "build": 1, "date": 0 } \ No newline at end of file