Installation and configuration of Domoticz and Mosquitto MQTT broker on Windows

This guide is about how to set up a functional Domoticz environment on Windows. Moreover, it is Domoticz and Mosquitto on Windows. As I figured out most of the Domoticz instances are running on Linux-es\Raspberry-es. In contrast, I just want to show how to do it this way. Since I already have a PC running 24/7 and believe it or not I like Windows, it was a logical choice.

Few practical advice’s

Windows Firewall

I know that it is not a best practice, but before you begin I would suggest that you turn off windows firewall for good (just temporary all networks). Finally, when everything is up and running you can turn it back on and configure it to allow ports needed for these apps to work. We will mention that again later.

Microsoft Visual c++ redistributable

Another thing is Microsoft Visual c++ redistributables. If you ask me, download them all from 2013 to the latest version in both x86 and x64 versions and install them from the oldest to the newest one by one. It may sound stupid, but it is not taking much space and many apps rely upon those redistributables. Domoticz is one of them! Finally, if it is hard to find all of them just write a comment for this article, I do have one archive to rule them all and I can send it to you. 🙂

Install Domoticz on Windows

First of all, download the installation from here. Setup is as easy as it can be so there is almost nothing to explain. Just run it and click next. The only thing that I can suggest is that you chose to run Domoticz as a service as it is the right thing to do. Explaining why is not part of this article but let’s just say that due to its nature and purpose Domoticz should be running all the time, 24/7.

Port numbers

In case you are ok with default port numbers (and there are not many reasons not to be) just leave them be and finish the installation. Hence, everything went fine fastest way to check is it working is to open the browser on the same computer where you just installed Domoticz and open this address: http://localhost:8080. You should get something like this.

Service Status

In case nothing opens or page is not available most probably Domoticz service is not running. Consequently, you need to figure out what is happening. Type services in Windows search and open it. Find Domoticz service and check it`s status. The service should be running.

The service status should look like this. If service is not running try to start it. In case service starting ends with failed, or pause or stoped, there is a problem. Most likely you did not turn off a firewall or did not install those Microsoft Visual c++ redistributables that I mentioned before. It is now wise to visit Windows Event viewer and check Windows application logs for errors or warnings regarding Domoticz service. Now, let`s continue with Mosquitto installation.

Install Mosquitto MQTT broker

Since Domoticz should be up and running, the next big thing is to set up an MQTT broker. If you are interested read little about MQTT protocol. Wikipedia is a great start. For those of you inpatient, download Mosquito and let`s go to setup. Setup is straight forward and easy as the previous one.

Let us again check if service is running but this time for Mosquitto. It should look like this.

Just to clarify, Domoticz and MQTT (in this case Mosquitto) go hand in hand in any environment, not just in Windows. No problems should be here so we now need to connect Mosquitto and Domoticz together.

Now we configure Domoticz to use Mosquitto as MQTT broker.

Open Domoticz web site in your browser. If you are working on the same computer where you installed Domoticz and Mosquitto than the address is http://localhost:8080 . If you are gonna access it from another device than the address will be something like this, with your IP address. http://IpAddressOfTheComputerWhereDomoticzIsInstalled:8080 Do not hold a grudge on me for writing it this way, there are people new in all this and sometimes this level of simplicity and details helps.

In Domoticz web page go to Setup, then Hardware and under name write something logical like MQTT and under type chose “MQTT Client Gateway with LAN interface”. The remote address is localhost since both are on the same machine and port number is 1883. Data Timeout is “Disabled”. Leave the Username and Password empty (if you need extra security you can change this later). Set publish topic to “out” Click add and that is it. It should look like this picture.

Since you are already there add one more device, it`s gonna be needed later. Write something as a name (for example dummy or dummy virtual switch) and as a type chose Dummy (Does nothing, use for virtual switches only). Now, leave Data timeout as disabled and click Add. It looks like this.

Later you will create virtual sensors on top of this dummy. Sounds funny, right? 🙂 Now you should have Domoticz and Mosquitto on Windows up and running. Now it is time to enable and configure a firewall to allow used ports and services. It is not a mandatory task but a friendly suggestion.

That`s all folks. If you find this interesting, there is more in the “Home Automation” category. Thank you for reading, and if you have any questions, post a comment.

🙂

Related posts

AMD (ATI) drivers filling up space on system disk

Sonoff TH Elite to Tasmota

Sonoff mini r2 to Tasmota