no message

This commit is contained in:
belevo\mh
2025-05-26 14:06:13 +02:00
parent 5fc1171ba1
commit 11a98231c4

View File

@@ -46,7 +46,7 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
{
IPS_LogMessage("ShellySwitchSender", "GetAction gestartet");
$mqttInstanceID = $this->ReadPropertyInteger("mqtt_instance_id"); // Instanz-ID deiner MQTT-Instanz
$mqttInstanceID = $this->ReadPropertyInteger("mqtt_instance_id");
$topic = $this->ReadPropertyString("Topic");
$msg_id = $this->ReadPropertyInteger("msg_id");
@@ -80,8 +80,13 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
return;
}
// Nachricht senden
$result = MQTT_Publish($mqttInstanceID, $topic, $jsonPayload, 0);
// MQTT-Nachricht senden via RequestAction
$result = IPS_RequestAction($mqttInstanceID, "Publish", [
"Topic" => $topic,
"Payload" => $jsonPayload,
"QoS" => 0,
"Retain" => false
]);
if ($result) {
IPS_LogMessage("ShellySwitchSender", "Nachricht erfolgreich gesendet");
@@ -90,4 +95,5 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
}
}
}