lxrootard / jeedom-tools
Jeedom tools
v0.1
2026-03-29 17:30 UTC
This package is auto-updated.
Last update: 2026-04-30 10:26:27 UTC
README
Tools and helper classes for Jeedom plugin development
MQTTClient deamon class
Sample MQTTClient usage in your plugin class:
use jeedomtools\MQTTClient as myMQTTClient;
$deamon = new myMQTTClient(__CLASS__);
$mqttSettings = '{"host":"192.168.1.1","port":"1883","user":"jeedom","passwd":"xxx","socket_port":"55555","cbclass":"jeeCallback"}'
$deamon->start ($mqttSettings);
$deamon->send ('addTopic', 'mytopic');
deamon->send ('publish', '{"key" : "value"}');
$deamon->stop();
jeeCallback handler:
$results = json_decode(file_get_contents("php://input"), true);
if (is_array($results)) {
foreach ($results as $key => $value)
myplugin::handleMessage(array($key => $value));
}
