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

Using variables as condition not working


Question

Guest olebor
Posted

I am trying to get a motion sensor to trigger a scene, but only if the time is within a specified range, eg between 1600 and 2300.

What I did to achieve this was to first create a variable called hour, then I create a scene that will increase this by 1 every hour and reset it to 0 at midnight. So far so good, the variable always have the right value i.e. var=6 between 6 and 7 in the morning etc.

Now I try to create a scene that is triggered by a motion detector and use the variable as an extra condition.

Please login or register to see this code.

This is not working. I have verified that it will run when I remove the hour conditions. It will also work if I use hour == 16 (will work only if the variable is actually 16). So it seems like evaluation with <, >, <=, >= does not work.

Has anyone else tried this?

4 answers to this question

Recommended Posts

  • 0
Posted

What is the version of your home center?

Best regards

  • 0
Guest olebor
  • Inquirer
  • Posted

    It is version 1.043.

    Has anyone else tried this at all?

    • 0
    Posted

    Waiting for the next version, you can do that now:

    First create variable "CanBeTrigerred" set value 0.

    Create one scene with day timer, check all days, set as one shot at 16hoo, add THEN block, choose variable CanBeTrigerred and set value 1.

    Create another scene with day timer, check all days, set as one shot at 23hoo, add THEN block, choose variable CanBeTrigerred and set value 0.

    Now you can use CanBeTrigerred as condition in all your scenes because CanBeTrigerred is automatically set to 1 when hour is between 16h00 and 23h00 and set to 0 otherwise

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    I use this technique in many case... Frost detection, motion detection etc.

    I hope the next version make easier ...

    • 0
    Posted

    Thank you Krikroff for the tip with the variabel, it helped me a lot for similiar scenes and understanding of the consept with variabels.

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