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

HC3 Call button from scene


Question

Posted (edited)

Hi,

How do i call a button from a scene in HC3

 

fibaro.call(48,"turnOn") only works in "main" window, but not if i make it inside a button window
can i call it by ID or function?

 

Old in HC2: fibaro:call(xxxxx, 'pressButton', '1') 

 

 

Edited by Sagittarius

4 answers to this question

Recommended Posts

  • 0
Posted
21 minutes ago, Sagittarius said:

Hi,

How do i call a button from a scene in HC3

 

fibaro.call(48,"turnOn") only works in "main" window, but in if i make it inside a button

 

Old in HC2: fibaro:call(xxxxx, 'pressButton', '1') 

 

 

 

 

See this thread: 

 

  • 0
  • Inquirer
  • Posted (edited)

    I try'd but i cant get it to work still

     

     

    ________

     

    From scene: 

    fibaro.call(48,"test","hejhejhej")
     
    In QA main lua window:
    function QuickApp:test(arg1)
        self:debug("TEST: ",arg1)
    end
     
    output: [DEBUG] 14.03.2020 15:26:13: TEST: hejhejhej
     
    So that is working..
     
    ------
    If i make an button called ON, an put in the Lua in the button window
    function QuickApp:on()
        self:debug("binary switch turned on"-- debugging method will work
    end
     
    and from a scene call: 
    fibaro.call(48,"on")
     
    nothing happens
     
    Edited by Sagittarius
    • 0
    Posted (edited)
    1 hour ago, Sagittarius said:

    I try'd but i cant get it to work still

     

     

    ________

     

    From scene: 

    fibaro.call(48,"test","hejhejhej")
     
    In QA main lua window:
    function QuickApp:test(arg1)
        self:debug("TEST: ",arg1)
    end
     
    output: [DEBUG] 14.03.2020 15:26:13: TEST: hejhejhej
     
    So that is working..
     
    ------
    If i make an button called ON, an put in the Lua in the button window
    function QuickApp:on()
        self:debug("binary switch turned on"-- debugging method will work
    end
     
    and from a scene call: 
    fibaro.call(48,"on")
     
    nothing happens
     

     

    I'm definately not a coder, so I could be very wrong, but you have added an argument for the function, but are not providing any argument in the scene call? Could it be a missing argument? For me this works (as in the link I sent):

     

    QuickApp main code (send an IR code):

     
     function QuickApp:btn_Power()
     self:send("sendir,1:3,1,37993,1,1,171,171,22,64,22,64,22,64,22,21,22,21,22,21,22,21,22,21,22,64,22,64,22,64,22,21,22,21,22,21,22,21,22,21,22,21,22,64,22,64,22,21,22,21,22,64,22,64,22,64,22,64,22,21,22,21,22,64,22,64,22,21,22,21,22,21,22,37000x0D0x0A"true)
    end
     
    QuickApp button:
    In the button for the QA (named btn_Power), I put:
     
    self:btn_Power()
     
    ---------------------------------------------------------------------------------
     
    Scene calling QuickApp button:
    In the calling scene, I put in this code:
     
    Conditions/Trigger:
     
    {
      conditions = {},
      operator = "all"
    }
     
    LUA main code:
     
    fibaro.call(213"btn_Power")
    Edited by robw
    • 0
  • Inquirer
  • Posted

    After new update all works again, thank you :) 

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