Control Domoticz from Homy, configure the HTTP / HTTPS connector

Homy has been supporting the Domoticz Open Source Domotic Server since version 0.1 (December 2018). Homy uses an HTTP connection to communicate with the Domoticz server. Homy is also able to use secure HTTPS communication if a valid SSL certificate is installed on the Domoticz server. A free SSL Let’s Encrypt certificate works perfectly.

Current version: 0.2 (March 2019)

Configure the router or the box Internet to make Domoticz accessible from internet

The first thing to do is to configure a port routing to the Domoticz server. To do this, connect to the management interface of your router or your internet. Here is an example on my internet box or you have to go in the menu Network v4 then NAT. The configuration is similar from one box to another, you should find it quite easily.

Create several redirection by entering the following parameters:

  • Protocol: TCP
  • Port (input): 443 or 8080
  • IP: the IP address of the Domoticz server on the local
  • Port network (redirection) : idem
  • Check Enable

Add the redirection

Create a first redirection from port 443 to port 443.

A second redirection from port 80 to port 8080 that will be used just to create the certificate Let’s Encrypt.

You can create a third port redirection 8080 to 8080 to test unsecured access but I do not recommend it.

domoticz https ssl lets encrypt router configuration

Configure Domoticz

No configuration is required on Domoticz. The HTTP API is open by default.

domoticz https 443 alert chromeFor communication between Homy and Domoticz to be secure, I advise you to activate the HTTPS protocol. The option is proposed at the time of installation. The default port is 443.

To test if everything is set up correctly, log in to the WEB interface by changing the port like this:

https://IP_DOMOTICZ:443

Domoticz creates a self-signed certificate that is considered dangerous by browsers modern. You will receive an alert such as this one. On Google Chrome, click Show advanced settings and then Continue to site … (dangerous)

If it is possible to override this warning, this is not the case for Homy.

Install a valid SSL certificate Let’s Encrypt

It is not possible to connect to Domoticz in HTTPS with the default self-signed certificate. If you want to use a secure connection, you must replace the self-signed certificate with a valid certificate.

A free Let’s Encrypt certificate is perfectly sufficient. Follow this tutorial that explains all the steps to create and install a Let’s Encrypt certificate on a Domoticz server.

domoticz duckdns lets encrypt ssl https connexion

Create a free domain name with Duck DNS

DuckDNS is a totally free service that allows you to create up to 5 domain names. The extension of your domain will have the extension duckdns.org. This extension can not be customized but we will not be choosy.

To use Duck DNS, you will need a Persona account, Twitter, github or reddit.

duckdns configuration homy

Once logged in, simply enter the desired domain name in the creation field.DuckDNS automatically detects the IP address of your internet box. It is however possible to modify it and even to indicate an IP address of type IP v6 if your box supports it.

duckdns ip address

That’s it!

The domain name created with DuckDNS service is compatible with a secure HTTPS connection with a Let’s Encrypt certificate.

Configure the Domoticz connector (HTTP or HTTPS) on Homy

Open the Settings

homy settings

Open the Connector List.

homy settings

Click the Plus.

homy connector list

Choose Domoticz in the list

homy domoticz connecteur http

Parameters for a standard HTTP connection

Fill in the following parameters:

  • Name the connector. Optional
  • Check Active to enable the connector. By unchecking this option, you can suspend communication with the Domoticz server temporarily
  • Local IP. Enter the IP address of the Domoticz server on your local network.
  • External IP. If you have a previously created DynDNS domain name, enter it in the (valid only in HTTP)
  • Port. By default, Domoticz uses the 8080
  • Protocol : HTTP
  • Indicate if username and password if access is protected by an authentication
  • Test the connection. Click on “Test Connection”. If Homy could login and authenticate on Domoticz, the cross will be green. An exclamation point will be displayed if this is not the case.
  • To test the external IP, check the Test connector with external IP option.

homy domoticz connector settings duckdns

 

Settings for a secure HTTPS connection

To use the HTTPS protocol, a valid SSL certificate must be installed on the Domoticz server (or Synology NAS)

  • External IP. the domain previously created on DuckDNS or another DynDNS service. It is not possible to indicate the IP address of your box with the HTTPS protocol.
  • Port. By default, Domoticz uses the 443
  • Protocol : check HTTPS
  • Indicate if username and password if access is protected by an authentication
  • Test the connection. Click on “Test Connection”. If Homy could log in and authenticate with Home Assistant, the cross will be green. An exclamation point will be displayed if this is not the case.
  • To test the external IP, check the Test connector with external IP option.

homy domoticz connector settings duckdns https

Optional Parameters

Homy is able to automatically retrieve all home automation modules and accessories as well as scenarios. You can let Homy manage everything (or do it manually):

  • Automatically add the new detected accessories. If you uncheck this option, a Plus button will be displayed at the bottom of the main screen as soon as a new home automation module is detected.
  • Synchronize the name of the accessories

homy domoticz connector synch auto add device

Current limitations

The plans (rooms and floors) are not synchronized

Other tutorials on the same theme

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

We will be happy to hear your thoughts

Leave a Reply

DIY Projects
%d bloggers like this: