mqtt batterie modul auf eines runtergebrochen
This commit is contained in:
@@ -10,11 +10,6 @@
|
||||
"name": "ReqActionID",
|
||||
"caption": "Ausgabe-Variable / Nennleistung"
|
||||
},
|
||||
{
|
||||
"type": "SelectInstance",
|
||||
"name": "PublishInstanceID",
|
||||
"caption": "MQTT Publish Helper"
|
||||
},
|
||||
{
|
||||
"type": "SelectVariable",
|
||||
"name": "SoCID",
|
||||
|
||||
@@ -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);
|
||||
@@ -474,6 +474,32 @@ class MQTTBatterySDL extends IPSModule
|
||||
$this->SetTimerInterval('PublishDelay', 500);
|
||||
}
|
||||
|
||||
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->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);
|
||||
@@ -490,7 +516,7 @@ public function DoDelayedPublish()
|
||||
|
||||
$this->PublishViaHelper($topic, $payload);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
private function SafeSend(array $packet)
|
||||
|
||||
Reference in New Issue
Block a user