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

Lua Scene Declaration issue


Question

Posted

Hello
Can anyone check below code and correct me if anything wrong, i am writing below code for condition like when it's between 6:50 to 22:00 in weekdays (Sunday to Friday) and trigger below 2 conditions are true like ID: 225 Thermostat mode to be cool mode and ID : 226 >=20 steady for more than 10 seconds then only execute function in ACTION TAB but in my case its triggering when ever ID:226 changes value >=20 instead of waiting for 10 seconds.

 

 

{
  conditions = { {
      isTrigger = false,
      operator = "match",
      property = "cron",
      type = "date",
      value = { "*", "*", "*", "*", "1,2,3,4,5,6", "*" }
    }, {
      conditions = { {
          isTrigger = false,
          operator = "match>=",
          property = "cron",
          type = "date",
          value = { "50", "06", "*", "*", "*", "*" }
        }, {
          isTrigger = false,
          operator = "match<",
          property = "cron",
          type = "date",
          value = { "00", "22", "*", "*", "*", "*" }
        } },
      operator = "all"
    }, {
      duration = 10,
      id = 226,
      isTrigger = true,
      operator = ">=",
      property = "value",
      type = "device",
      value = 20
    }, {
      id = 225,
      isTrigger = false,
      operator = "==",
      property = "thermostatMode",
      type = "device",
      value = "Cool"
    } },
  operator = "all"
}

7 answers to this question

Recommended Posts

  • 0
Posted

Try do nest the duration-criteria. 
I.e add { before and } after the duration

 

  • 0
  • Inquirer
  • Posted
    {
      conditions = { {
          {duration = 10},
          id = 226,
          isTrigger = true,
          operator = ">=",
          property = "value",
          type = "device",
          value = 20
        } },
      operator = "all"
    }

    still its triggering action without 10 seconds wait.
    • 0
    Posted
    13 minutes ago, Nadeem said:
     
          {duration = 10},


    Without the {}

    • 0
  • Inquirer
  • Posted

    i tried that in my first message and its working immediately without duration command time.

    • 0
    Posted

    In the first message you have a lot of other conditions

    • 0
  • Inquirer
  • Posted

    yes later i removed all and tested only triggered condition. which is 

    {
      conditions = { {
          duration = 10,
          id = 226,
          isTrigger = true,
          operator = ">=",
          property = "value",
          type = "device",
          value = 20
        } },
      operator = "all"
    }
    • 0
    Posted

    Perhaps a couple of errors

    try this: 

    isTrigger = false for ID: 226 → Prevents immediate execution on value change
    duration = 10 applies to the entire condition group → Ensures ID: 226 stays >= 20 for 10 seconds before triggering
    operator = "all" ensures all conditions are met before execution

     

    Please login or register to see this code.

     

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