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

Boolean scene logic


Cosworth32

Question

As you know we can do logical expressions in the scene editor. Some of my "expressions" were ugly to look at so I tried to optimize a bit.

Let's say we want to implement this expression:

Please login or register to see this code.

How could we do this HC2/HCL scene editor?

Please login or register to see this image.

/files/thumbs/t_abc1_663.png" alt="t_abc1_663.png" />

In this first graphic (abc1.png) a wrong example is displayed. The expression will evaluate to:

Please login or register to see this code.

This logic is not what we intended as C can cause the scene to run regardless of the 2 other variables. (This is because AND operators are processed before OR operators in general)

Second example implements the right expression in terms of the result:

Please login or register to see this image.

/files/thumbs/t_abac_191.png" alt="t_abac_191.png" />

But in reality we have implemented this:

Please login or register to see this code.

So how can we get the shorthand form in the scene editor? Well it turns out the yellow box containing the THEN clause can also act as an AND/OR clause:

Please login or register to see this image.

/files/thumbs/t_abc2_508.png" alt="t_abc2_508.png" />

Notice the subtle difference between image 1 and 3. the AND clause on a separate line actually implements a () around each section before and after. So here we have implemented this:

Please login or register to see this code.

On top of that it improves the readability of the expression. Unfortunately you have to delete everything after the THEN box before you can turn it into an AND/OR operator instead.

A curious "feature" in the scene block builder is this expression that you can build

Please login or register to see this code.

Now I have no idea what that will do as it literally defies logic :-)

Anyway - Hope this post helps someone out there.

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

4 answers to this question

Recommended Posts

  • 0

Thanks , great finding

[ Added: 2014-05-02, 15:14 ]

I just tried this to fix all my lights / xbmc status scenarios , before that they were going crazy .

I can't believe that Fibaro team doesn't have these written somewhere , i begin to doubt they even know about it .

Link to comment
Share on other sites

  • 0

Hello,

We are constantly working on Fibaro advanced tutorials. In following editions we would like to include such hidden options like you have described above. Thank you for sharing your knowledge at forum.

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