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

Manually scene does not evaluate condition


Question

Posted

Hello everyone,

 

I have the following variable that tells me the state of the day Day(Día)/Night(Noche). Which is established by other scenes (Right now they do not work due to the bug of sunshine/sunset of the scenes by blocks).

Please login or register to see this image.

/monthly_2020_11/image.png.effd06e405ca27b5ffe7e93b67ba1e4d.png" />

 

And I have created this scene: "if it's night turn on the garden lights."

1088728221_Capturadepantalla2020-11-30alas14_41_56.png.3ef4cfbe407363ec592000d9c97a9e48.png

 

The scene is executed manually (not trigger), in fact the most common is that it is executed within other scenes to avoid rewriting the code.

Example:

842179590_Capturadepantalla2020-11-30alas14_45_24.png.bb02f2e600cb6af4bdf7dbc8c773e9e1.png

 

The problem I see is that whenever it is executed it turns on the lights, that is, it does not adequately evaluate the condition of the variable "estadoDia == Noche".

 

Any idea why the condition is not being evaluated?

 

Thanks!

9 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    any idea? Thanks!

    • 0
    Posted
    On 11/30/2020 at 2:53 PM, Juanjo said:

    And I have created this scene: "if it's night turn on the garden lights."

    Please login or register to see this link.

     

    Somehow your scene doesn't show up, the picture is empty

     

     

     

    • 0
  • Inquirer
  • Posted

    and now, does it look right?  thank you very much for advising!

    Please login or register to see this attachment.

    • 0
    Posted (edited)

    @Juanjo

    If you manually trigger a scene it wil always run.

    It simply ignores the trigger, obvious because you trigger it manually.

    Edited by akatar
    • 0
  • Inquirer
  • Posted

    Thank you very much for you answer @akatar.

     

    Indeed, if I trigger the scene manually, it should run, but my doubt comes if the condition that I indicate is not fulfilled, the actions should not be executed.  It doesn’t matter if I manually-execute the scene, right? Since in this example the action is executed even without fulfilling that condition.

     

    If we think about programming, if I have an IF and the condition is not met, its content is not executed.

     

    The objective that I seek with this type of scenes is to separate the IF conditions and be able to reuse them in other scenes.  Being able to nest scenes as I show below:
     

    Please login or register to see this attachment.

    • 0
    Posted

    @Juanjo

    Normally the scene runs automaticly, if the trigger is correct, the action will be executed.

    However, if you choose: run scene, the scene will run.

     

    so, in stead of: if trigger is true, execute action, you choose to run action, and ignoring the trigger

    it works as it should.

     

    sorry, i can not explain it easyer then this.

     

     

    • 0
  • Inquirer
  • Posted

    I think I understand you @akatar, but you are talking about the trigger, and in this case the trigger check is not checked. So it is a condition only, the trigger would be manual execution.


    The part of running the scene that I mention is within another scene, I try to explain it to you in text mode.
     

    I have a scene that when it runs it opens a door.  And what I want is to create a "subscene" that runs inside the previous scene that checks if it is night or not, and if it is, it also turns on the lights.
     

    Until now on my HC2 I have been doing it with LUA scenes and placing an IF in the middle.  But that code of "if it's night turn on the light" I had repeated in almost all the scenes, and for that alone they were all written in LUA. If I can properly evaluate this condition (without it being a trigger) I will get scenes that allow me to reuse the code.

     

    Do you think there is a solution to do this with the block scenes?

     

    Thanks a lot!

    • 0
    Posted (edited)

    @Juanjo

    ofcourse, with variable

    example: light can not turn on between 22:00 and 7:00 hours

    create varaible: nightmode (or something like that) with on and off

    scene1: if timne = 22:00 then variable nightmode on

    scene 2: if time = 07:00 then variable nightmode off

     

    main scene

     

    if <this happens>>

    and nightmode is off

    then <do this>

     

     

    Edited by akatar
    • 0
  • Inquirer
  • Posted

    @akatar
    Indeed, it is exactly how I do it to know if it is night or day.

     

    The problem is that with that main scene that you propose, I have to have two block scenes:

    1- If <this happens> and nightmode is off.

    2- If <this happens> and nightmode is on.

     

    With my approach I would only need one scene: If <this happens> and when it is executed that evaluates the subscene that it would allow, only if it is night to turn on the lights.


    Following your example, it would look something like this, what am i trying:

     

    scene1: if timne = 22:00 then variable nightmode on

    scene 2: if time = 07:00 then variable nightmode off

    subscene: if nightmode is off then turn light off

     

    main scene

     

    if <this happens>

    then <do this>

    <subscene>
     

    In this way, it is not necessary to have two scenes, one for day and one for night, and we would only have a "subscene" block to include all the actions for the night, and it could be used in any scene.

     

    • Like 1

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