Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Jamie Balfour'sPersonal blog

Jamie Balfour'sPersonal blog

ZPE 1.10.10 will be released today at some point, and the headline feature is MQTT support. 

In case you didn't know, MQTT is built upon the TCP/IP stack and is intended for direct communication in the form of a publish and subscribe system. ZPE now has the ability to publish (not subscribe yet) messages to an endpoint and is fairly straightforward to use (unlike the underlying implementation). 

To use MQTT in ZPE, one uses the MQTT object which encapsulates several built-in functions (connect and publish). More will be published after the release today on using MQTT.

You could write the following code (assuming you have cached values already setup):

YASS
$topic = "comms"
$message = "Hello world!"
$mqtt = new MQTT()
$mqtt->connect("192.168.1.2", 1883, read_cache_value("MQTT_USER"), read_cache_value("MQTT_PASS"))
$mqtt->publish($topic, $message
Powered by DASH 2.0