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

HC3 - Scene with date range over year change (winter)


Question

Posted (edited)

Hello everyone,
I have created a scene to run at 5AM in "winter" i.e. from November 15th to March 15th.
So the end of the range is somehow "before" the start because it spans over 2 different years:

Please login or register to see this attachment.

However it is triggered despites we are after March 15th (April 2nd 2025 today).

I have another scene from June 1st to September 1st which works just fine.

I tried to convert it to LUA and it created this:

 

{
  conditions = { {
      isTrigger = true,
      operator = "match",
      property = "cron",
      type = "date",
      value = { "00", "05", "*", "*", "*", "*" }
    }, {
      conditions = { {
          isTrigger = false,
          operator = "match<=",
          property = "cron",
          type = "date",
          value = { "0", "0", "15", "11", "*", "*" }
        }, {
          isTrigger = false,
          operator = "match>=",
          property = "cron",
          type = "date",
          value = { "59", "23", "15", "3", "*", "*" }
        } },
      operator = "any"
    } },
  operator = "all"
}
 
which looks suspicious to me because I understand it defines the exact opposite of the date range in the year. I am understanding it right ?
Has anyone faced a similar issue with date range spanning over 2 years ?

Thanks in advance !
Edited by Erwan_R1

5 answers to this question

Recommended Posts

  • 0
Posted

It looks like a classic "time span" bug.

One could have got around it by specifying after 11 or before 3, but then there is no way to group the OR vs the AND.

I believe that in the lua scene you can have more nested conditions, but I haven't tested it.

  • 0
  • Inquirer
  • Posted (edited)

    I have changed it for the LUA version where I inverted the operator, I believe it should do the job:

    {

      conditions = { {
          isTrigger = true,
          operator = "match",
          property = "cron",
          type = "date",
          value = { "00", "05", "*", "*", "*", "*" }
        }, {
          conditions = { {
              isTrigger = false,
              operator = "match>=",
              property = "cron",
              type = "date",
              value = { "0", "0", "15", "11", "*", "*" }
            }, {
              isTrigger = false,
              operator = "match<=",
              property = "cron",
              type = "date",
              value = { "59", "23", "15", "3", "*", "*" }
            } },
          operator = "any"
        } },
      operator = "all"
    }
     
    Thinking again on the original generated version, I believe it would have run every day actually :
    Any day in the year is before November 15th OR after March 15th - isn't it ?
    Should I create a ticket on Fibaro support ?
    Edited by Erwan_R1
    • 0
    Posted

    I have the same issue with a date range not working.

     

    Scene should not be running now, but continues to run outside of date range after 04/04

     

    {
    conditions = { {
    isTrigger = true,
    operator = "match",
    property = "cron",
    type = "date",
    value = { "00", "16", "*", "*", "*", "*" }
    }, {
    conditions = { {
    isTrigger = false,
    operator = "match<=",
    property = "cron",
    type = "date",
    value = { "0", "0", "6", "10", "*", "*" }
    }, {
    isTrigger = false,
    operator = "match>=",
    property = "cron",
    type = "date",
    value = { "59", "23", "4", "4", "*", "*" }
    } },
    operator = "any"
    } },
    operator = "all"
    }
     
     
    • 0
  • Inquirer
  • Posted
    24 minutes ago, Cam Aus said:

    I have the same issue with a date range not working.

     

    Scene should not be running now, but continues to run outside of date range after 04/04

     

    {
    conditions = { {
    isTrigger = true,
    operator = "match",
    property = "cron",
    type = "date",
    value = { "00", "16", "*", "*", "*", "*" }
    }, {
    conditions = { {
    isTrigger = false,
    operator = "match<=",
    property = "cron",
    type = "date",
    value = { "0", "0", "6", "10", "*", "*" }
    }, {
    isTrigger = false,
    operator = "match>=",
    property = "cron",
    type = "date",
    value = { "59", "23", "4", "4", "*", "*" }
    } },
    operator = "any"
    } },
    operator = "all"
    }
     
     

    Just change the operator like I did.

    • 0
    Posted

    Thanks, will give it a try.

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