First Look: ZEN12 Motion Dimmer

Having the ZEN12 connected to the home office ceiling lights for a short time now has, not unexpectedly, resulted in a comment that, “I don’t want the office lights to come on late at night and wake me up when all I want to do is plug in my iPad to charge and go back to bed!” (We have an 8-port charger on the desk in our home office where we can plug in devices & gadgets for charging.)

In an earlier post, I discussed changing the color of an LED on a ZEN32 Scene Controller when our house switched into “night mode” (profile) when we push the button at bedtime. Why not leverage that Lua Scene we already have to tweak some of the ZEN12 Motion Dimmer settings?

As a result of that demented thought, I ended up with the following code added to the ACTIONS section of the previously discussed Lua Scene. It’s job is to do the following:

  • Disable the action of turning on the light upon detection of motion,
  • Change the main LED color to RED during the nighttime,
  • Set the LED to be “always ON,” regardless of the state of the office lights, and
  • undo all of the above when morning comes & we switch back into ‘Home’ mode.

Here’s the additional Lua code for the scene…

-- Set ZEN12 Motion Dimmer Options per Location Mode
local md = 410      -- Motion Dimmer Device ID

-- Set Main LED to Red & Disable Motion for Night Mode
if mode == "Night" then
    fibaro.call(md, "setConfiguration", 13, 1, 1) -- disable motion switch
    fibaro.call(md, "setConfiguration", 1, 1, 3)  -- alsways ON
    fibaro.call(md, "setConfiguration", 2, 1, 3)  -- color RED
else
    fibaro.call(md, "setConfiguration", 13, 1, 0) -- enable motion switch
    fibaro.call(md, "setConfiguration", 1, 1, 0)  -- LED ON when switch OFF
    fibaro.call(md, "setConfiguration", 2, 1, 0)  -- color WHITE (default)
end

In addition, having the LED blink when parameters are changed can be annoying. Zooz thoughtfully provides Parameter 23 to “Disable LED Indicator Flash On Setting Change.” Works well! :nerd_face:

We’ll see how that works out tonight. :grin:

4 Likes