This commit is contained in:
belevo\mh
2025-01-07 10:36:50 +01:00
parent fe8a60e831
commit bf73d0a478
3 changed files with 27 additions and 3 deletions

View File

@@ -16,12 +16,14 @@ class Batterie extends IPSModule
$this->RegisterPropertyInteger("Entladestrom", 0);
// Variabeln für Kommunkation mit Manager
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
$this->RegisterVariableProfile("Batterie.Leistung", 1, "W");
$this->RegisterVariableProfile("Batterie.Strom", 1, "A");
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "Batterie.Leistung", 0);
$this->RegisterVariableString("PowerSteps", "PowerSteps");
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
$this->RegisterVariableInteger("PV_Prio", "PV_Prio");
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0);
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "Batterie.Leistung", 0);
// Hilfsvariabeln für Idle zustand
$this->RegisterPropertyInteger("IdleCounterMax", 2);
@@ -53,6 +55,14 @@ class Batterie extends IPSModule
return $array_powersteps;
}
private function RegisterVariableProfile(string $name, int $type, string $suffix)
{
if (!IPS_VariableProfileExists($name)) {
IPS_CreateVariableProfile($name, $type);
IPS_SetVariableProfileText($name, "", $suffix);
}
}
public function RequestAction($Ident, $Value)
{