As Founder & CEO of Vesternet, I personally guarantee your 100% satisfaction on any purchase.

I’d never want you to be unhappy with something you buy from us, so here’s my promise - you can return any unused products within 365 days. If you have problems with a new purchase, our support team will work with you to resolve. And if you still can’t get it working then you can return it within 14 days for replacement or refund. For full information take a look at our full returns policy.

Domoticz is a well supported and actively developed piece of software that can be used as a Home Automation system in it's own right.

When coupled with a Rasberry Pi, it makes a great value for money Home Automation Controller that can integrate many different technologies.

Integrating Domoticz with a Fibaro Home Center allows the use of devices based on technologies that Fibaro do not support directly within your Z-Wave based system, for example EnOcean, 1Wire, X10, Hue, LightwaveRF, Oregon Scientific, Visonic, Somfy RTS, etc.

This is the final guide on this series and it will focus on configuring Fibaro Home Center to "control" devices installed in Domoticz.

In our other related guides, we showed you how to initially configure Domoticz and how to control Z-Wave and RFXtrx433E based devices.

Full information on what Vesternet Technical Support covers is available here.

Prerequisites

Before beginning, it is assumed that you have already completed the initial installation of Domoticz on your Raspberry Pi.

If you haven't completed this step yet, we recommend that you follow the tutorial here - it's a relatively simple process and mainly involves downloading the Domoticz "image" and writing it to an appropriately sized SD Card using the software included with the download.

Once Domoticz is installed, you should be able to connect to the web based User Interface by accessing "http://IPADDRESS:8080" where "IPADDRESS" matches the IP address of your Raspberry Pi (this will be given out by the DHCP server in your Broadband Router, or you may have set a "static" IP address during installation).

We also recommend that you follow the previous application guide in this series as this will show you how to configure Domoticz to suit our intended usage scenarios.

Domoticz HTTP API

Domoticz provides a way to interact with all its devices using a JSON API. This give us an easy way to control Domoticz devices from Fibaro using simple HTTP GET requests.

We will focus on just a few device types and operations but a complete list of all available API methods can be found here.

Format

Requests can be made with the Domoticz API using the following logic:

http://<username:password@>domoticz-ip/json.htm?api-call

Where:

<username:password@&gt = the username and password to access Domoticz, this is optional

Fibaro Home Center

Now that we’ve seen how the API works, it’s time to start looking at Fibaro Home Center and how we’ll interact with the Domoticz API.

Adding Virtual Devices

Virtual devices can be used to control external systems quite simply using basic HTTP GET commands. This allows you to seamlessly integrate with other home automation controllers, such as Domoticz.

You can create a new Virtual Device by clicking “Devices” on the Fibaro menu followed by “Add or remove device”

Start by filling in the IP Address and TCP Port of your Domoticz installation

Then set the design and button layout - each button set can be added by clicking “Add set”

There are three types of virtual elements that can be used as an element of the virtual device:

Button - a basic button

Label - dynamic text-based message

Slider – a basic slider

After setting the proper Layout each button can then be configured separately. It is possible to configure the actions for basic “string code” (more on that later) or implementing LUA code (available only for the HC2).

Each button can be configured with the following settings:

Label – description for each button

ID – unique ID for using in LUA code

Empty – allows to hide the button

Main – button will be visible in the Your House tab

Controlling a Domoticz dimmable Light

On the newly created Virtual Device add a “Two buttons per line” button set

Since this will be a simple HTTP request select the “String” option

Name each button On and Off respectively and add the following code:

On Button

GET /json.htm?type=command&param=switchlight&idx=18&switchcmd=On HTTP/1.10x0D0x0A0x0D0x0A

Off Button

GET /json.htm?type=command&param=switchlight&idx=18&switchcmd=Off HTTP/1.10x0D0x0A0x0D0x0A

Let’s take a moment to see what we’re doing.

We start by identifying the communication protocol, in this case an HTTP GET request

Then we pass the command “/json.htm?type=command&param=switchlight&idx=18&switchcmd=On” which will turn On Domoticz device 18 – don’t forget to change this to your device Idx

We then finish by setting the HTTP Header with “HTTP/1.10x0D0x0A0x0D0x0A”

Now add a Slider with the following code:

GET /json.htm?type=command&param=switchlight&idx=18&switchcmd=Set%20Level&level=_sliderValue_ HTTP/1.10x0D0x0A0x0D0x0A

Again this is the same code as we’ve seen above but this time with a little twist: we’re setting "level = _sliderValue_".

_sliderValue_ is an internal variable that holds the current slider value. This means when the slider is dragged an HTTP request will be sent to Domoticz passing the current value.

Click the Save button and test the newly created device.

Setting Thermostat Setpoint and Heating Modes

Now that we’ve seen how to control a Domoticz dimmable light via Fibaro Home Center we can move on to another common example such as heating.

The principles are the same:

Create Virtual Device

Add button sets

Add button code

Using everything we’ve learned so far we can easily get to this:

Examples

Here's some further examples that we created:

Final Thoughts

We hope that you've found this application note useful - you should now have your Domoticz devices fully integrated with your Fibaro Home Center!

Don't forget to check out our other guides, which show you how to use Domoticz with Z-Wave and RFXtrx433E based devices.