From e063ab254902e57ff80c051462f6a13d135b9c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fliger?= Date: Fri, 8 Nov 2024 15:34:10 +0100 Subject: [PATCH] =?UTF-8?q?anderer=20Name=20und=20einen=20gel=C3=B6scht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WP/module.json | 12 -- WP/module.php | 255 ------------------------------ WP_N/README.md | 67 -------- WP_N/form.json | 52 ------ WP_N/locale.json | 8 - {WP => WP_Standart}/README.md | 0 {WP => WP_Standart}/form.json | 0 {WP => WP_Standart}/locale.json | 0 {WP_N => WP_Standart}/module.json | 2 +- {WP_N => WP_Standart}/module.php | 4 +- 10 files changed, 3 insertions(+), 397 deletions(-) delete mode 100644 WP/module.json delete mode 100644 WP/module.php delete mode 100644 WP_N/README.md delete mode 100644 WP_N/form.json delete mode 100644 WP_N/locale.json rename {WP => WP_Standart}/README.md (100%) rename {WP => WP_Standart}/form.json (100%) rename {WP => WP_Standart}/locale.json (100%) rename {WP_N => WP_Standart}/module.json (91%) rename {WP_N => WP_Standart}/module.php (99%) diff --git a/WP/module.json b/WP/module.json deleted file mode 100644 index e07c7b2..0000000 --- a/WP/module.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "{78E6FF18-7571-6846-452C-E822B58A91DA}", - "name": "WP", - "type": 3, - "vendor": "Belevo AG", - "aliases": [], - "parentRequirements": [], - "childRequirements": [], - "implemented": [], - "prefix": "GEF", - "url": "" -} \ No newline at end of file diff --git a/WP/module.php b/WP/module.php deleted file mode 100644 index 18bfdd9..0000000 --- a/WP/module.php +++ /dev/null @@ -1,255 +0,0 @@ -RegisterVariableInteger("LockPrio", "LockPrio"); - $this->RegisterVariableInteger("UserPrio", "UserPrio"); - - // Energiehandling - $this->RegisterVariableBoolean("Idle", "Idle", "", true); - $this->RegisterVariableInteger("CurrentPower", "CurrentPower", "", 0); - $this->RegisterVariableFloat("UsedEnergy", "UsedEnergy", "", 0); - $this->RegisterVariableString("PowerSteps", "PowerSteps"); // PowerSteps-Variable registrieren - - // Trägheit - $this->RegisterPropertyInteger("IdleCounterMax", 4); - $this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0); - $this->SetValue("IdleCounter", 0); - - $this->RegisterVariableInteger("Mindestlaufzeit", "IdleCounter", "", 0); - - $this->RegisterVariableInteger("Zustand_WP", "Zustand_WP", "", 0); - - $this->RegisterVariableInteger("WP_Laufzeit_Zahler", "WP_Laufzeit_Zahler", "", 20*12); - $this->RegisterVariableBoolean("LetzterPeakwert", "LetzterPeakwert", "", false); - - - - - $this->RegisterPropertyInteger("WP_Leistung", 6000); - $this->RegisterPropertyInteger("Wolkenschwellwert", 60); - $this->RegisterPropertyInteger("Wolkenwert", 0); - $this->RegisterPropertyInteger("Aussentemperatur", 0); - $this->RegisterPropertyInteger("Referenzzeit", 0); - $this->RegisterPropertyInteger("Sperrkontakt", 0); - $this->RegisterPropertyInteger("Kontakt_Erhoeung", 0); - - //Initialisieren - $this->SetValue("Idle", true); - } - - public function ApplyChanges() { - parent::ApplyChanges(); - } - - // Aktionen verarbeiten - public function RequestAction($Ident, $Value) { - switch ($Ident) { - case "SetCurrentPower": - $this->SetCurrentPower($Value); - break; - case "GetCurrentData": - return $this->GetCurrentData($Value); - break; - case "ResetPowerSteps": - $this->ResetPowerSteps($Value); - break; - default: - throw new Exception("Invalid Ident"); - } - } - - - - - // Methode zum Setzen des aktuellen Stromverbrauchs - public function SetCurrentPower(float $power) { - - $sperrzei_abs = 60*60*(GetValue($this->ReadPropertyInteger("Aussentemperatur"))+10)/35*60; - if($sperrzei_abs>6*60*60){ - $sperrzei_abs = 6*60*60; - - } - if(GetValue($this->ReadPropertyInteger("Wolkenschwellwert"))ReadPropertyInteger("Wolkenwert")) || $sperrzei_abs < 0 ){ - $sperrzei_abs = 0; - - } - $sperrzeit = GetValue($this->ReadPropertyInteger("Referenzzeit"))%86400 - $sperrzei_abs; - $entsperrzeit = GetValue($this->ReadPropertyInteger("Referenzzeit"))%86400; - $aktuellezeit = time()%86400; - - $its_lock_time = false; - if($aktuellezeit > $sperrzeit && $aktuellezeit < $entsperrzeit){ - $its_lock_time = true; - } - $timestamp = time(); - - $this->CheckIdle($power); - - if($this->GetValue("CurrentPower")!=$power){ - $this->SetValue("WP_Laufzeit_Zahler", 0) - - $LastPeak = $this->GetValue("LetzterPeakwert"); - - $state = $this->GetValue("Zustand_WP"); - - if($state == 0){ - - $this->SetValue("Zustand_WP", 1); - SetValue($this->ReadPropertyInteger("Sperrkontakt"), false); - SetValue($this->ReadPropertyInteger("Kontakt_Erhoeung"), false); - - }elseif($state == 1) // Normalbetrieb - { - if($LastPeak && $power == $this->GetValue("WP_Leistung")) { - $this->SetValue("Zustand_WP", 1); - if($its_lock_time){ - $this->SetValue("Zustand_WP", 2); - } - } elseif($LastPeak && $power == 0){ - $this->SetValue("Zustand_WP", 2); - - } - elseif($LastPeak == false && $power == $this->GetValue("WP_Leistung")){ - $this->SetValue("Zustand_WP", 3); - - } - elseif($LastPeak == false && $power == 0){ - $this->SetValue("Zustand_WP", 1); - if($its_lock_time){ - $this->SetValue("Zustand_WP", 2); - } - - } - - }elseif($state == 2) // Sperre - { - if($LastPeak && $power == $this->GetValue("WP_Leistung")) { - $this->SetValue("Zustand_WP", 1); - if($its_lock_time){ - $this->SetValue("Zustand_WP", 2); - } - } elseif($LastPeak && $power == 0){ - $this->SetValue("Zustand_WP", 2); - - } - elseif($LastPeak == false && $power == $this->GetValue("WP_Leistung")){ - $this->SetValue("Zustand_WP", 3); - - } - elseif($LastPeak == false && $power == 0){ - $this->SetValue("Zustand_WP", 1); - if($its_lock_time){ - $this->SetValue("Zustand_WP", 2); - } - - } - - }elseif($state == 3) // Erhöht - { - if($LastPeak && $power == $this->GetValue("WP_Leistung")) { - $this->SetValue("Zustand_WP", 1); - } elseif($LastPeak && $power == 0){ - $this->SetValue("Zustand_WP", 2); - - } - elseif($LastPeak == false && $power == $this->GetValue("WP_Leistung")){ - $this->SetValue("Zustand_WP", 3); - - } - elseif($LastPeak == false && $power == 0){ - $this->SetValue("Zustand_WP", 1); - - } - - } - else{ - $this->SetValue("Zustand_WP", 1); - $this->SetValue("PowerSteps", json_encode([0])); - } - - $newState = $this->GetValue("Zustand_WP"); - - if($newState == 0){ - - SetValue($this->ReadPropertyInteger("Sperrkontakt"), false); - SetValue($this->ReadPropertyInteger("Kontakt_Erhoeung"), false); - - }elseif($newState == 1){ - - SetValue($this->ReadPropertyInteger("Sperrkontakt"), false); - SetValue($this->ReadPropertyInteger("Kontakt_Erhoeung"), false); - - }elseif($newState == 2){ - - SetValue($this->ReadPropertyInteger("Sperrkontakt"), true); - SetValue($this->ReadPropertyInteger("Kontakt_Erhoeung"), false); - - }elseif($newState == 3){ - - SetValue($this->ReadPropertyInteger("Sperrkontakt"), false); - SetValue($this->ReadPropertyInteger("Kontakt_Erhoeung"), true); - - }else{ - - SetValue($this->ReadPropertyInteger("Sperrkontakt"), false); - SetValue($this->ReadPropertyInteger("Kontakt_Erhoeung"), false); - - } - - }else{ - break; - $newCount = $this->GetValue("WP_Laufzeit_Zahler"); - $this->SetValue("WP_Laufzeit_Zahler", ($newCount +1)) - } - - - } - - // Methode zum Abrufen der aktuellen Daten - public function GetCurrentData(bool $Peak) { - - // tagessperrzeit berechnen - - - - $this->SetValue("LetzterPeakwert", $Peak); - $this->SetValue("LetzterPeakwert", $Peak); - - - if($this->GetValue("WP_Laufzeit_Zahler")<(20*12)){ - - $this->SetValue("PowerSteps", json_encode([$this->ReadPropertyInteger("CurrentPower")])); - - }else{ - - $this->SetValue("PowerSteps", json_encode([0, $this->ReadPropertyInteger("WP_Leistung")])); - - } - - } - - public function CheckIdle($power){ - $lastpower = GetValue($this->GetIDForIdent("CurrentPower")); - if($lastpower != $power){ - $this->SetValue("Idle", false); - $this->SetValue("IdleCounter", $this->ReadPropertyInteger("IdleCounterMax")); - } - // IdleCounter auslesen und verarbeiten - $idleCounter = $this->GetValue("IdleCounter"); - if ($idleCounter > 0) { - $this->SetValue("Idle", false); - $this->SetValue("IdleCounter", $idleCounter - 1); - } else { - $this->SetValue("Idle", true); - } - } - - -} - -?> diff --git a/WP_N/README.md b/WP_N/README.md deleted file mode 100644 index b059e3a..0000000 --- a/WP_N/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Manager_1 -Beschreibung des Moduls. - -### Inhaltsverzeichnis - -1. [Funktionsumfang](#1-funktionsumfang) -2. [Voraussetzungen](#2-voraussetzungen) -3. [Software-Installation](#3-software-installation) -4. [Einrichten der Instanzen in IP-Symcon](#4-einrichten-der-instanzen-in-ip-symcon) -5. [Statusvariablen und Profile](#5-statusvariablen-und-profile) -6. [WebFront](#6-webfront) -7. [PHP-Befehlsreferenz](#7-php-befehlsreferenz) - -### 1. Funktionsumfang - -* - -### 2. Voraussetzungen - -- IP-Symcon ab Version 7.1 - -### 3. Software-Installation - -* Über den Module Store das 'Manager_1'-Modul installieren. -* Alternativ über das Module Control folgende URL hinzufügen - -### 4. Einrichten der Instanzen in IP-Symcon - - Unter 'Instanz hinzufügen' kann das 'Manager_1'-Modul mithilfe des Schnellfilters gefunden werden. - - Weitere Informationen zum Hinzufügen von Instanzen in der [Dokumentation der Instanzen](https://www.symcon.de/service/dokumentation/konzepte/instanzen/#Instanz_hinzufügen) - -__Konfigurationsseite__: - -Name | Beschreibung --------- | ------------------ - | - | - -### 5. Statusvariablen und Profile - -Die Statusvariablen/Kategorien werden automatisch angelegt. Das Löschen einzelner kann zu Fehlfunktionen führen. - -#### Statusvariablen - -Name | Typ | Beschreibung ------- | ------- | ------------ - | | - | | - -#### Profile - -Name | Typ ------- | ------- - | - | - -### 6. WebFront - -Die Funktionalität, die das Modul im WebFront bietet. - -### 7. PHP-Befehlsreferenz - -`boolean GEF_BeispielFunktion(integer $InstanzID);` -Erklärung der Funktion. - -Beispiel: -`GEF_BeispielFunktion(12345);` \ No newline at end of file diff --git a/WP_N/form.json b/WP_N/form.json deleted file mode 100644 index 38b6234..0000000 --- a/WP_N/form.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "elements": [ - { - "type": "Label", - "caption": "Einstellungen für Wärmepumpe" - }, - - { - "type": "NumberSpinner", - "name": "Wolkenschwellwert", - "caption": "Wolkenschwellwert für Sperre", - "suffix": "" - }, - { - "type": "SelectVariable", - "name": "Wolkenwert", - "caption": "Variable mit der Wolkenprognose", - "test": true - }, - { - "type": "SelectVariable", - "name": "Aussentemperatur", - "caption": "Variable mit der Aussentemperatur", - "test": true - }, - { - "type": "NumberSpinner", - "name": "WP_Leistung", - "caption": "Leistung Wärmepumpe", - "suffix": "" - }, - { - "type": "SelectVariable", - "name": "Referenzzeit", - "caption": "Referenzzeit für Sonnenaufgang (von Standort Modul)", - "test": true - }, - { - "type": "SelectVariable", - "name": "Sperrkontakt", - "caption": "Zu schaltenden Kontakt für WP-Sperre", - "test": true - }, - { - "type": "SelectVariable", - "name": "Kontakt_Erhoeung", - "caption": "Zu schaltenden Kontakt für WP-Erhöhung", - "test": true - } - - ] -} diff --git a/WP_N/locale.json b/WP_N/locale.json deleted file mode 100644 index 6e5c55a..0000000 --- a/WP_N/locale.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "translations": { - "de": { - "Translation 1": "Übersetzung 1", - "Translation 2": "Übersetzung 2" - } - } -} \ No newline at end of file diff --git a/WP/README.md b/WP_Standart/README.md similarity index 100% rename from WP/README.md rename to WP_Standart/README.md diff --git a/WP/form.json b/WP_Standart/form.json similarity index 100% rename from WP/form.json rename to WP_Standart/form.json diff --git a/WP/locale.json b/WP_Standart/locale.json similarity index 100% rename from WP/locale.json rename to WP_Standart/locale.json diff --git a/WP_N/module.json b/WP_Standart/module.json similarity index 91% rename from WP_N/module.json rename to WP_Standart/module.json index 945964c..836fa9e 100644 --- a/WP_N/module.json +++ b/WP_Standart/module.json @@ -1,6 +1,6 @@ { "id": "{B5845D10-1E21-A1AB-32D3-A00E6866EC25}", - "name": "WP_N", + "name": "WP_Standart", "type": 3, "vendor": "Belevo AG", "aliases": [], diff --git a/WP_N/module.php b/WP_Standart/module.php similarity index 99% rename from WP_N/module.php rename to WP_Standart/module.php index f333b16..0357576 100644 --- a/WP_N/module.php +++ b/WP_Standart/module.php @@ -1,5 +1,5 @@ ReadPropertyInteger("Aussentemperatur"))+10)/35*60; + $sperrzei_abs = 60*60*(GetValue($this->ReadPropertyInteger("Aussentemperatur"))+10)/25*60; if($sperrzei_abs>6*60*60){ $sperrzei_abs = 6*60*60;