Thousands of Happy Smart Home Customers

But don’t just take our word for it...

We offer great products & great knowledge all backed up with great service - and our customers agree!

We’re very proud of our independent Excellent Trustpilot rating, backed up by the many repeat customers we’ve been supporting for years.

 

Read More

 
 

World-Class, Industry-Leading Technical Support - Forever Free

You’ll always have FREE access to our technical knowledgebase, application guides, YouTube tutorials & Customer Services, as well as all other online resources, help, white papers and articles.

If none of these answer your query you can also raise a ticket and get direct access to our team of smart home specialists for for assistance.

 
 

Access to technical specialists
100’s of in-depth help resources
Video guides via YouTube channel
Blog articles with product reviews & test results

 
 

The Vesternet Promise

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.

In addition, here’s my personal email should you ever have any problems or feedback: dave.bell@vesternet.com

We’re not just a shop, we’re with you all the way on building your smart home.

 
 

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.


PLEASE NOTE:

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.

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


Domoticz


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<:port>/json.htm?api-call

Where:

  • <username:password@> = 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

Example:

http://192.168.1.75:8080/json.htm?type=command&param=udevice&idx=10&nvalue=0&svalue=79

For the rest of this guide we will refer to domoticz-ip as 192.168.1.75, 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

/json.htm?type=command&param=switchlight&idx=<idx>&switchcmd=On

The above command will turn a Light / Switch On.

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

Example:

http://192.168.1.75:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=On

Turn a Light / Switch Off

/json.htm?type=command&param=switchlight&idx=<idx>&switchcmd=Off

The above command will turn a Light / Switch Off.

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

Example:

http://192.168.1.75:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=Off

Set a dimmable light to a certain level

/json.htm?type=command&param=switchlight&idx=<idx>&switchcmd=Set%20Level&level=6

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

Notes:

  • 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

Example:

http://192.168.1.75:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=Set%20Level&level=6

Toggle a Light / Switch state On/Off

/json.htm?type=command&param=switchlight&idx=<idx>&switchcmd=Toggle

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.

Example:

http://192.168.1.75:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=Toggle

Thermostat Setpoint change

/json.htm?type=setused&idx=<idx>&setpoint=<setpoint>&used=true

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.

Example:

http://192.168.1.75:8080/json.htm?type=setused&idx=18&setpoint=18&used=true

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

Available modes are:

  • Auto
  • TemporaryOverride
  • PermanentOverride

Example:

http://192.168.1.75:8080/json.htm?type=setused&idx=18&setpoint=18&used=true&mode=TemporaryOverride&until=2015-12-08T15:45:00.000Z

Thermostat Heating Mode

/json.htm?type=command&param=switchmodal&idx=<idx>&status=<status>&action=1

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

Example:

http://192.168.1.75:8080/json.htm?type=command&param=switchmodal&idx=8&status=Away&action=1

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


Examples

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

Copyright Vesternet 2016

Updated: 27/01/2016

You viewed

Please wait...

Item(s) Added Continue shopping or View cart & checkout
Continue shopping or View cart & checkout