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
Question
Cosworth32 0
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.
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.