Logger Hinzugefügt
Logger korrigiert
This commit is contained in:
@@ -14,29 +14,29 @@ class Belevo_Server_Kommunikation extends IPSModule
|
|||||||
$this->RegisterPropertyInteger("Netzbezug", 0);
|
$this->RegisterPropertyInteger("Netzbezug", 0);
|
||||||
/*//Boilerstatus
|
/*//Boilerstatus
|
||||||
$this->RegisterPropertyInteger("G_BS_5M_0", 0);
|
$this->RegisterPropertyInteger("G_BS_5M_0", 0);
|
||||||
$this->RegisterVariableInteger("Boilerstatus", 0);
|
$this->RegisterPropertyInteger("Boilerstatus", 0);
|
||||||
//Boilertemperatur
|
//Boilertemperatur
|
||||||
$this->RegisterPropertyFloat("G_BT_5M_0",0); // Wird an Influx Server gesendet
|
$this->RegisterPropertyFloat("G_BT_5M_0",0); // Wird an Influx Server gesendet
|
||||||
$this->RegisterVariableFloat("Boilertemperatur", 0); // Ist, Jetzige Boilertemperatur
|
$this->RegisterPropertyInteger("Boilertemperatur", 0); // Ist, Jetzige Boilertemperatur
|
||||||
//Schaltkontake des Boilers
|
//Schaltkontake des Boilers
|
||||||
$this->RegisterPropertyInteger("G_SK_5M_1",0);
|
$this->RegisterPropertyInteger("G_SK_5M_1",0);
|
||||||
$this->RegisterVariableInteger("Schaltkontakt_1", 0);
|
$this->RegisterPropertyInteger("Schaltkontakt_1", 0);
|
||||||
$this->RegisterPropertyInteger("G_SK_5M_2",0);
|
$this->RegisterPropertyInteger("G_SK_5M_2",0);
|
||||||
$this->RegisterVariableInteger("Schaltkontakt_2", 0);
|
$this->RegisterPropertyInteger("Schaltkontakt_2", 0);
|
||||||
//Schaltkontake des Boilers
|
//Schaltkontake des Boilers
|
||||||
$this->RegisterPropertyInteger("G_SK_5M_3",0);
|
$this->RegisterPropertyInteger("G_SK_5M_3",0);
|
||||||
$this->RegisterVariableInteger("Kontakt_Teillast", 0);
|
$this->RegisterPropertyInteger("Kontakt_Teillast", 0);
|
||||||
$this->RegisterPropertyInteger("G_SK_5M_4",0);
|
$this->RegisterPropertyInteger("G_SK_5M_4",0);
|
||||||
$this->RegisterVariableInteger("Kontakt_Volllast", 0);
|
$this->RegisterPropertyInteger("Kontakt_Volllast", 0);
|
||||||
//Wärmepumpe Status
|
//Wärmepumpe Status
|
||||||
$this->RegisterPropertyFloat("G_WPS_5M_0",0);
|
$this->RegisterPropertyFloat("G_WPS_5M_0",0);
|
||||||
$this->RegisterVariableInteger("Waermepumpe_Status", 0);
|
$this->RegisterPropertyInteger("Waermepumpe_Status", 0);
|
||||||
//Wolkenwahrscheinlichkeit
|
//Wolkenwahrscheinlichkeit
|
||||||
$this->RegisterPropertyFloat("G_WW_5M_0",0);
|
$this->RegisterPropertyFloat("G_WW_5M_0",0);
|
||||||
$this->RegisterVariableInteger("Wolkenwahrscheinlichkeit", 0);
|
$this->RegisterPropertyInteger("Wolkenwahrscheinlichkeit", 0);
|
||||||
//Aussentemperatur
|
//Aussentemperatur
|
||||||
$this->RegisterPropertyFloat("G_AT_5M_0",0);
|
$this->RegisterPropertyFloat("G_AT_5M_0",0);
|
||||||
$this->RegisterVariableInteger("Aussentemperatur", 0);
|
$this->RegisterPropertyInteger("Aussentemperatur", 0);
|
||||||
*/
|
*/
|
||||||
$this->RegisterPropertyString("BaseURL","https://brain.belevo.ch/status?nr=");
|
$this->RegisterPropertyString("BaseURL","https://brain.belevo.ch/status?nr=");
|
||||||
$this->RegisterPropertyString("Anlagenummer",0);
|
$this->RegisterPropertyString("Anlagenummer",0);
|
||||||
@@ -83,8 +83,8 @@ class Belevo_Server_Kommunikation extends IPSModule
|
|||||||
if (!empty($anlagenummer) && !empty($json)) {
|
if (!empty($anlagenummer) && !empty($json)) {
|
||||||
// Kombiniere die URL mit der Anlagenummer
|
// Kombiniere die URL mit der Anlagenummer
|
||||||
$fullURL = $baseURL . $anlagenummer;
|
$fullURL = $baseURL . $anlagenummer;
|
||||||
IPS_LogMessage("Belevo_Server_Kommunikation", "URL: $fullURL");
|
IPS_LogMessage("Belevo_Server_Kommunikation", "URL: ".$fullURL);
|
||||||
IPS_LogMessage("Belevo_Server_Kommunikation", "JSON: $json");
|
IPS_LogMessage("Belevo_Server_Kommunikation", "JSON: " . $json);
|
||||||
$this->SendJsonToInfluxDB($fullURL, $json);
|
$this->SendJsonToInfluxDB($fullURL, $json);
|
||||||
} else {
|
} else {
|
||||||
IPS_LogMessage("Belevo_Server_Kommunikation", "Keine Aufzeichnung im Influx: Anlagenummer oder JSON-Daten fehlen->GetAction()");
|
IPS_LogMessage("Belevo_Server_Kommunikation", "Keine Aufzeichnung im Influx: Anlagenummer oder JSON-Daten fehlen->GetAction()");
|
||||||
@@ -134,6 +134,9 @@ return $json;
|
|||||||
IPS_LogMessage("Belevo_Server_Kommunikation", "InfluxDB-Token fehlt->SendJsonToInfluxDB");
|
IPS_LogMessage("Belevo_Server_Kommunikation", "InfluxDB-Token fehlt->SendJsonToInfluxDB");
|
||||||
return;
|
return;
|
||||||
}*/ /*
|
}*/ /*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
"Content-Type: application/json",
|
"Content-Type: application/json",
|
||||||
//"Authorization: Bearer $token" // Wenn der Token gebraucht wird, füge ihn hier hinzu
|
//"Authorization: Bearer $token" // Wenn der Token gebraucht wird, füge ihn hier hinzu
|
||||||
@@ -147,15 +150,19 @@ return $json;
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Content-Type: application/json\r\n".
|
'header' => "Content-Type: application/json\r\n".
|
||||||
"daten: $json".
|
"daten: " . $json . "\r\n".
|
||||||
"id: test\r\n",
|
"id: test\r\n",
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
IPS_LogMessage("Belevo_Server_Kommunikation", "OPtions: " . $options);
|
||||||
$context = stream_context_create($options);
|
$context = stream_context_create($options);
|
||||||
|
|
||||||
$result = file_get_contents($url, false, $context);
|
$result = file_get_contents($url, false, $context);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"compatibility": {
|
"compatibility": {
|
||||||
"version": "7.1"
|
"version": "7.1"
|
||||||
},
|
},
|
||||||
"version": "0.44",
|
"version": "0.45",
|
||||||
"build": 0,
|
"build": 0,
|
||||||
"date": 0
|
"date": 0
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user