mqtt batterie modul auf eines runtergebrochen

This commit is contained in:
2026-06-02 08:33:45 +02:00
parent d1434b0977
commit fb27100079
2 changed files with 28 additions and 7 deletions
-5
View File
@@ -10,11 +10,6 @@
"name": "ReqActionID",
"caption": "Ausgabe-Variable / Nennleistung"
},
{
"type": "SelectInstance",
"name": "PublishInstanceID",
"caption": "MQTT Publish Helper"
},
{
"type": "SelectVariable",
"name": "SoCID",
+28 -2
View File
@@ -13,7 +13,7 @@ class MQTTBatterySDL extends IPSModule
$this->RegisterPropertyInteger('ReqActionID', 0);
$this->RegisterPropertyInteger('SoCID', 0);
$this->RegisterPropertyInteger('PowerProductionID', 0);
$this->RegisterPropertyInteger('PublishInstanceID', 0);
//$this->RegisterPropertyInteger('PublishInstanceID', 0);
$this->RegisterPropertyFloat('TargetSoC', 50);
$this->RegisterPropertyInteger('ChargePower', 2500);
@@ -488,9 +488,35 @@ public function DoDelayedPublish()
return;
}
$this->PublishViaHelper($topic, $payload);
$this->SendDebug('Publish', $topic . ' => ' . $payload, 0);
$this->SendDataToParent(json_encode([
'DataID' => '{043EA491-0325-4ADD-8FC2-A30C8EEB4D3F}',
'PacketType' => 3,
'QualityOfService' => 0,
'Retain' => false,
'Topic' => $topic,
'Payload' => $payload
]));
}
/* Von DH auskommentiert am 2.6.
public function DoDelayedPublish()
{
$this->SetTimerInterval('PublishDelay', 0);
$topic = $this->GetBuffer('PublishTopic');
$payload = $this->GetBuffer('PublishPayload');
$this->SetBuffer('PublishTopic', '');
$this->SetBuffer('PublishPayload', '');
if ($topic == '' || $payload == '') {
return;
}
$this->PublishViaHelper($topic, $payload);
}
*/
/*
private function SafeSend(array $packet)