cloudMQTT is a free online MQTT broker for 5 simultaneous connections. In this tutorial, we will take the opportunity to use cloudMQTT to control a Domoticz home automation server. Domoticz has a JSON API that allows you to control home automation accessories and retrieve states using the MQTT protocol. The MQTT protocol has been designed for this type of application! There is no special configuration to do on the Domoticz server, other than configuring the connection parameters to the MQTT broker. Other free brokers are listed here.
Using a free online broker such as cloudMQTT, you can control all your devices from the internet without having to expose your server!
Create a free MQTT broker on cloudMQTT
cloudMQTT is a broker (server ) MQTT online that offers a free offer. The free offer is limited to 5 simultaneous connections but it is more than enough for personal use. You will find other free online brokers here.
Create a free account on cloudMQTT. You will just need an email. Once logged in, click Create New Instance.
Give a name to your instance and continue
Select the Cute Cate plan which is free (but limited to 5 simultaneous connections). Continue by clicking on Select Region.
cloudMQTT uses Amazon AWS servers to function. You can choose the server on which your data will transit. Here, they will go through Ireland. Do not worry, the choice has little impact on the performance of your connection. Amazon AWS is a cloud leader…
Finish with Review
The new instance is added to the list.
Click on the name of the instance to open the connection parameters:
- Server: the login domain name
- User and password
- Several ports are available
Configure the MQTT connection on Domoticz
Open the hardware list and add MQTT Client Gateway with Lan Interface hardware. Enter the parameters of cloudMQTT
- Click on activate
- address: the one indicated in the instance
- port: here the 16338 but it can be different for you
- user and password:
- Topic : choose out by preference
Close by Add
Note. The MQTT plugin for Domoticz does not support (for the moment I hope) the exchange of MQTT messages via a secure and encrypted connection. You must therefore connect to the standard port. The connection via the SSL port will lead to a connection failure.
Check that Domoticz is correctly connected to cloudMQTT
To find out whether Domoticz has connected to cloudMQTT correctly, just open the log. If this is not the case, change the port
Test the connection from cloudMQTT Now that everything is close, go back to cloudMQTT and open the Websocket UI. With this tool, you can view in real time all MQTT messages exchanged on the cloudMQTT broker and send messages on a particular topic. It’s great to do tests and debugging 🙂
For example, try sending a message on the domoticz / in topic to turn off an RGB bulb (here, the IDX 24)
Domoticz executes the command and returns a message with the new state of the device. Everything works perfectly
You can also track in the log the received messages (and any errors)
All the specifications of the JSON API via MQTT messages on the official documentation here. Moreover, it is with this interface that I use to communicate with Domoticz from Homy. Of course, this tutorial is not limited to Domoticz, you can use cloudMQTT for all your DIY projects based on Arduino, ESP8266, ESP32, Raspberry Pi …. Ultra fast, secure, super simple to set up AND free …. why not use it 🙂
- Install Domoticz on NAS Synology DS718+ with Docker or virtual machine under Debian Buster
- Use the plugins on Domoticz. Manual installation or via Python Plugin Manager
- CloudMQTT test, free online MQTT broker. Control Domoticz with the JSON API
- Securing Domoticz with Let’s Encrypt certificate, access from HTTPS internet
- Xiaomi Mijia Honeywell Smoke Detector Test with Domoticz, Emergency Notification with PushOver