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

Global variable as trigger, is there a better way than mine?


jimicr

Question

Hi all,

 

I am building our first room using the HC3. Beining used to the HC2 it requires some thinking out of the box for me.

 

My question: I'm building a scene for the ventilation in the new bathroom.

I have a MS6 for RH and this part works.

 

Now my challenge: In the future I want all extraction fans turn on when there is a CO alarm. I made an enumerated with 2 "states": Safe and Breached.

To get the scene to act on the var change (now by a test scene) I am checking the variable in the condition/ trigger part as a non existing state: "off".

Is there a better/ cleaner way to do this?

Please login or register to see this code.

If I add a condition for "Safe" and "Breached" the scene isn't triggered.

 

This works, but it is a weird way to check variables for what you want to do IMHO.

 

Jim

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
31 minutes ago, jimicr said:

Hi all,

 

I am building our first room using the HC3. Beining used to the HC2 it requires some thinking out of the box for me.

 

My question: I'm building a scene for the ventilation in the new bathroom.

I have a MS6 for RH and this part works.

 

Now my challenge: In the future I want all extraction fans turn on when there is a CO alarm. I made an enumerated with 2 "states": Safe and Breached.

To get the scene to act on the var change (now by a test scene) I am checking the variable in the condition/ trigger part as a non existing state: "off".

Is there a better/ cleaner way to do this?

Please login or register to see this code.

If I add a condition for "Safe" and "Breached" the scene isn't triggered.

 

This works, but it is a weird way to check variables for what you want to do IMHO.

 

Jim

Maybe you could post a customEvent to trigger the scene instead?

Edited by jgab
  • Thanks 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • 17 minutes ago, jgab said:

    Maybe you could post a customEvent to trigger the scene instead?

    Thanks @jgab, will look into this.

     

    Didn't know that that was a possibility!

    Will come back here with the result.

     

    Jim

     

    **EDIT** Thanks @jgab it works! much to learn here

    Edited by jimicr
    Link to comment
    Share on other sites

    • 0

    I have the code below in a light scene. First check motion (that's the trigger), then the Lux value must be 100 or below, and the sleepstate variable should be false. Check your conditions, test setting the device to: isTrigger=false.

     

    {
      conditions = { {
          id = 79,
          isTrigger = true,
          operator = "==",
          property = "value",
          type = "device",
          value = true
        }, {
          id = 81,
          isTrigger = false,
          operator = "<=",
          property = "value",
          type = "device",
          value = 100
        }, {
          isTrigger = false,
          operator = "==",
          property = "sleepstate",
          type = "global-variable",
          value = "false"
        } },
      operator = "all"
    }
     
    -----------------------
     
    You might test:

    Please login or register to see this code.

    Edited by robw
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @robw My situation was different, I needed one var with 2 values and each value should trigger the scene.

     

    Did you try the solution I posted in the other thread?

     

    Jim

    Link to comment
    Share on other sites

    • 0
    10 minutes ago, jimicr said:

    @robw My situation was different, I needed one var with 2 values and each value should trigger the scene.

     

    Did you try the solution I posted in the other thread?

     

    Jim

     

    Ok, both had to trigger, I see, sorry.

     

    Thank's I just saw it :) I will test now. I've struggled with the iTach - how to press a button from a scene. Now that works. I'm getting a little more code in my head *L*

     

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