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

Scene ignores global variable and always runs


Question

Posted

Hello all,

 

It's my first post!  New Fibaro user.  I have an HCL and have been building some automation, using block scenes.  Please can you help me figure out this situation? 

 

1) A global variable "IsDark" has values 0 and 1.

2) A scene "IsDark Sunrise" runs continuously and sets IsDark=0 at sunrise.

3) A scene "IsDark Sunset" runs continuously and sets IsDark=1 at sunset.

4) A scene called "Front Door Opened" is triggered by the front door opening.  It sends a push notification and then executes another scene called "Lights on when dark".

 

All of this seems to work fine...  The value of IsDark changes at the correct time of day and the push notification is received when the front door opens.  All good so far. 

 

BUT:

 

5) The scene "Lights on when dark" is only called by the "Front Door Opened" scene, no triggers, it shouldn't run at any other time.  The purpose of this scene is "if IsDark=1, then turn on some lights [else do nothing]".

 

But I find that the lights turn on every time I open the door, regardless of the IsDark value.  The "If" in the scene "Lights on when dark" is completely ignored, the lights always turn on. 

 

Please login or register to see this image.

/monthly_2018_12/image.png.c57ba6bc9fc2545cadda0b5154472201.png" alt="image.png.c57ba6bc9fc2545cadda0b5154472201.png" />

image.png.a61523e1c22b7bac9b54be778e93bd4f.png

 

As you see, I added IsDark2 (a Predefined variable) as an experiment to see if it makes any difference.

 

Please can somebody tell me why this scene ignores the variable and ALWAYS turns the lights on regardless of whether IsDark and IsDark2 are set to 0 or 1?

 

I'm sure I am missing something obvious.

 

Many thanks!!!!

 

3 answers to this question

Recommended Posts

  • 0
Posted

Hi
When you call a scene from another scene, the "if" conditions are ignored, so programming works.

 

To make the scene work, you should:
1) Activate automatically so that the scene is triggered automatically.
2) Insert over "Then"  -  frontdor "breaked" and mark with the fly in triggering

 

Now the scene will run when frontdoor is breaket and isdark = 1 and isdark2 is = 1

You may need to delete the other scene, "front door opened". :)

  • 0
  • Inquirer
  • Posted

    Hi and mange tak @hTiger1 that's very helpful.  I did not realise that the "if" conditions are ignored when you call a scene from another scene. Of course, that explains the behaviour I experienced.

     

    I updated "Lights on when dark" to include the "front door = breached" condition and set it to automatic, with the front door as a trigger.   I kept the other scene, "front door opened", because I want it to send me the notification regardless of the value of IsDark.  I removed IsDark2 from all scenes.

     

    Did this by remote admin and will test it when I get home later.  Thanks again!

    • 0
  • Inquirer
  • Posted

    Seems to be working well!  

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