No announcement yet.

How To flash your lights - Fibaro Dimmer 2 & Switch 2

  • Filter
  • Time
  • Show
Clear All
new posts

    How To flash your lights - Fibaro Dimmer 2 & Switch 2

    Updated to include Fibaro Switch 2.

    As many of you will know, a large amount of z-wave devices can be activated by alarm frames. These frames are sent from other devices such as smoke alarms, water leak detectors, etc, when they are triggered. Some of the Fibaro devices such as the dimmers and the switches, and many other types, can be configured to activate on detection of these alarm frames. In the case of the Fibaro Dimmer 2 & Switch 2, when an alarm frame is received, it can be configured to turn on, turn off, ignore the alarm frame, or flash the connected load, in my case, lights.

    The Dimmer 2 and Switch 2 supports these alarm types:

    General Purpose Alarm - GENERAL PURPOSE ALARM • Smoke Alarm - ALARM CO2, ALARM CO, ALARM SMOKE • Water Flooding Alarm - ALARM WATER • Temperature Alarm - ALARM HEAT

    Since moving away from Zigbee and Philips Hue, I've been wanting to have my lights flash when certain events happen, such as alarm activations or other critical events.
    Well, with the help of some posts on this forum, some posts from indigo forums, and a lot of experimenting, I've finally got my lights flashing with a very simple script.

    I'm sure this will be of some value to people here.

    Note: As is, this will probably only work for the Fibaro Dimmer 2 & Switch 2, and I don't have any of the other devices to experiment with.
    However, it is likely that just one or two of the values will need to be changed in order for it to work with other Fibaro devices.

    Here is the script:

    Public Sub Main(ByVal Parms As Object)
    Dim B As Byte() = {&H71, &H5, &H01, &HFF}
    hs.PluginFunction("Z-Wave", "", "SendZwaveRaw", New Object() {22, B, B.Length, False, "132B8F352G7A"})
    End Sub​

    Replace '22' with the node id you want to activate by alarm frame.
    Replace '132B8F352G7A​' with the value from your z-wave.ini file in your config folder. Look for the value under IFace_0_Unique=
    To trigger a alarm frame, use '&HFF' as in the above example. To cancel an activated device, change that to '&H00'.

    So, once you run this script it will send an alarm activation frame to your Dimmer 2 or Switch 2 and make it flash, when you send a &H00, it will send a cancellation frame and the device will stop flashing.

    By default, the Dimmer 2 and Switch 2 has some parameters to control how alarm frames are handled, these parameters can be changed through the normal means in homeseer.
    Default settings will flash the lights for 600 seconds then stop themselves. So you don't neccesarily have to send a cancel frame, you can instead alter the time in which they will flash for. The other ways to cancel the alarm activation is by pressing the switch connected to your Dimmer 2 or Switch 2, assuming you have one, or sending an on / off command any other way, like through the HS interface or Alexa, etc. So there are many ways to effectively end the activation.

    Here is the excerpt from the Dimmer 2 manual, the Switch 2 may be different so check:

    Click image for larger version  Name:	dimmer2manual.jpg Views:	0 Size:	160.3 KB ID:	1585196

    Finally, the script above sends '&H01' which is actually a 01 meaning smoke alarm.
    If, for some reason, you wanted to send a different alarm frame such as smoke, you could change '01' to one of the following:

    00 General Purpose Alarm
    01 Smoke Alarm
    02 CO Alarm
    03 CO2 Alarm
    04 Heat Alarm
    05 Water Leak Alarm

    e.g. &H02 = CO Alarm, &H04 = Heat Alarm, etc.

    Note on Fibaro Switch 2:
    I found that my Switch 2 did not respond to the General Purpose Alarm Frame ( 00 ), you may find different. It may be firmware specific.
    To work around this I simply use 01 (&H01) for Smoke alarm frame which worked fine.

    The different alarm frame types and the associated configuration parameters, means that you could have different types of activations for different devices, which is quite useful.

    Final note for Dimmer v1 uses.
    I don't have an original Dimmer version 1, so can't try this code. But if you find the above does not work, try changing '&H5' with '&H6' and everything else the same.

    Have fun and let me know how you get on.​