no message

This commit is contained in:
2026-05-26 12:57:42 +02:00
parent be17a47360
commit b47ab188ec
2 changed files with 21 additions and 4 deletions
+5
View File
@@ -5,6 +5,11 @@
"name": "TopicSuffix",
"caption": "Topic Suffix / x"
},
{
"type": "SelectVariable",
"name": "FeedbackResponseID",
"caption": "Feedback Response Variable"
},
{
"type": "SelectVariable",
"name": "ReqActionID",
+16 -4
View File
@@ -18,6 +18,8 @@ class MQTTBatterySDL extends IPSModule
$this->RegisterPropertyInteger('DischargePower', 2500);
$this->RegisterPropertyInteger('MaxPowerSetpoint', 10000);
$this->RegisterPropertyInteger('FeedbackResponseID', 0);
// Variablen
$this->RegisterVariableBoolean('IsReady', 'Is Ready', '', 10);
$this->RegisterVariableBoolean('IsRunning', 'Is Running', '', 20);
@@ -373,10 +375,7 @@ public function ReceiveData($JSONString)
if ($topic === 'feedback-request/' . $suffix) {
$json = $this->BuildReadResponse();
$this->QueuePublish(
'feedback-response/' . $suffix,
$json
);
$this->SendFeedbackResponse($json);
return;
}
@@ -414,6 +413,19 @@ private function PublishMQTT(string $topic, string $payload)
]));
}
private function SendFeedbackResponse(string $payload)
{
$id = $this->ReadPropertyInteger('FeedbackResponseID');
if (!$this->IsValidVariable($id)) {
$this->SendDebug('SendFeedbackResponse', 'Keine gültige FeedbackResponseID gewählt', 0);
return;
}
RequestAction($id, $payload);
}
private function IsValidVariable(int $id)
{
return (