예제 #1
0
 /**
  *getjeedomrooms. Retreive Rooms for Jeedom
  *@returnstringJsonformattedsysteminformations.
  */
 public function getjeedomrooms()
 {
     include_once 'jsonrpcClient.class.php';
     $jeedomrooms = array();
     $jsonrpc = new jsonrpcClient(Config::get('jeedom.jeedom_url'), Config::get('jeedom.api_key'));
     if ($jsonrpc->sendRequest('object::all', array())) {
         $jeedomrooms['result'] = $jsonrpc->getResult();
         return $jeedomrooms;
     } else {
         echo $jsonrpc->getError();
     }
 }
예제 #2
0
<?php

$URL_JEEDOM = "http://adresse IP du raspberry/jeedom";
$API_KEY = "cle API";
require 'jsonrpcClient.class.php';
// recherche mot cle JEEDOM
//if (strncmp($argv[1],"JEEDOM ",7)==0) {
$jsonrpc = new jsonrpcClient($URL_JEEDOM . '/core/api/jeeApi.php', $API_KEY);
$message = substr($argv[1], 7);
if ($jsonrpc->sendRequest('interact::tryToReply', array('query' => $message))) {
    print_r($jsonrpc->getResult());
} else {
    echo $jsonrpc->getError();
}
//} else {
//   echo "-1";
//}