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


Activate a scene with the dimmer s2!


Recommended Posts

Guest Eduardo
Posted

Hello there.

I´m very newbie in Lua, and i´m trying to activate a "good night" scene with the dimmer s2.

I activated the parameter 41 and maded a new scene with the scripts below that i find it in the forum. But my doubt is, what is the next step.

Thanks in advance.

--[[

%% properties

35 sceneActivation

%% globals

--]]

local id= 35;

local name = fibaro:getName(id)

fibaro:debug(name);

local name = tonumber(fibaro:getValue(id, "sceneActivation"));

if (tonumber(fibaro:getValue(id, "sceneActivation"))==16)

then

fibaro:debug("1 click s1 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==26)

then

fibaro:debug("1 click s2 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==25)

then

fibaro:debug("3 click s2 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==15)

then

fibaro:debug("3 click s1 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==14)

then

fibaro:debug("2 click s1 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==24)

then

fibaro:debug("2 click s2 "..name);

elseif (tonumber(fibaro:getValue(id, "s2"))==24)

then

fibaro:debug("hold click s1 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==13)

then

fibaro:debug("release click s1 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==22)

then

fibaro:debug("hold click s2 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==23)

then

fibaro:debug("release click s2 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==10)

then

fibaro:debug("change from turn off to turn on s1 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==11)

then

fibaro:debug("change from turn on to turn off s1 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==20)

then

fibaro:debug("change from turn off to turn on s2 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==21)

then

fibaro:debug("change from turn on to turn off s2 "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==17)

then

fibaro:debug("up "..name);

elseif (tonumber(fibaro:getValue(id, "sceneActivation"))==18)

then

fibaro:debug("down "..name);

end;

Posted

Hi m8

something like this perhaps?

Please login or register to see this code.

Guest Eduardo
  • Topic Author
  • Posted

    Hi there Jonny!

    that was very helpfull! I just changed the ID dor the S2 and works perfectly!!!

    Thanks a lot!

    Regards

    Eduardo

    [ Added: 2014-03-31, 10:46 ]

    Can I activate a scene with s2 of a 1.8 dimmer???

    Join the conversation

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

    Guest
    Reply to this topic...

    ×   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.

    ×
    ×
    • Create New...