adding command test in apiserver\nsome debugging\nfree sms now running fine
This commit is contained in:
@ -8,6 +8,7 @@ function linky2mqttCallback($topic, $message)
|
||||
{
|
||||
global $topics, $logFh, $devices, $included;
|
||||
$topicName = $topic[0];
|
||||
$topics[$topicName]->lastSeen = time();
|
||||
$friendlyName = $topic[1]; // get friendlyName
|
||||
logger(INFO, sprintf(_("Incoming notification of device %s"), $topicName, $fn), __FILE__ . ":" . __LINE__);
|
||||
$payloadArray = json_decode($message->payload, true);
|
||||
@ -36,4 +37,6 @@ function linky2mqttCallback($topic, $message)
|
||||
//print_r($device["device"]);
|
||||
}
|
||||
$topics["linky2mqtt"]->callback = "linky2mqttCallback";
|
||||
$topics["linky2mqtt"]->timeOut = 3; // timeOut in minutes
|
||||
$topics["linky2mqtt"]->lastSeen = time();
|
||||
?>
|
||||
|
@ -4,7 +4,7 @@ if (!array_key_exists("pws2mqtt", $devices)) $devices["pws2mqtt"] = array();
|
||||
|
||||
function pws2mqttCallback($topic, $message)
|
||||
{
|
||||
global $logFh, $devices, $included;
|
||||
global $logFh, $devices, $included, $topics;
|
||||
$topicName = $topic[0];
|
||||
$fn = $topic[1];
|
||||
logger(INFO, sprintf(_("Incoming notification of device %s => friendly name : %s"), $topicName, $fn), __FILE__ . ":" . __LINE__);
|
||||
@ -30,6 +30,7 @@ function pws2mqttCallback($topic, $message)
|
||||
{
|
||||
$device = &$device[$fn];
|
||||
}
|
||||
$topics[$topicName]->lastSeen = time();
|
||||
unset($payloadArray["friendly_name"]);
|
||||
unset($payloadArray["ieeeAddress"]);
|
||||
unset($payloadArray["type"]);
|
||||
@ -60,6 +61,8 @@ function pws2mqttCallback($topic, $message)
|
||||
}
|
||||
};
|
||||
$topics["pws2mqtt"]->callback = "pws2mqttCallback";
|
||||
$topics["pws2mqtt"]->timeOut = 3; //timeOut in minutes
|
||||
$topics["pws2mqtt"]->lastSeen = time();
|
||||
|
||||
if (!is_callable("pws2mqttGetList"))
|
||||
{
|
||||
|
@ -6,7 +6,8 @@ if (!array_key_exists("zigbee2mqtt", $devices)) $devices["zigbee2mqtt"] = array
|
||||
function zigbee2mqttCallback($topic, $message)
|
||||
{
|
||||
global $topics, $devices, $included, $logFh, $indexFriendlyNames, $devicesRequest;
|
||||
|
||||
|
||||
$topics[$topic[0]]->lastSeen = time();
|
||||
if ($topic[1] == "bridge")
|
||||
{
|
||||
switch ($topic[2])
|
||||
@ -117,5 +118,6 @@ function zigbee2mqttCallback($topic, $message)
|
||||
};
|
||||
|
||||
$topics["zigbee2mqtt"]->callback = "zigbee2mqttCallback";
|
||||
|
||||
$topics["zigbee2mqtt"]->timeOut = 3;
|
||||
$topics["zigbee2mqtt"]->lastSeen = time();
|
||||
?>
|
||||
|
Reference in New Issue
Block a user