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


  • 0

sceneActivation on Dimmer


CWestermark

Question

Hi,

 

I am trying to get the sceneActivation value back to 0 after a dimmer press. The below code gives 14 upon a double click on the dimmer. However, next time it reads local "sa = tonumber(fibaro:getValue(33, "sceneActivation"))" it gets 14 again. I would like it to get number 14 only upon the event of a double click on the dimmer. Can I achieve this by setting some parameter in the dimmer setting?

 

Basically I want to create a scene that triggers every time I press a dimmer. But not in between.

 

--[[
%% properties
%% events
%% weather
%% globals
0 sceneActivation
Time
--]]

 

local sa = tonumber(fibaro:getValue(33, "sceneActivation"))

fibaro:debug(sa)

 

if (sa == 14) then
   fibaro:debug('2clickon')

   sa= 0

end

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Well... the "sceneActivation" for device with id 33 is 14. And you're rewriting it to another variable called "sa". "sa" has no connection with original variable, just like rewriting text from one sheet of paper to another and then make some changes in this second one and be surprised that there are no changes on the first one. 

 

I don't think You can change the value of "sceneActivation" for the device, I think it's readonly. But you can try fibaro:setValue(33, "sceneActivation", 0) - but i don't think it will work.


You should to check if the device that triggered the scene is the one You want:

Please login or register to see this code.

 

I have no idea why You're using "0 sceneActivation". What device is the one with id = 0? And why it's under "%% globals" not "%% properties"

Does it really run when You doubleclick the dimmer?

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi, 

     

    ok thanks. It works partly, but it also triggers when another scene is calling upon the dimmer, which I do not want. I only want a trigger when I physically click the dimmer button. Now I also get a trigger from the following lines of codes from another scene

     

            fibaro:call(33, "turnOn")
            fibaro:call(33, "setValue", "100")

     

    Anyway to avoid that?

     

    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.

    ×
    ×
    • Create New...