Zendure SmartFlow MQTT

Ich nutze zum einfachen und direkten schreiben auf den internen MQTT Server das Script von
GitHub - bluerhinos/phpMQTT: a simple php class to connect/publish/subscribe to a MQTT broker

Das ist im Script Ordner unter dem Namen phpMQTT.php abgelegt.

<?php
// https://github.com/bluerhinos/phpMQTT

require('phpMQTT.php');

$debug = true;               

$server = 'localhost';     // change if necessary
$port = 1883;                     // change if necessary
$username = '';                   // set your username
$password = '';                   // set your password
$client_id = 'phpMQTT-publisher'; // make sure this is unique for connecting to sever - you could use uniqid()

$topic = 'iot/73bkTV/xxx/properties/read'; // xxx durch korrekten Topic ersetzen
$value = '{"properties": ["getAll"]}';

$mqtt = new Bluerhinos\phpMQTT($server, $port, $client_id);


if ($value) {
    if ($mqtt->connect(true, NULL, $username, $password)) {
        if ($debug)
            IPS_LogMessage(IPS_GetName($_IPS['SELF']), "MQTT connect, topic " . $topic . ", value " . $value);
        $mqtt->publish($topic, $value, 0, false);
        $mqtt->close();
    }
}