Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 1

How to make S1 on Dimmer 2 overriding scenes?


ollehlund
 Share

Question

I have three rooms with a Dimmer 2 in each. The dimmers are activated from motion detectors in each room. While cleaning I'd like to have the lights at full output and I have set parameter 19 to 90%. When activating the toggle switch the lights will go to 90% but when the motion sensor see a motion it will activate the scene dimming the lights to 8%. Is it possible to make S1 override all scenes as long as it is on? At the moment I turn the motion sensors towards the wall so they aren't activated but that is no sophisticated solution!

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

hi

you can do this by creating a variable eg motion with 2 values on and off

amend the scene to say that if motion is detected and the variable motion is on then turn lights to 8%

 

on the dimmer 2 change parameter 28 to 'functionaly activated' this enables scene activation.

 

then create a new scene that changes the motion variable from 'on' to 'off' and vice versa by scene activation. 

the codes that you need are:

 

toggle switch S1

10 is when OFF to ON

11 is when On to OFF

14 is when 2 x click (ie on/off very quickly)

 

hope this helps

 

Link to comment
Share on other sites

  • 0
11 hours ago, morpheus75 said:

hi

you can do this by creating a variable eg motion with 2 values on and off

amend the scene to say that if motion is detected and the variable motion is on then turn lights to 8%

 

on the dimmer 2 change parameter 28 to 'functionaly activated' this enables scene activation.

 

then create a new scene that changes the motion variable from 'on' to 'off' and vice versa by scene activation. 

the codes that you need are:

 

toggle switch S1

10 is when OFF to ON

11 is when On to OFF

14 is when 2 x click (ie on/off very quickly)

 

hope this helps

 

 

(c) by Sank

 

--[[
%% properties
467 sceneActivation
%% events
%% globals
--]]

function dump(o)
   if type(o) == 'table' then
      local s = '{ '
      for k,v in pairs(o) do
         if type(k) ~= 'number' then k = '"'..k..'"' end
         s = s .. '['..k..'] = ' .. dump(v) .. ','
      end
      return s .. '} '
   else
      return tostring(o)
   end
end

----------------------------------------- 
--   SCENE ACTIVATED BY DIMMER SWITCH  --
-----------------------------------------

-- Making sure that only one instance of the scene is running.
if (fibaro:countScenes() > 1) then
  fibaro:abort();
end
    
-- setup some local variables
local startSource = fibaro:getSourceTrigger();
-- print(dump(startSource))
local deBug = true;

-- MAIN CODE ---------------------------------------------------------
if startSource['type'] == "property" then
  local devID = tonumber(startSource["deviceID"])
  local ButtonPressed = fibaro:getValue(devID, "sceneActivation")
  if     ( tonumber(ButtonPressed) == 16) then -- pressed 1 click
        local state = tonumber(fibaro:getValue(devID, "value"))
        local current = fibaro:getGlobal("DutyLighting")
        if state > 0 then
            if current == "ON" then
                fibaro:setGlobal("DutyLighting", "AUTO")
            else
                fibaro:setGlobal("DutyLighting", "OFF")
            end
          else
            fibaro:setGlobal("DutyLighting", "ON")
          end
        if deBug then fibaro:debug("1 click") end;
  elseif ( tonumber(ButtonPressed) == 14) then -- pressed 2 clicks
          --fibaro:startScene(7); -- run scene to turn off garden lights 
        if deBug then fibaro:debug("2 click") end;
  elseif ( tonumber(ButtonPressed) == 15) then -- pressed 3 clicks
        if deBug then fibaro:debug("3 click") end;
  elseif ( tonumber(ButtonPressed) == 12) then -- pressed hold down
        if deBug then fibaro:debug("holding down") end;
  end
else
      fibaro:debug("Scene activated manually so nothing to do");
end
 

 

sorry, attaching code/files doesn't work anymore

@T.Konopka

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Thank you both for your promt response! As I am new to Fibaro and haven't used LUA code earlier I will dig into creating this variable to use together with graphic blocks.

    It's a learning process made easier with the help of you guys!

    Link to comment
    Share on other sites

    • 0
    1 hour ago, ollehlund said:

    graphic blocks.

    you can't use sceneActivation in blocks. no functionality here.

    Link to comment
    Share on other sites

    • 0
    25 minutes ago, 10der said:

    you can't use sceneActivation in blocks. no functionality here.

    As long as sceneActivation is enabled for that dimmer then you can choose that function from graphical block scene

    Link to comment
    Share on other sites

    • 0
    3 minutes ago, 10der said:

    good to know. you right! I never used blocks, if honesty :)

    I need to use for clients who have HCL and not HC2. We are all always learning from each other. The power of forums!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 23 minutes ago, morpheus75 said:

    As long as sceneActivation is enabled for that dimmer then you can choose that function from graphical block scene

    Sorry for my silly questions but I'm totaly new to this! I have the sceneActivation enabled for the dimmer and now I can choose the function. But what value should I insert in the green block "Scene Activation"?

    Link to comment
    Share on other sites

    • 0

    toggle switch S1

    10 is when OFF to ON

    11 is when On to OFF

    14 is when 2 x click (ie on/off very quickly)

    Link to comment
    Share on other sites

    • 0
    1 hour ago, morpheus75 said:

    toggle switch S1

    10 is when OFF to ON

    11 is when On to OFF

    14 is when 2 x click (ie on/off very quickly)

    btw has com.fibaro.FGD212 another values :(

    Link to comment
    Share on other sites

    • 0
    On 10/23/2019 at 11:33 AM, 10der said:

    btw has com.fibaro.FGD212 another values :(

     

    here is the full list of scena Activation codes for the Dimmer 2 module:

     

    Momentary switches

    SCENE ID: S1 input 
    16 : 1 x click
    14 : 2 x click
     - : 3 x click
    12 : hold
    13 : release

     

    SCENE ID: S2 input
    26 : 1 x click
    24 : 2 x click
    25 : 3 x click
    22 : hold
    23 : release

    ================================
    Toggle switches

    SCENE ID: S1 input 
    10 : OFF to ON
    11 : ON to OFF
    14 : 2 x click
     - : 3 x click


    SCENE ID: S2 input
    20 : OFF to ON
    21 : ON to OFF
    24 : 2 x click
    25 : 3 x click


    =================================
    Roller blinds switches

    SCENE ID: S1 input 
    10 : turn ON (1 x click)
    13 : release
    14 : 2 x click
     - : 3 x click
    17 : brightening

     

    SCENE ID: S2 input
    11 : turn OFF (1 x click)
    13 : release
    14 : 2 x click
    15 : 3 x click
    18 : dimming

    Edited by morpheus75
    update
    • Like 1
    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

     Share

    ×
    ×
    • Create New...