APNT-88 - Controlling Domoticz devices from Fibaro Home Center

IMPORTANT - Read this first!

These guides are now considerably out of date and remain here only as a reference.

Please visit the Domoticz forum for help with installing and configuring Domoticz.


This guide shows how to integrate the Domoticz Home Automation software on the Raspberry Pi with a Fibaro Home Center Z-Wave Controller.

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.

Fibaro Home Center

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


While we are happy to provide the Domoticz related guides to our Customers, we are unable to provide detailed Technical Support for any Domoticz related problems.

The best place to seek assistance with Domoticz is the forum.

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


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.


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



  • <username:password@&gt = the username and password to access Domoticz, this is optional
  • domoticz-ip = the IP address or hostname of your Domoticz installation
  • <:port> = the port number of your Domoticz installation, this is optional


For the rest of this guide we will refer to domoticz-ip as, port as 8080 and username/password will be blank.

Device Idx

To interact with a device you first need to know its ID (Idx) in Domoticz.

You can find this by clicking "Setup" on the Domoticz menu, followed by "Devices".

Domoticz Devices

Turn a Light / Switch On


The above command will turn a Light / Switch On.

Note: Make sure to replace <idx> with your device Idx.


Turn a Light / Switch Off


The above command will turn a Light / Switch Off.

Note: Make sure to replace <idx> with your device Idx.


Set a dimmable light to a certain level


The above command will set a dimmable light to the specified level.


  • Make sure to replace <idx> with your device Idx
  • Level should be a value between 1 (0%) and 16 (100%)
  • In some cases you need to use the “real” percentage level, so if 1 to 16 doesn't work for you, then try 1 to 100


Toggle a Light / Switch state On/Off


The above command will Toggle a Light / Switch state to its' opposite state, so if it's On, turn it Off, if it's Off, turn it On.

Note: Make sure to replace <idx> with your device Idx.


Thermostat Setpoint change


The above command will change a thermostat setpoint.

Note: Make sure to replace <idx> with your device Idx and <setpoint> with the desired setpoint in degrees.


Additional options may be added such as mode and period (until) time.

Available modes are:

  • Auto
  • TemporaryOverride
  • PermanentOverride


Thermostat Heating Mode


The above command will change a thermostat Heating Mode (if supported).

Note: Make sure to replace <idx> with your device Idx and <status> with the desired Heating Mode.

Available status are:

  • Auto
  • AutoWithEco
  • Away
  • DayOff
  • Custom
  • HeatingOff


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

Add Virtual 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

Virtual Device Buttons

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

Virtual Device Buttons

  • 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.

Virtual Device Slider

  • Click the Save button and test the newly created device.

Virtual Dimmable Light

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:

Virtual Evohome Controller


Here's some further examples that we created:

Virtual Device

Virtual Device

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.

Related Information

Rated Excellent on