womögliche Influx Server behoben

This commit is contained in:
belevo\mh
2024-10-16 08:52:55 +02:00
parent 4067678f6b
commit fc9b77bbb7
2 changed files with 13 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ $netzbezug = GetValue($this->ReadPropertyInteger("Netzbezug"));
// Werte in ein Array packen
$data = [
"measurement" => $this->ReadPropertyString("Anlagenummer"),
"measurement" => GetValue($this->ReadPropertyString("Anlagenummer")),
"field" =>[
//"G_BT_5M_0" => $this->GetValue("G_BT_5M_0"),
//"G_SK_5M_3" => $this->GetValue("G_SK_5M_3"),
@@ -131,7 +131,7 @@ return $json;
if (empty($token)) {
IPS_LogMessage("Belevo_Server_Kommunikation", "InfluxDB-Token fehlt->SendJsonToInfluxDB");
return;
}*/
}*/ /*
$headers = [
"Content-Type: application/json",
//"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
],
];
*/
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n".
"daten: $json".
"id: test\r\n",
'method' => 'POST',
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);

View File

@@ -6,7 +6,7 @@
"compatibility": {
"version": "7.1"
},
"version": "0.39",
"version": "0.40",
"build": 0,
"date": 0
}