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 'if then else' scenes


Angelus

Question

Hi, I've been using HC2 for about 10 years and while I'm not a programmer, I have gotten comfortable with HC2 over the years with all the great help and examples from this forum.

 

I recently moved to HC3 and the new way of writing LUA scenes really has thrown me in a loop.  There may be a super obvious answer but I can't figure out how I can write a simple scene that does one set of actions on one condition and another set of actions on another condition.

 

For example, when scene is triggered through double click on a switch, I would like to turn on light1, light2 and light3 if lux value is < 60, else turn on light4, light5 and light6.  

 

This was easily done in HC2 but i can't seem to get it to work in HC3.  Been searching through the forums but I can't seem to find a starting point.  Is there someone that can point me in the right direction to get started?  Thanks!  

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Any kind soul? I tried to add both conditions in the trigger section but not sure how to activate them

    Link to comment
    Share on other sites

    • 0

    @Angelus

    Hi, I'll give you a little hint:
    in the conditions for starting, put only the input condition (double-click). This will start the scene.
    In the action, write a condition that compares the value of lux. (if it is less than 60, turn on devices 1,2,3...) else turn on devices 4,5,6.

    The second option (if you don't want to think about the correct syntax of the launch conditions) is a combination of two scenes. For example, with a block scene, set a trigger condition (double-click) and add a new LUA as an action. The new LUA can be empty in conditions, and in actions you will have a condition with the value of lux, see above.

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