womögliche Influx Server behoben
This commit is contained in:
@@ -106,7 +106,7 @@ $netzbezug = GetValue($this->ReadPropertyInteger("Netzbezug"));
|
|||||||
|
|
||||||
// Werte in ein Array packen
|
// Werte in ein Array packen
|
||||||
$data = [
|
$data = [
|
||||||
"measurement" => $this->ReadPropertyString("Anlagenummer"),
|
"measurement" => GetValue($this->ReadPropertyString("Anlagenummer")),
|
||||||
"field" =>[
|
"field" =>[
|
||||||
//"G_BT_5M_0" => $this->GetValue("G_BT_5M_0"),
|
//"G_BT_5M_0" => $this->GetValue("G_BT_5M_0"),
|
||||||
//"G_SK_5M_3" => $this->GetValue("G_SK_5M_3"),
|
//"G_SK_5M_3" => $this->GetValue("G_SK_5M_3"),
|
||||||
@@ -131,7 +131,7 @@ return $json;
|
|||||||
if (empty($token)) {
|
if (empty($token)) {
|
||||||
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
|
||||||
@@ -144,6 +144,16 @@ return $json;
|
|||||||
'content' => $json, // Hier wird das JSON im Body gesendet
|
'content' => $json, // Hier wird das JSON im Body gesendet
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
*/
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json\r\n".
|
||||||
|
"daten: $json".
|
||||||
|
"id: test\r\n",
|
||||||
|
'method' => 'POST',
|
||||||
|
|
||||||
|
],
|
||||||
|
];
|
||||||
$context = stream_context_create($options);
|
$context = stream_context_create($options);
|
||||||
$result = file_get_contents($url, false, $context);
|
$result = file_get_contents($url, false, $context);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"compatibility": {
|
"compatibility": {
|
||||||
"version": "7.1"
|
"version": "7.1"
|
||||||
},
|
},
|
||||||
"version": "0.39",
|
"version": "0.40",
|
||||||
"build": 0,
|
"build": 0,
|
||||||
"date": 0
|
"date": 0
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user