From 0bc0f61dc7003fb8e67ea3f90697260e2d87971e Mon Sep 17 00:00:00 2001 From: "belevo\\mh" Date: Tue, 5 Nov 2024 10:58:19 +0100 Subject: [PATCH] http vergessen --- Belevo_Server_Kommunikation/module.php | 52 +------------------------- library.json | 2 +- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/Belevo_Server_Kommunikation/module.php b/Belevo_Server_Kommunikation/module.php index 3af2272..76a8f28 100644 --- a/Belevo_Server_Kommunikation/module.php +++ b/Belevo_Server_Kommunikation/module.php @@ -39,7 +39,7 @@ class Belevo_Server_Kommunikation extends IPSModule $this->RegisterPropertyInteger("Aussentemperatur", 0); */ //$this->RegisterPropertyString("BaseURL","https://brain.belevo.ch/status?nr="); - $this->RegisterPropertyString("BaseURL","192.168.20.140:5000/influx?nr="); + $this->RegisterPropertyString("BaseURL","http://192.168.20.140:5000/influx?nr="); $this->RegisterPropertyString("Anlagenummer",0); $this->RegisterPropertyBoolean("InfluxJaNein", false); @@ -94,26 +94,8 @@ class Belevo_Server_Kommunikation extends IPSModule } -/* -public function GetAction() { - $netzbezug = GetValue($this->ReadPropertyInteger("Netzbezug")); - $url = "http://192.168.20.140:5000/influx?id=test&E_PNB_5M_0=".$netzbezug; - IPS_LogMessage("Belevo_Server_Kommunikation", "Sende Anfrage an URL: ".$url); - $this->SendJsonToInfluxDB($url); -}*/ - - public function MakeJson() { -/* -$boilertemperatur = $this->GetValue("Boilertemperatur"); -$this->SetValue("G_BT_5M_0", $boilertemperatur); -$kontaktTeillast = $this->GetValue("Kontakt_Teillast"); -$this->SetValue("G_SK_5M_3", $kontaktTeillast); - -$kontaktVolllast = $this->GetValue("Kontakt_Volllast"); -$this->SetValue("G_SK_5M_4", $kontaktVolllast); -*/ $netzbezug = GetValue($this->ReadPropertyInteger("Netzbezug")); $an_nummer = GetProperty($this->ReadPropertyString("Anlagenummer");) $InfluxJaNein = $this->ReadPropertyBoolean("InfluxJaNein"); @@ -129,9 +111,6 @@ $influxData = array( "Parameter" => array($an_nummer ), "Tracker" =array( - //"G_BT_5M_0" => $this->GetValue("G_BT_5M_0"), - //"G_SK_5M_3" => $this->GetValue("G_SK_5M_3"), - //"G_SK_5M_4" => $this->GetValue("G_SK_5M_4"), "E_PNB_5M_0" => $netzbezug ) ); @@ -144,36 +123,7 @@ return $json; } -/* - private function SendJsonToInfluxDB($url, $json) -{ - // Header für die Anfrage definieren - $headers = [ - "Content-Type: application/json", - "id: test" // Die ID, die vom Flask-Server überprüft wird - ]; - // Optionen für den HTTP-Request definieren - $options = [ - 'http' => [ - 'header' => implode("\r\n", $headers), - 'method' => 'POST', - 'content' => $json // JSON-Inhalt im Body der Anfrage - ], - ]; - IPS_LogMessage("Belevo_Server_Kommunikation", "Options: " . print_r($options, true)); - $context = stream_context_create($options); - - $result = file_get_contents($url, false, $context); - IPS_LogMessage("Belevo_Server_Kommunikation", "Result: " . print_r($result , true)); - if ($result === FALSE) { - - IPS_LogMessage("Belevo_Server_Kommunikation", "Fehler beim senden an Influx->SendJsonToInfluxDB()"); - } else { - IPS_LogMessage("Belevo_Server_Kommunikation", "Daten erfolgreich an Influx gesendet->SendJsonToInfluxDB()"); - } -} -*/ private function SendJsonToInfluxDB($url, $jsonData) { // cURL Initialisieren $curl = curl_init(); diff --git a/library.json b/library.json index 3604747..6685399 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "0.66", + "version": "0.67", "build": 0, "date": 0 } \ No newline at end of file