diff --git a/core/ajax/AbeilleZigate.ajax.php b/core/ajax/AbeilleZigate.ajax.php index 938ba513f2..639e4f1732 100755 --- a/core/ajax/AbeilleZigate.ajax.php +++ b/core/ajax/AbeilleZigate.ajax.php @@ -45,7 +45,7 @@ function logToFile($msg = "") $msg = array(); $msg['topic'] = $topic; $msg['payload'] = $payload; - $msgJson = json_encode($msg); + $msgJson = json_encode($msg, JSON_UNESCAPED_SLASHES); $queue = msg_get_queue($abQueues['xToCmd']['id']); if (msg_send($queue, 1, $msgJson, false, false) == false) { @@ -72,7 +72,7 @@ function logToFile($msg = "") "type" => $type, "network" => $network ); - $msgJson = json_encode($msg); + $msgJson = json_encode($msg, JSON_UNESCAPED_SLASHES); if (msg_send($queue, 1, $msgJson, false, false) == false) { $error = "Could not send msg to 'xToParser': msg=".$msgJson; diff --git a/core/class/Abeille.class.php b/core/class/Abeille.class.php index 20ddfc2d17..0f8d9d299e 100644 --- a/core/class/Abeille.class.php +++ b/core/class/Abeille.class.php @@ -543,13 +543,15 @@ public static function cron() { // Checking how many gateways are in pairing mode $count = 0; for ($gtwId = 1; $gtwId <= $GLOBALS['maxGateways']; $gtwId++) { - if (self::checkInclusionStatus("Abeille".$gtwId) == 1) { - Abeille::publishMosquitto($abQueues['xToCmd']['id'], PRIO_NORM, "CmdAbeille".$gtwId."/0000/permitJoin", "Status"); + $incStatus = self::checkInclusionStatus("Abeille${gtwId}"); + log::add('Abeille', 'debug', "cron(): Abeille${gtwId} => inclusion status = ${incStatus}"); + if ($incStatus === 1) { + Abeille::publishMosquitto($abQueues['xToCmd']['id'], PRIO_NORM, "CmdAbeille${gtwId}/0000/permitJoin", "Status"); $count++; } } if ($count > 1) - message::add("Abeille", "Attention !! Vous avez plusieurs (${count}) passerelles en mode inclusion."); + message::add("Abeille", "Attention !! Vous avez plusieurs passerelles en mode inclusion."); // log::add( 'Abeille', 'debug', 'cron(): Fin ------------------------------------------------------------------------------------------------------------------------' ); } // End cron() @@ -1019,15 +1021,14 @@ public static function postSave() { } /* Returns inclusion status: 1=include mode, 0=normal, -1=ERROR */ - public static function checkInclusionStatus($dest) { - // Return: Inclusion status or -1 if error - $ruche = Abeille::byLogicalId($dest.'/0000', 'Abeille'); - - if ($ruche) { - // echo "Join status collection\n"; - $cmdJoinStatus = $ruche->getCmd('Info', 'permitJoin-Status'); - if ($cmdJoinStatus) { - return $cmdJoinStatus->execCmd(); + public static function checkInclusionStatus($net) { + $eqLogic = eqLogic::byLogicalId($net.'/0000', 'Abeille'); + if (is_object($eqLogic)) { + $cmdJoinStatus = $eqLogic->getCmd('info', 'permitJoin-Status'); + if (is_object($cmdJoinStatus)) { + $incStatus = $cmdJoinStatus->execCmd(); + if (($incStatus === 0) || ($incStatus === 1)) + return $incStatus; } } @@ -1794,7 +1795,7 @@ public static function msgFromParser($msg) { if (isset($eqLogic)) { $eqLogic->setIsEnable(0); /* Display message only if NOT in include mode */ - if (self::checkInclusionStatus($net) != 1) + if (self::checkInclusionStatus($net) !== 1) message::add("Abeille", $eqLogic->getHumanName().": A quitté le réseau => désactivé.", ''); $eqLogic->save(); $eqLogic->refresh(); diff --git a/core/class/AbeilleCmdProcess.class.php b/core/class/AbeilleCmdProcess.class.php index d381bf9aa4..9a571dc572 100755 --- a/core/class/AbeilleCmdProcess.class.php +++ b/core/class/AbeilleCmdProcess.class.php @@ -338,123 +338,6 @@ function ReportParamXiaomi($dest,$Command) { } } - // Tcharp38: Seems no longer used - // J'ai un probleme avec la command 0110, je ne parviens pas à l utiliser. Prendre setParam2 en atttendant. - // function setParam($dest,$address,$clusterId,$attributeId,$dstEp,$Param) { - // /* - //
- // - // - // - // - // - // - // - // - // - // Direction: - // 0 - from server to client - // 1 - from client to server - // */ - - // $priority = $Command['priority']; - - // $cmd = "0110"; - // $length = "000E"; - - // $addrMode = "02"; - // // $address = $Command['address']; - // $srcEp = "01"; - // // $dstEp = "01"; - // //$ClusterId = "0006"; - // $Direction = "01"; - // $manufacturerSpecific = "00"; - // $manufacturerId = "0000"; - // $numberOfAttributes = "01"; - // $attributesList = $attributeId; - // $attributesList = "Salon1 "; - - // $data = $addrMode.$address.$srcEp.$dstEp.$clusterId.$Direction.$manufacturerSpecific.$manufacturerId.$numberOfAttributes.$attributesList; - - // // $this->addCmdToQueue($priority, $dest, $cmd, $length, $data, $address); - // $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data, $address); - // } - - // Tcharp38: No longer used - // /** - // * setParam2: send the commande to zigate to send a write attribute on zigbee network - // * - // * @param dest - // * @param address - // * @param clusterId - // * @param attributeId - // * @param destinationEndPoint - // * @param Param - // * @param dataType - // * - // * @return none - // */ - // function setParam2( $dest, $address, $clusterId, $attributeId, $dstEp, $Param, $dataType) { - // cmdLog('debug', " command setParam2", $this->debug['processCmd']); - - // $priority = $Command['priority']; - - // $cmd = "0530"; - - // //
-> 1 - // // -> 2 - // // -> 1 - // // -> 1 - - // // -> 2 - // // -> 2 - - // // -> 1 - // // -> 1 - // // -> 1 (22 -> 0x16) - // // - // // APS Part <= data - // // dummy 00 to align mesages -> 1 - // // -> 8 - // // -> 1 - // // -> 2 - // // -> 1 - // // -> 8 - // // -> 1 - // // => 34 -> 0x22 - - // $addrMode = "02"; - // $addr = $address; - // $srcEp = "01"; - // $dstEp = $dstEp; - // $profId = "0104"; - // $clustId = $clusterId; - // $secMode = "02"; // ??? - // $radius = "30"; - // // $dataLength <- calculated later - - // $frameControl = "00"; - // $transqactionSequenceNumber = "1A"; // to be reviewed - // $commandWriteAttribute = "02"; - - // $attributeId = $attributeId[2].$attributeId[3].$attributeId[0].$attributeId[1]; // $attributeId; - - // $lengthAttribut = sprintf("%02s",dechex(strlen( $Param ))); // "0F"; - // $attributValue = ""; for ($i=0; $i < strlen($Param); $i++) { $attributValue .= sprintf("%02s",dechex(ord($Param[$i]))); } - - // $data2 = $frameControl.$transqactionSequenceNumber.$commandWriteAttribute.$attributeId.$dataType.$lengthAttribut.$attributValue; - - // $dataLength = sprintf("%02s",dechex(strlen( $data2 )/2)); - - // $data1 = $addrMode.$addr.$srcEp.$dstEp.$clustId.$profId.$secMode.$radius.$dataLength; - - // $data = $data1.$data2; - - // // $length = sprintf("%04s", dechex(strlen($data) / 2)); - // // $this->addCmdToQueue($priority, $dest, $cmd, $length, $data, $addr); - // $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data, $addr); - // } - /** * setParam3: send the commande to zigate to send a write attribute on zigbee network with a proprio field * @@ -1048,22 +931,22 @@ function processCmd($Command) { return; } - //---------------------------------------------------------------------- - // https://github.com/fairecasoimeme/ZiGate/issues/145 - // PHY_PIB_TX_POWER_DEF (default - 0x80) - // PHY_PIB_TX_POWER_MIN (minimum - 0) - // PHY_PIB_TX_POWER_MAX (maximum - 0xbf) - if (isset($Command['TxPower']) ) { - cmdLog('debug', " TxPower", $this->debug['processCmd']); - $cmd = "0806"; - $data = $Command['TxPower']; - if ($data < 10 ) $data = '0'.$data; - // $length = sprintf("%04s", dechex(strlen($data) / 2)); - // $this->addCmdToQueue($priority, $dest, $cmd, $length, $data); - $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data); - return; - } + // // https://github.com/fairecasoimeme/ZiGate/issues/145 + // // PHY_PIB_TX_POWER_DEF (default - 0x80) + // // PHY_PIB_TX_POWER_MIN (minimum - 0) + // // PHY_PIB_TX_POWER_MAX (maximum - 0xbf) + // if (isset($Command['TxPower']) ) { // Obsolete !! Replaced by zgSetTxPower + // cmdLog('debug', " TxPower", $this->debug['processCmd']); + // $cmd = "0806"; + // $data = $Command['TxPower']; + // if ($data < 10 ) $data = '0'.$data; + + // // $length = sprintf("%04s", dechex(strlen($data) / 2)); + // // $this->addCmdToQueue($priority, $dest, $cmd, $length, $data); + // $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data); + // return; + // } if (isset($Command['setExtendedPANID'])) { cmdLog('debug', " setExtendedPANID", $this->debug['processCmd']); @@ -2019,54 +1902,6 @@ function processCmd($Command) { return; } - // ReadAttributeRequest ------------------------------------------------------------------------------------ - // http://zigate/zigate/sendCmd.php?address=83DF&ReadAttributeRequest=1&clusterId=0000&attributeId=0004 - // if (isset($Command['ReadAttributeRequest'])) { - // if (isset($Command['address']) && isset($Command['clusterId']) && isset($Command['attributeId']) && isset($Command['EP']) && isset($Command['Proprio'])) - // $this->readAttribute(PRIO_NORM, $dest, $Command['address'], $Command['EP'], $Command['clusterId'], $Command['attributeId'], $Command['Proprio'] ); - // else if ((isset($Command['ReadAttributeRequest'])) && (isset($Command['address'])) && isset($Command['clusterId']) && isset($Command['attributeId']) && isset($Command['EP'])) - // $this->readAttribute(PRIO_NORM, $dest, $Command['address'], $Command['EP'], $Command['clusterId'], $Command['attributeId']); - // return; - // } - - // if (isset($Command['readAttributeRequest'])) { - // $this->readAttribute(PRIO_NORM, $dest, $Command['addr'], $Command['ep'], $Command['clustId'], $Command['attrId']); - // return; - // } - - // ReadAttributeRequestMulti ------------------------------------------------------------------------------------ - // if ((isset($Command['ReadAttributeRequestMulti'])) && (isset($Command['address'])) && isset($Command['clusterId']) && isset($Command['attributeId'])) - // { - // $this->getParamMulti( $Command ); - // return; - // } - - // ReadAttributeRequest ------------------------------------------------------------------------------------ - // http://zigate/zigate/sendCmd.php?address=83DF&ReadAttributeRequest=1&clusterId=0000&attributeId=0004 - // if ((isset($Command['ReadAttributeRequestHue'])) && (isset($Command['address'])) && isset($Command['clusterId']) && isset($Command['attributeId'])) - // { - // // echo "ReadAttributeRequest pour address: ".$Command['address']."\n"; - // // if ($Command['ReadAttributeRequest']==1 ) - // //{ - // // $this->getParamHue( $priority, $dest, $Command['address'], $Command['clusterId'], $Command['attributeId'], "0B" ); - // $this->readAttribute($priority, $dest, $Command['address'], "0B", $Command['clusterId'], $Command['attributeId']); - // //} - // return; - // } - - // ReadAttributeRequest ------------------------------------------------------------------------------------ - // http://zigate/zigate/sendCmd.php?address=83DF&ReadAttributeRequest=1&clusterId=0000&attributeId=0004 - // if ((isset($Command['ReadAttributeRequestOSRAM'])) && (isset($Command['address'])) && isset($Command['clusterId']) && isset($Command['attributeId'])) - // { - // // echo "ReadAttributeRequest pour address: ".$Command['address']."\n"; - // // if ($Command['ReadAttributeRequest']==1 ) - // //{ - // // getParamOSRAM( $dest, $Command['address'], $Command['clusterId'], $Command['attributeId'], "01" ); - // $this->readAttribute($priority, $dest, $Command['address'], "03", $Command['clusterId'], $Command['attributeId']); - // //} - // return; - // } - // Tcharp38 note: This is badly named. It is not a write attribute but // most probably a cluster 0502 cmd 00 // OBSOLETE => Use 'cmd-0502' with 'cmd=00' instead @@ -2263,99 +2098,6 @@ function processCmd($Command) { return; } - // // ON / OFF with no effects - // if (isset($Command['onoff']) && isset($Command['addressMode']) && isset($Command['address']) && isset($Command['destinationEndpoint']) && isset($Command['action'])) - // { - // cmdLog('debug', ' OnOff for: '.$Command['address'].' action (0:Off, 1:On, 2:Toggle): '.$Command['action'], $this->debug['processCmd']); - // //
- // // - // // - // // - // // - // // Command Id - // // 0 - Off - // // 1 - On - // // 2 - Toggle - - // $zgCmd = "0092"; - - // $addrMode = $Command['addressMode']; // 01: Group, 02: device - // $address = $Command['address']; - // $srcEp = "01"; - // $dstEp = $Command['destinationEndpoint']; - // $action = $Command['action']; - - // $data = $addrMode.$address.$srcEp.$dstEp.$action; - // $length = sprintf("%04X", strlen($data) / 2); - - // $priority = $Command['priority']; - - // $this->addCmdToQueue2($priority, $dest, $zgCmd, $data, $address, $addrMode); - - // // if ($addrMode == "02" ) { - // // $this->publishMosquitto($abQueues['xToCmd']['id'], priorityInterrogation, "TempoCmd".$dest."/".$address."/readAttribute&time=".(time()+2), "ep=".$dstEp."&clustId=0006&attrId=0000" ); - // // $this->publishMosquitto($abQueues['xToCmd']['id'], priorityInterrogation, "TempoCmd".$dest."/".$address."/readAttribute&time=".(time()+3), "ep=".$dstEp."&clustId=0008&attrId=0000" ); - // // } - // return; - // } - - // // ON / OFF with no effects RAW with no APS ACK - // // Not used as some eq have a strange behavior if the APS ACK is not set (e.g. Xiaomi Plug / should probably test again / bug from the eq ?) - // if (isset($Command['onoffraw']) && isset($Command['addressMode']) && isset($Command['address']) && isset($Command['destinationEndpoint']) && isset($Command['action'])) - // { - // cmdLog('debug', " command setParam4", $this->debug['processCmd']); - - // $dest = $Command['dest']; - // $priority = $Command['priority']; - - // $cmd = "0530"; - - // //
-> 1 - // // -> 2 - // // -> 1 - // // -> 1 - - // // -> 2 - // // -> 2 - - // // -> 1 - // // -> 1 - // // -> 1 (22 -> 0x16) - - // // APS Part <= data - - // $addrMode = $Command['addressMode']; - // $addr = $Command['address']; - // $srcEp = "01"; - // if ($Command['destinationEndpoint']>1 ) { $dstEp = $Command['destinationEndpoint']; } else { $dstEp = "01"; } // $dstEp; // "01"; - - // $profId = "0104"; - // $clustId = "0006"; // $Command['clusterId']; - - // $secMode = "02"; // ??? - // $radius = "30"; - // // $dataLength <- calculated later - - // $frameControl = "11"; // Ici dans cette commande c est ZCL qu'on control - // $transqactionSequenceNumber = "1A"; // to be reviewed - // $commandWriteAttribute = $Command['action']; - - // $data2 = $frameControl.$transqactionSequenceNumber.$commandWriteAttribute; - // $dataLength = sprintf("%02s",dechex(strlen( $data2 )/2)); - // $data1 = $addrMode.$addr.$srcEp.$dstEp.$clustId.$profId.$secMode.$radius.$dataLength; - // $data = $data1.$data2; - - // $length = sprintf("%04s", dechex(strlen($data) / 2)); - - // // $this->addCmdToQueue($priority, $dest, $cmd, $length, $data, $addr); - // $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data, $addr); - - // if ($addrMode == "02" ) { - // $this->publishMosquitto( $abQueues["xToCmd"]['id'], priorityInterrogation, "TempoCmd".$dest."/".$addr."/ReadAttributeRequestMulti&time=".(time()+2), "EP=".$dstEp."&clusterId=0006&attributeId=0000" ); - // } - // return; - // } - // On / Off Timed Send if (isset($Command['OnOffTimed']) && isset($Command['addressMode']) && isset($Command['address']) && isset($Command['destinationEndpoint']) && isset($Command['action']) && isset($Command['onTime']) && isset($Command['offWaitTime'])) { @@ -2547,8 +2289,6 @@ function processCmd($Command) { $data = $address.$IEEE ; - // $length = sprintf("%04s", dechex(strlen($data) / 2)); - // $this->addCmdToQueue($priority, $dest, $cmd, $length, $data); $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data); return; } @@ -2580,7 +2320,6 @@ function processCmd($Command) { } else // Normal $modeVal = "00"; cmdLog('debug', " Setting mode ".$mode."/".$modeVal); - // $this->addCmdToQueue($priority, $dest, "0002", "0001", $modeVal); $this->addCmdToQueue2(PRIO_NORM, $dest, "0002", $modeVal); return; } @@ -2696,15 +2435,12 @@ function processCmd($Command) { WARNING: PHP time() is based on 1st of jan 1970 and NOT 2000 !! */ $cmd = "0016"; $data = sprintf("%08s", dechex($Command['time'])); - // $length = sprintf("%04s", dechex(strlen($data) / 2)); $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data); return; } // Zigate specific command else if ($cmdName == 'zgGetTimeServer') { - // $data = ""; - // $length = sprintf("%04s", dechex(strlen($data) / 2)); $this->addCmdToQueue2(PRIO_NORM, $dest, "0017"); return; } @@ -2719,6 +2455,21 @@ function processCmd($Command) { return; } + // Zigate specific command: Set TX power + // Mandatory params: 'txPower' (2B hexa string) + else if ($cmdName == 'zgSetTxPower') { + $required = ['txPower']; + if (!$this->checkRequiredParams($required, $Command)) + return; + + $zgCmd = "0806"; + $data = $Command['txPower']; + + cmdLog('debug', " zgSetTxPower: txPower=${data}"); + $this->addCmdToQueue2(PRIO_NORM, $dest, $zgCmd, $data); + return; + } + // Zigate specific command else if ($cmdName == 'zgStartNetwork') { $this->addCmdToQueue2(PRIO_NORM, $dest, "0024"); @@ -2810,13 +2561,13 @@ function processCmd($Command) { */ // Zigbee command: Mgmt_Lqi_req + // Mandatory: Expecting 2 parameters: 'addr' & 'startIndex' else if ($cmdName == 'getNeighborTable') { - /* Expecting 2 parameters: 'addr' & 'startIndex' */ $required = ['addr', 'startIndex']; if (!$this->checkRequiredParams($required, $Command)) return; - $cmd = "004E"; + $zgCmd = "004E"; // // @@ -2827,7 +2578,7 @@ function processCmd($Command) { $data = $addr.$startIndex ; // Note: 004E seems to be ACKed command. - $this->addCmdToQueue2(PRIO_NORM, $dest, $cmd, $data, $addr, "02"); + $this->addCmdToQueue2(PRIO_NORM, $dest, $zgCmd, $data, $addr, "02"); return; } @@ -2836,7 +2587,6 @@ function processCmd($Command) { // Mandatory params: 'addr' // Optional params: 'startIdx' (hex byte, default='00') else if ($cmdName == 'getRoutingTable') { - /* Checking that mandatory infos are there */ $required = ['addr']; if (!$this->checkRequiredParams($required, $Command)) return; diff --git a/core/config/AbeilleInternalCmds.json b/core/config/AbeilleInternalCmds.json index 9670a54eb6..05c88c3892 100644 --- a/core/config/AbeilleInternalCmds.json +++ b/core/config/AbeilleInternalCmds.json @@ -43,7 +43,6 @@ "abeilleList": {}, "setCertificationCE": {}, "setCertificationFCC": {}, - "TxPower": {}, "setExtendedPANID": {}, "bind": {}, "setReportRaw": {}, @@ -65,6 +64,7 @@ "zgSoftReset": {}, "zgSetTimeServer": {}, "zgGetTimeServer": {}, + "zgSetTxPower": {}, "zgGetTxPower": {}, "zgStartNetwork": {}, "zgSetLed": {}, diff --git a/core/config/devices/KiwiHC16_Test_01/KiwiHC16_Test_01.json b/core/config/devices/KiwiHC16_Test_01/KiwiHC16_Test_01.json deleted file mode 100755 index 166972c73b..0000000000 --- a/core/config/devices/KiwiHC16_Test_01/KiwiHC16_Test_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "KiwiHC16_Test_01": { - "timeout": "60", - "configuration": { - "mainEP": "01", - "icon": "defaultUnknown" - }, - "category": { - "light": "1" - }, - "type": "KiwiHC16_Test_01", - "commands": { - "etat": { - "use": "inf_zbAttr-0006-OnOff", - "isVisible": 1 - }, - "CurrentLevel-0008": { - "use": "inf_zbAttr-0008-CurrentLevel", - "isVisible": 1 - }, - "On": { - "use": "act_zbCmdC-0006-On", - "isVisible": 1 - }, - "Off": { - "use": "act_zbCmdC-0006-Off", - "isVisible": 1 - }, - "Set Level": { - "use": "act_setLevel-Light", - "isVisible": 1 - }, - "Get-Status": { - "use": "act_zbReadAttribute", - "params": "clustId=0006&attrId=0000" - }, - "Get-CurrentLevel": { - "use": "act_zbReadAttribute", - "params": "clustId=0008&attrId=0000" - }, - "Identify": { - "use": "act_zbCmdC-Identify", - "isVisible": 1 - }, - "Bind-0006-ToZigate": { - "use": "act_zbBindToZigate", - "params": "clustId=0006", - "execAtCreation": "Yes", - "execAtCreationDelay": 9 - }, - "Bind-0008-ToZigate": { - "use": "act_zbBindToZigate", - "params": "clustId=0008", - "execAtCreation": "Yes", - "execAtCreationDelay": 9 - }, - "SetReporting-0006-0000": { - "use": "act_zbConfigureReporting2", - "params": "clustId=0006&attrType=10&attrId=0000", - "execAtCreation": "Yes", - "execAtCreationDelay": 11 - }, - "SetReporting-0008-0000": { - "use": "act_zbConfigureReporting2", - "params": "clustId=0008&attrId=0000&attrType=20", - "execAtCreation": "Yes", - "execAtCreationDelay": 11 - }, - "Toggle": { - "use": "act_zbCmdC-0006-Toggle", - "nextLine": "after" - } - } - } -} \ No newline at end of file diff --git a/core/config/rucheCommand.json b/core/config/rucheCommand.json index 6704207996..0229423dbd 100755 --- a/core/config/rucheCommand.json +++ b/core/config/rucheCommand.json @@ -94,32 +94,6 @@ "invertBinary": "0", "template": "" }, - "Set inclusion mode": { - "name": "Set inclusion mode", - "comment": "Readded this function for case #2476", - "isHistorized": "0", - "isVisible": "1", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "zgSetPermitMode", - "request": "mode=start" - } - }, - "Get Inclusion Status": { - "name": "Get Inclusion Status", - "isHistorized": "0", - "isVisible": "0", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "permitJoin", - "request": "Status" - }, - "display": { - "forceReturnLineAfter": "1" - } - }, "permitJoin-Status": { "name": "Inclusion Status", "isHistorized": "0", @@ -277,17 +251,6 @@ "invertBinary": "0", "template": "" }, - "Network Status Request": { - "name": "Network Status Request (Not implemented)", - "isHistorized": "0", - "isVisible": "0", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "networkStatus", - "request": "Request" - } - }, "joinLeave-IEEE": { "name": "joinLeave", "isHistorized": "1", @@ -297,38 +260,6 @@ "invertBinary": "0", "template": "" }, - "Factory New Reset": { - "name": "Factory New Reset", - "isHistorized": "0", - "isVisible": "0", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "FactoryNewReset", - "request": "FactoryNewReset" - }, - "display": { - "forceReturnLineAfter": "1" - } - }, - "Network-Bind": { - "name": "Last Bind", - "isHistorized": "0", - "isVisible": "0", - "Type": "info", - "subType": "string", - "invertBinary": "0", - "template": "" - }, - "Network-Report": { - "name": "Last Report", - "isHistorized": "0", - "isVisible": "0", - "Type": "info", - "subType": "string", - "invertBinary": "0", - "template": "" - }, "Group-Membership": { "isVisible": 0, "name": "Groups", @@ -342,52 +273,8 @@ "visibilityCategory": "Network" } }, - "Set Power 0": { - "name": "Set Power (0dBm)", - "isHistorized": "0", - "isVisible": "0", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "TxPower", - "request": "00" - } - }, - "Set Power 9": { - "name": "Set Power (-9dBm)", - "isHistorized": "0", - "isVisible": "0", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "TxPower", - "request": "34" - } - }, - "Set Power 20": { - "name": "Set Power (-20dBm)", - "isHistorized": "0", - "isVisible": "0", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "TxPower", - "request": "28" - } - }, - "Set Power 32": { - "name": "Set Power (-32dBm)", - "isHistorized": "0", - "isVisible": "0", - "Type": "action", - "subType": "other", - "configuration": { - "topic": "TxPower", - "request": "20" - } - }, "ZiGate-Power": { - "name": "ZiGate-Power", + "name": "TX power", "isHistorized": "0", "isVisible": "0", "Type": "info", diff --git a/desktop/js/Abeille.js b/desktop/js/Abeille.js index 0d20b2182b..a711933658 100755 --- a/desktop/js/Abeille.js +++ b/desktop/js/Abeille.js @@ -1595,8 +1595,9 @@ function sendZigate(action, param) { payload = ""; break; case "setTXPower": - topic = "CmdAbeille" + zgId + "/0000/TxPower"; - payload = "ff"; // TODO + topic = "CmdAbeille" + zgId + "/0000/zgSetTxPower"; + var power = $("#idZgTxPower").val(); + payload = "txPower=" + power; // TODO break; case "getTime": topic = "CmdAbeille" + zgId + "/0000/zgGetTimeServer"; diff --git a/desktop/php/Abeille-Eq-Advanced-Zigate.php b/desktop/php/Abeille-Eq-Advanced-Zigate.php index 7b733ba986..576a0b83a3 100644 --- a/desktop/php/Abeille-Eq-Advanced-Zigate.php +++ b/desktop/php/Abeille-Eq-Advanced-Zigate.php @@ -130,8 +130,13 @@ function addZgButton($name, $class, $onclick, $onclick2 = "", $leftMargin = true
- + +
diff --git a/desktop/php/AbeilleFormAction.php b/desktop/php/AbeilleFormAction.php index 578be8742b..765df9044c 100755 --- a/desktop/php/AbeilleFormAction.php +++ b/desktop/php/AbeilleFormAction.php @@ -149,38 +149,6 @@ function sendMessageFromFormToCmd($topic, $payload) { } break; } - - // // TX Power - // foreach ( $zigateIds as $zigateId ) { - // if ( $_POST['submitButton'] == 'TxPower Z'.$zigateId ) { - // echo "TxPower request processing"; - // sendMessageFromFormToCmd('CmdAbeille'.$zigateId.'/0000/TxPower', $_POST['TxPowerValue'] ); - // } - // } - - // // Set Extended PANID - // foreach ( $zigateIds as $zigateId ) { - // if ( $_POST['submitButton'] == 'Set Extended PANID Z'.$zigateId ) { - // echo "Set Extended PANID request processing"; - // sendMessageFromFormToCmd('CmdAbeille'.$zigateId.'/0000/setExtendedPANID', $_POST['extendedPanId'] ); - // } - // } - - // // Set Certification CE - // foreach ( $zigateIds as $zigateId ) { - // if ( $_POST['submitButton'] == 'Set Certification CE Z'.$zigateId ) { - // echo "Set Certification CE"; - // sendMessageFromFormToCmd('CmdAbeille'.$zigateId.'/0000/setCertificationCE', ""); - // } - // } - - // // Set Certification FCC - // foreach ( $zigateIds as $zigateId ) { - // if ( $_POST['submitButton'] == 'Set Certification FCC Z'.$zigateId ) { - // echo "Set Certification FCC"; - // sendMessageFromFormToCmd('CmdAbeille'.$zigateId.'/0000/setCertificationFCC', ""); - // } - // } } catch (Exception $e) { echo '
error: '.$e->getMessage(); } diff --git a/docs/fr_FR/Changelog.md b/docs/fr_FR/Changelog.md index b1459cad0d..fad02748fc 100644 --- a/docs/fr_FR/Changelog.md +++ b/docs/fr_FR/Changelog.md @@ -24,7 +24,9 @@ - Support multi-passerelles: Des tas de modifs internes. - Interne: Cmd: Mise-à-jour 'getBindingTable()' (suppression champ 'address') -- Dépendance nécessaire: Ajout 'pyserial'. +- Dépendances nécessaires: Ajout 'pyserial'. +- Interne: Cmd: 'TxPower' => 'zgSetTxPower' +- Zigate/avancé: Ajout controle puissance TX. ## 240501-STABLE-1