APNT-126 - Using a Fibaro Dimmer 2 S2 Input to trigger Scenes in VERA UI7

The Fibaro Dimmer 2 S2 Input has proven to be very useful. So far we’ve seen it can be used to control the local load as part of a multi-way lighting circuit or control a Z-wave device that is Associated with it.

However one of the best - but somewhat hidden - features of the Fibaro Dimmer 2 is that it can be used to trigger a scene in your Z-Wave controller.

In this guide we'll take a look at how we can use this feature in the VERA Z-Wave controller running the UI7 series of firmware.

Enable Scene Activation

By enabling Scene Activation the Fibaro Dimmer 2 will report a distinct Scene Number - not to be confused with VERA Scene ID - to your VERA Controller every time one of the Switches is clicked, held or released.

This means a single Dimmer can be used to trigger up to 9 different scenes in VERA.

To enable the Scene Activation functionality you’ll need to set Parameter 28 (1 byte decimal) to 1 - for more information on how to set Device Parameters in VERA UI7 please check this guide.

Trigger VERA Scenes

Unfortunately this can’t be done out-of-the-box with the VERA Scene Wizard so we’ll need to use some LUA trickery.

Find your Device ID and Scene ID(s)

First thing we need to do is to take note of the device ID of your Fibaro Dimmer 2 and the Scene ID(s) that correspond to the Scene(s) that you wish to run. This is simple:

  • In VERA Devices tab click the “arrow” icon next to the Fibaro Dimmer 2

Fibaro Dimmer 2


  • Click “Advanced” and then take note of the ID on the top left corner next to "device #", in this example 47

Fibaro Dimmer ID


  • In VERA Scenes tab take note of each Scene ID you want to be triggered by the Fibaro Dimmer 2

Scene ID


VERA Trickery

Add the following to your Startup LUA code at Apps – Develop apps – Edit Startup Lua

local YourDeviceID = 47

luup.variable_watch("SceneActivation","urn:micasaverde-com:serviceId:SceneController1","LastSceneTime",YourDeviceID)

function SceneActivation()
	local lastSceneID= luup.variable_get("urn:micasaverde-com:serviceId:SceneController1", "LastSceneID",YourDeviceID)
	if (lastSceneID== "FibaroSceneNumber") then
		luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="FancySceneID" },0)
	elseif (lastSceneID== "FibaroSceneNumber") then
		luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="FancySceneID" },0)
	elseif (lastSceneID== "FibaroSceneNumber") then
		luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="FancySceneID" },0)
	end
end

  • Update YourDeviceID with the device ID of your Fibaro Dimmer 2 that you noted down previously
  • Change FibaroSceneNumber with the Scene Number corresponding to the event you want to monitor. A complete list of the available events and corresponding Scene Numbers can be found on the Fibaro Dimmer 2 manual
  • Adjust the FancySceneID in each “action” to the appropriate VERA Scene ID that you’ve noted down previously
  • It should now look similar to the bellow

LUA Startup


  • Click "Go" to save the changes and give a few minutes for VERA to settle down.

PLEG Plugin

If you would rather keep away from using LUA code you can use the excellent PLEG Plugin.

By adding the necessary Device Properties, Conditions and Actions you can use the Fibaro Dimmer 2 in the most complex of scenarios.


PLEG


More information on how to use PLEG can be found in VERA Forum.

Check It's Working

By monitoring VERA Logs while pressing the Dimmer 2 “buttons”, i.e. activating a scene, you can confirm if VERA is receiving the Scene Activation notification and what Scene Number was reported.


Log


This will help in troubleshooting any problems that you may have during this process.

Related Information