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

LUA Code On Quick App HC2


macrob86
 Share

Question

Hi

I have to understand the Quick app HC2 code to make the same app to HC3.

This Quick App control Multiroom AMCP MR4.50-XT - 4 Zones with Itach RS232 Serial Interface.

I do not understand where in the LUA Code call function like above:

local ID_VD = fibaro:getSelfId()

fibaro:call(ID_VD, "pressButton", "6")
fibaro:sleep(600)

fibaro:call(ID_VD, "pressButton", "16")
fibaro:sleep(600)

fibaro:call(ID_VD, "pressButton", "26")
fibaro:sleep(600)

fibaro:call(ID_VD, "pressButton", "36")
fibaro:sleep(300)

 

Where I need to looking for some information about this code?

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

The best way of doing this in a HC3 Quick App is using the following Timeout Command

 

fibaro.setTimeout(3000, function() self:SetCool() end)

 

This combines your two commands together, it delays the action by 3000 (3 Seconds) and then runs the SetCool QuickApp function 

 

An Example

 

function QuickApp:setThermostatMode

local Mode = Cool

if Mode = cool then

fibaro.setTimeout(3000, function() self:SetCool() end)

end

 

You would just need to change out the SetCool Command function with the Specific Functions you have set up, and you can call multiple of these Timeout functions in the same command

 

fibaro.setTimeout(1000, function() self:TurnOnl() end)

fibaro.setTimeout(3000, function() self:SetCool() end)

fibaro.setTimeout(5000, function() self:SetFan() end)

 

 

 

  • Thanks 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • Do you know Where can I find the reference of "pressbutton" 

    Is there anywhere to consult?

     

    I see the code use another way to switch on the device,

    I think it is a direct access.

    Link to comment
    Share on other sites

    • 0

    Look in the Quickapp manual for supports control 

    Please login or register to see this link.

     on how to handle button events. 

     

    I use for example this code for a "refresh" button

     

    Please login or register to see this code.

     

    (If necessary with a setTimeout() inside)

     

     

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