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

Help! I need with triggers of button device in LUA scene


Herni

Question

               Hi Everybody,

 

               I have a problem. I don´t know how distinguish between two different event triggers (T1 y T2 in the image attachment) of the button device in the same script. Could you help me? Thaks everybody. 

 

                                        Hernán

Please login or register to see this attachment.

Edited by Herni
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Its a long while programming a HC2, but I think you are making a scene for The Button?

I wrote an article about it: 

Please login or register to see this link.

Maybe that helps.

 

In short:

Catch the event:

Please login or register to see this code.

 

And check the presses:

Please login or register to see this code.

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi Joep,

     

    Thank for the answer. Great!! I didn´t know about the "keyAttribute" attribute to know how many times was the button pressed. Do you know where i could a document with the FIBARO API´s more complete than the attachment? Thank you very much. 

     

                                                  Hernán

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
    1 hour ago, Herni said:

    Do you know where i could a document with the FIBARO API´s more complete than the attachment?

     

    Use this forum. It's full of knowledge.

    Link to comment
    Share on other sites

    • 0
    On 5/19/2022 at 8:18 PM, Herni said:

                   Hi Everybody,

     

                   I have a problem. I don´t know how distinguish between two different event triggers (T1 y T2 in the image attachment) of the button device in the same script. Could you help me? Thaks everybody. 

     

                                            Hernán

    Please login or register to see this attachment.

    In the future to view the trigger's data just

     

    print(json.encode(fibaro:getSourceTrigger()))

    now you can see the trigger's full data.

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