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

How to detect The Button in LUA?


janbe
 Share

Question

I've added my button to my HC2 system.

 

Please login or register to see this image.

/monthly_2018_07/button1.png.006964dac086279109b31e6ff7a8fee4.png" />

 

When I press the button, I see the icon of the device changing corresponding with the number of times I pressed the button. I can also assign actions to the device via magic scenes and they work fine. 

 

However, I cannot get a LUA script triggered by this button. I have tried adding value and CentralSceneEvent in the LUA header but the script does not get triggered.

 

Please advise.

Please login or register to see this code.

 

Please login or register to see this attachment.

Edited by janbe
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • I found the problem is not in the code but in the parameters of the LUA script. The <Run Scene> parameter should be set to Automatic, I had it set to Manual.

     

    Please login or register to see this image.

    /monthly_2018_07/button3.png.626322d12366439c687cf41358699cad.png" alt="button3.png.626322d12366439c687cf41358699cad.png" />

     

    The <Run Scene> parameter is a bit confusing to me, I originally thought Automatic ment that it would Autostart. Clearly this is not the case.

    Link to comment
    Share on other sites

    • 0
    On 7/18/2018 at 5:16 PM, janbe said:

    I've added my button to my HC2 system.

     

    Please login or register to see this link.

     

    When I press the button, I see the icon of the device changing corresponding with the number of times I pressed the button. I can also assign actions to the device via magic scenes and they work fine. 

     

    However, I cannot get a LUA script triggered by this button. I have tried adding value and CentralSceneEvent in the LUA header but the script does not get triggered.

     

    Please advise.

    Please login or register to see this code.

     

    Please login or register to see this attachment.

     

    Do you not get an error with that scene? A nil value error?

    Link to comment
    Share on other sites

    • 0

    @janbe

     

    Please login or register to see this code.

    Is the ID number from your button 114?

    If not change the number 114 to the ID number of your button. 

    If the first picture is you device then is this good.

     

    And trying to delite de line 114 value.

    You get

    Please login or register to see this code.

    Edited by Reinhold
    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...