Wednesday, April 11, 2018

Use Homekit to control Fibaro HCL Z-Wave Dimmer

Home Automation Flow

Siri > Homebridge > Domoticz (LUA) > Fibaro HCL > Aeotec Nano Dimmer

Assume that Homebridge, Domoticz and Fibaro is already setup. The homebridge config.json file should have a room reference to avoid Homekit showing all devices

    "bridge": {
        "name": "Homebridge",
        "username": "CC:21:3E:E4:DE:33",
        "port": 51826,
        "pin": "031-45-154"
    "description": "Configuration file for (e)xtended Domoticz platform.",
    "platforms": [
            "platform": "eDomoticz",
            "name": "eDomoticz",
            "server": "",
            "port": "8080",
            "ssl": 0,
            "roomid": 2,
            "mqtt": 1
    "accessories": [

Step 1. Create a new domoticz virtual device example name "My_Dimmer"

Step 2. Add the virtual device to the Homebridge assigned Room "roomid" that is assigned for devices that Homekit will control.

Step 3: Create a new lua script file with the device name in this folder


The script name is important. For the device with the name "My_Dimmer". create the script "script_device_My_Dimmer.lua"

The whole path is as such.


Insert the following to the script file, replacing user:password and device IDs. Script as follows:

commandArray = {}


if otherdevices[DEV] == 'Off' then
        os.execute('curl "http://:@:80/api/callAction?deviceID=&name=turnOff"')
        Level = otherdevices_svalues[DEV]
=        os.execute('curl "http://user:password@:80/api/callAction?deviceID=&name=setValue&arg1="'..Level)

return commandArray

Important Note: name your dimmer My_Dimmer so that the name is consistent in the device and in the script for it to work.

No comments:

dead pi

Well, I guess it has to happen at some point. the home automation raspberry pi has died. Much to do with the stupid Strontium mini SD card. ...