ALors y'a eu du mieux mais je n'avais toujours pas les infos et il était indiqué :
HTTP/1.1 401 Unauthorized
Donc a priori il y avait encore un problème d'autorisation
J'ai donc essayé de regarder où ça pouvait poser souci dans mes paramètres.
J'avais le mot de passe (généré par mon gestionnaire de mots de passe) suivant : lS7(jz+0sm2P]hR
Je me suis dit que les caractères spéciaux pouvaient peut-être poser souci dans la définition du mot de passe
$password = 'lS7(jz+0sm2P]hR';
J'ai donc remplacé par un mot de passe simple sur le site et dans mon script et là...
...miracle !!! Ca fonctionne !
Je récupère toutes les infos :
-------------------------------------------------------------------------------------------------
pi@raspberrypi:~/domoticz/scripts/Php $ php testrika.php
2016-11-27 06:49:54
string(453) "HTTP/1.1 302 Found
Server: Cowboy
Connection: keep-alive
X-Powered-By: Express
Location: /web/summary
Vary: Accept, Accept-Encoding
Content-Type: text/plain; charset=utf-8
Content-Length: 34
Set-Cookie: connect.sid=s%3AXL6HqKQjte8VaHxttTUsPhh6B8o1JrV6.uRg0e0Gi%2FTME94fOMmELUWrou9MIyF2cEC1xELf8okU; Path=/; Expires=Sun, 11 Dec 2016 06:49:54 GMT; HttpOnly
Date: Sun, 27 Nov 2016 06:49:54 GMT
Via: 1.1 vegur
Found. Redirecting to /web/summary"
* Hostname was found in DNS cache
* Trying 46.51.171.127...
* Connected to
http://www.rika-firenet.com (46.51.171.127) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
* subject: CN=*.rika-firenet.com
* start date: 2015-12-28 09:23:24 GMT
* expire date: 2018-12-30 02:20:25 GMT
* subjectAltName:
http://www.rika-firenet.com matched
* issuer: C=US; O=GeoTrust Inc.; CN=RapidSSL SHA256 CA - G3
* SSL certificate verify ok.
> GET /api/client/26234636/status?nocache= HTTP/1.1
Host:
http://www.rika-firenet.com
Accept: */*
Cookie: connect.sid=s:XL6HqKQjte8VaHxttTUsPhh6B8o1JrV6.uRg0e0Gi/TME94fOMmELUWrou9MIyF2cEC1xELf8okU
< HTTP/1.1 200 OK
* Server Cowboy is not blacklisted
< Server: Cowboy
< Connection: keep-alive
< X-Powered-By: Express
< Content-Type: application/json; charset=utf-8
< Content-Length: 1084
< Etag: W/"43c-ebzoiu/13ttn2+oQOsdV8A"
< Vary: Accept-Encoding
< Date: Sun, 27 Nov 2016 06:49:55 GMT
< Via: 1.1 vegur
<
* Connection #0 to host
http://www.rika-firenet.com left intact
array(7) {
["name"]=>
string(12) "Poêle salon"
["stoveID"]=>
string(8) "26234636"
["lastSeenMinutes"]=>
int(0)
["lastConfirmedRevision"]=>
int(1480197954)
["controls"]=>
array(16) {
["revision"]=>
int(1480197954)
["onOff"]=>
bool(true)
["operatingMode"]=>
int(2)
["heatingPower"]=>
int(50)
["targetTemperature"]=>
int(20)
["heatingTimesActive"]=>
bool(false)
["heatingTimesActiveForComfort"]=>
bool(true)
["setBackTemperature"]=>
int(12)
["convectionFan1Active"]=>
bool(true)
["convectionFan1Level"]=>
int(5)
["convectionFan1Area"]=>
int(0)
["convectionFan2Active"]=>
bool(false)
["convectionFan2Level"]=>
int(0)
["convectionFan2Area"]=>
int(0)
["frostProtectionActive"]=>
bool(false)
["frostProtectionTemperature"]=>
int(4)
}
["sensors"]=>
array(22) {
["statusError"]=>
int(0)
["statusWarning"]=>
int(0)
["statusService"]=>
int(0)
["statusMainState"]=>
int(3)
["statusSubState"]=>
int(2)
["statusFrostStarted"]=>
bool(false)
["inputFlameTemperature"]=>
int(326)
["inputRoomTemperature"]=>
int(20)
["inputExternalRequest"]=>
bool(true)
["outputDischargeMotor"]=>
int(0)
["outputInsertionMotor"]=>
int(0)
["outputIDFan"]=>
int(1400)
["outputAirFlaps"]=>
int(0)
["outputIgnition"]=>
bool(false)
["parameterStoveTypeNumber"]=>
int(4)
["parameterVersionMainBoard"]=>
int(216)
["parameterVersionTFT"]=>
int(216)
["parameterRuntimePellets"]=>
int(164)
["parameterRuntimeLogs"]=>
int(0)
["parameterFeedRateTotal"]=>
int(165)
["parameterFeedRateService"]=>
int(535)
["parameterOnOffCycles"]=>
int(11)
}
["stoveType"]=>
string(13) "ROCO MultiAir"
}
------------------------------------------------------------------------
Et ton script initial a marché du premier coup en me renvoyant les infos suivantes :
----------------------------------------------------------------------
pi@raspberrypi:~/domoticz/scripts/Php $ php rika.php
<br />
unix Time : 1480229506 <br />
<br />
Now Phase 1 ! <br />
https://www.rika-firenet.com/web/login email=
vincent.zemb@free.fr&password=zvdk0612 Data received phase 1 : Found. Redirecting to /web/summary
<br />
<br />
Now Phase 2 ! <br />
Data received phase 2 : 1
<br />
<br />
Démarrage de Chauff. du Poéle <br />
<br />
Temperature bureau : 20 ° <br />
Temp_Consigne : 20 ° <br />
Conso Pelet Total : -1897 Kg <br />
Reste avant Entretien : 535 Kg <br />
<br />
<br />
Now Phase 3 ! <br />
Logout ! <br />
<br />
<br />
Now Send Data ! <br />
Temp Consigne : 20 <br />
Bureau : 20 <br />
Av entretien : 535 <br />
Conso Tot : -1897pi@raspberrypi:~/domoticz/scripts/Php $
----------------------------------------------------------------------
Merci beaucoup !
Il me reste plus qu'à récupérer ces valeurs dans des variables Domoticz...
...comment est-ce que tu procèdes pour les transmettre ?
Très bonne journée et encore un grand merci !!!