SJAMS
1
Bonjour,
j’ai besoin de votre aide , je dois utilisre l’API STUDER
https://api.studer-innotec.com/swagger/ui/index#!/
j’ai tenté d’utiliser le plugin script mais ca ne fonctionne pas => mais ne retourne pas le JSON
{
"status": "string",
"uIntValue": 0,
"floatValue": 100
}
Merci pour votre aide.
SJAMS
2
du coup je ne suis pas passer par script JSON mais par un script
<?php
//recuperation des paramètres
$idInfoJeedom = $argv[1];
$deviceStuder = $argv[2];
$infoParam = $argv[3];
$ch = curl_init();
//DECLARATION DES VARIABLES JEEDOM
$ip_jeedom = "monJeedom.eu.jeedom.link"; //A modifier
$apikeyJeedom = "mon API KEY"; //voir le plugin_Virtuel A modifier
//Utilisation API STUDER
curl_setopt($ch, CURLOPT_URL, 'https://api.studer-innotec.com/api/v1/installation/user-info/idInstallation?device='.$deviceStuder.'&infoId='.$infoParam);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$headers = array();
$headers[] = 'Accept: text/json';
$headers[] = 'PHASH: motDePasseMD5'; // A modifier
$headers[] = 'UHASH: UserSHA256';//Amodidier
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = json_decode(curl_exec($ch));
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}else{
$varLectureValeur = $result->{'floatValue'};
echo $varLectureValeur;
}
curl_close($ch);
//ON DEFINI LES URLS POUR CHAQUE VARIABLE
$url1= 'https://'.$ip_jeedom.'/core/api/jeeApi.php?plugin=virtual&apikey='.$apikeyJeedom.'&type=event&id='.$idInfoJeedom.'&value='.$varLectureValeur;
?>
system
A fermé ce sujet ()
3
Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.