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

Virtual Device - Scene in a button


pnutp0wer

Question

Hi, 

 

I integrated my mechanical ventilation system with a RGBW Controller into FIBARO and want to control it by a Virtual Device.

I made a VD with a couple of lines and buttons to set a certain mode for a certain time period. 

 

I added LUA per button but it doesn't seem to work correctly. What I want is that if I press one of the 50% buttons, the ventilation goes this mode for X minutes and than go back to 25%. 

When I add "IF" and "THEN" in the button it's not changing to 50%, but if I remove that the time frame does not seem to work. 

 

Anybody who can help me with this? ?

 

Please login or register to see this image.

/monthly_2019_10/image.png.02b8c2def3c304442222c7fd073940e0.png" /> 

 

Please login or register to see this attachment.

 

 

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

JFYI:

as I know VS works in locally isolated LUA env. also VD works in its own loop. and last, as I know setTimeOut in VD's (in VD buttons also) works incorrectly.

  • Like 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • 23 minutes ago, 10der said:

    JFYI:

    as I know VS works in locally isolated LUA env. also VD works in its own loop. and last, as I know setTimeOut in VD's (in VD buttons also) works incorrectly.

     

    Thank you for the reply. What is your suggestion to realize the solution? 

    Edited by pnutp0wer
    Link to comment
    Share on other sites

    • 0

    idk, maybe i will use call scene on click button

    or ... in VD main loop catch button press

    for example on press button set specific lable for iit fibaro:call(selfId, "setProperty", "ui.lblBlaBla.value", "Waiting..."))

    [skipped]

     

    local deviceState, deviceLastModification = fibaro:get(selfId, "ui.lblBlaBla.value")

    if (os.time() - deviceLastModification) > 60 * 15 then

     fibaro:debug("Yarrrr!")

     fibaro:call(selfId, "setProperty", "ui.llblBlaBla.value", os.date("%Y-%m-%d %H:%M:%S"))

    end

    Edited by 10der
    Link to comment
    Share on other sites

    • 0
    9 hours ago, Jamie mccrostie said:

    What about just using Fibaro:sleep()

    Sleep freezing thread if it’s ok - sure 

    Link to comment
    Share on other sites

    • 0

    So, what have you done? From my point of view, the best solution would be to use a call scene on the click button, just like  10der@  described above. You would only have to set a specific label for IIT fibaro:call on the press button. For me, it sounds like the best idea. If you found another way to do this, please tell me how you did it. I'm also working on integrating something with an RGBW Controller into FIBARO, and I don't know how to do it correctly. It's a new project for me, and I have to finish it by the end of the following week. We are also working on a website for this project. We've already contacted

    Please login or register to see this link.

    and approached them for their mockups. I hope I'll be able to finish it in time.

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