no message
This commit is contained in:
@@ -46,7 +46,7 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
|
|||||||
{
|
{
|
||||||
IPS_LogMessage("ShellySwitchSender", "GetAction gestartet");
|
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");
|
$topic = $this->ReadPropertyString("Topic");
|
||||||
|
|
||||||
$msg_id = $this->ReadPropertyInteger("msg_id");
|
$msg_id = $this->ReadPropertyInteger("msg_id");
|
||||||
@@ -80,8 +80,13 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nachricht senden
|
// MQTT-Nachricht senden via RequestAction
|
||||||
$result = MQTT_Publish($mqttInstanceID, $topic, $jsonPayload, 0);
|
$result = IPS_RequestAction($mqttInstanceID, "Publish", [
|
||||||
|
"Topic" => $topic,
|
||||||
|
"Payload" => $jsonPayload,
|
||||||
|
"QoS" => 0,
|
||||||
|
"Retain" => false
|
||||||
|
]);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
IPS_LogMessage("ShellySwitchSender", "Nachricht erfolgreich gesendet");
|
IPS_LogMessage("ShellySwitchSender", "Nachricht erfolgreich gesendet");
|
||||||
@@ -90,4 +95,5 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user