Activating The Functionality
Because scene activation causes extra traffic on the Z-Wave network, this functionality is disabled by default. To activate it: go to the options of the device, over to the Advanced tab and scroll all the way to the bottom. Depending which device you are configuring, you may see an explanation of the different IDs the device will send.
For the Fibaro Dimmer Module, the IDs are:
|
Momentary S1 |
Momentary S2 |
Toggle S1 |
Toggle S2 |
Roller S1 |
Roller S2 |
Holding Down |
12 |
22 |
|
|
17 |
18 |
Releasing |
13 |
23 |
|
|
13 |
13 |
Single Click |
16 |
26 |
16 * |
26 ^ |
|
|
Off to On |
|
|
10 * |
20 ^ |
10 |
|
On to Off |
|
|
11 * |
21 ^ |
|
11 |
Double Click |
14 |
24 |
14 |
24 |
14 |
|
Triple Click |
15 |
25 |
15 |
25 |
15 |
25 |
* When parameter 19 is in the default toggling state, 16 will be returned, otherwise 10 or 11 will be.
^ When parameter 19 is in the default toggling state, 26 will be returned, otherwise 20 or 21 will be.
Once you have enabled scene activation, you can then start creating scenes to use this – referring back to the device IDs when needed.
The first and second switch should be wired into Dimmer inputs S1 and S2 respectively.
The scene
Now that scene activation is enabled, we can write a scene that can be triggered by it. In the following example, the dimmer's device ID is 30, change it as necessary:
local
lightID = 30
local
scene =
fibaro:getValue
(lightID,
'sceneActivation'
)
if
(scene ==
'14'
)
then
elseif
(scene ==
'15'
)
then
end
– Line 3 is the trigger of this scene
– Lines 7 and 9 are defining the variables. In this case, the ID of the dimmer and the scene activation ID the dimmer has sent.
– The rest of the lines are defining what will happen when different scene activation IDs are received.
Because each ID can trigger different actions, this means that from one Fibaro Dimmer with a toggle switch you are able to trigger up to 6 different actions and up to 10 with a momentary switch.
You can add the Lua code fibaro:call() to perform the actions turnOn, turnOff and setValue on different devices, or fibaro:startScene() to run a specific scene (perhaps a graphics block scene) to keep this code neat and tidy.
Graphics Block Scene Activation
Graphics blocks can be used for Scene Activation instead of Lua. Below is a simple example of how a the scene would look.
The first blue block is the device that has Scene Activation turned on – in this case a Fibaro Dimmer Module. The green block has been changed from 'On' to 'Scene activation' and the number 15 has been typed into the dark green box that appears. This represents the scene activation ID the dimmer sends when switch 1 (S1) is triple clicked.
Once this block has been created, the next part of the scene can run a scene or set the value of any device that you wish.