Page 1 of 1

Problem with Date Conditional Schedule Actions Firing

PostPosted: Fri Nov 01, 2019 5:40 pm
by sumocomputers
Problem with Date Conditional Schedule Actions Firing

I have some schedules that change variables at different times of the year. They are for my utility rates and have attached screenshots.

Schedule 1 (Summer) has a condition for "if current date is between June 1 & Oct 31"

Schedule 2 (Winter) has a condition for "if current date is between Nov 1 & May 31"

But looking through the log files:

Oct 30th: All schedule actions for Schedule 1 fired
Oct 31st: No schedule actions fired for Schedule 1 or 2
Nov 1st: No schedule actions fired for Schedule 1 or 2

Maybe I am misunderstanding how the date condition works, but sure could use some help tracking this down.

Re: Problem with Date Conditional Schedule Actions Firing

PostPosted: Sat Nov 02, 2019 1:17 am
by Sevilsivle
My first thought is that „between“ does not include the first and last date. So between 1st Nov and 31st May runs from 2nd Nov to 30 May.

Tim

Re: Problem with Date Conditional Schedule Actions Firing

PostPosted: Sat Nov 02, 2019 7:07 am
by sumocomputers
Sevilsivle wrote:
My first thought is that „between“ does not include the first and last date. So between 1st Nov and 31st May runs from 2nd Nov to 30 May.

Tim


I never considered that, but it makes sense now that you say it.

I am going to make some dummy schedules and test that theory over the next few days.

Thanks

Re: Problem with Date Conditional Schedule Actions Firing

PostPosted: Sat Nov 02, 2019 7:32 am
by autolog
The documentation for Conditions - Conditions - gives an explanation for the time being between 6:00pm and 11:00pm
This condition says that if the current time is greater than 6pm and less than 11:00pm then the actions will be executed.
So this doesn't include 06:00pm and 11:00pm. Which for time probably doesn't matter.

If the same logic is being applied to dates (no documentation explanation given AFAICS) then the start and end dates won't trigger the condition (which is what you are seeing).

It would probably be better if the condition "is between" was re-worded as "is between (exclusive)". Even better would be to add another condition that says "is between (inclusive)". :)

Re: Problem with Date Conditional Schedule Actions Firing

PostPosted: Sat Nov 02, 2019 10:15 am
by jay (support)
Sevilsivle wrote:
My first thought is that „between“ does not include the first and last date. So between 1st Nov and 31st May runs from 2nd Nov to 30 May.


This is correct. Think of it this way: on a plane row with 3 seats, the person in the middle seat is "between" the people on each side seat. A child that's sitting in the lap of one of the people on the sides isn't considered "between" the two end seats. ;)

Re: Problem with Date Conditional Schedule Actions Firing

PostPosted: Tue Nov 05, 2019 1:26 pm
by sumocomputers
jay (support) wrote:
Sevilsivle wrote:
My first thought is that „between“ does not include the first and last date. So between 1st Nov and 31st May runs from 2nd Nov to 30 May.


This is correct. Think of it this way: on a plane row with 3 seats, the person in the middle seat is "between" the people on each side seat. A child that's sitting in the lap of one of the people on the sides isn't considered "between" the two end seats. ;)


This all makes sense now.

I did try to create another condition for another trigger and wanted the value to be from 0 to 5, but inclusive of 0. I just used 2 conditions:

-between 0 and 6
-equal to 0

Is there a better way to do this? Can you use negative numbers? Like between -1 and 6?

Re: Problem with Date Conditional Schedule Actions Firing

PostPosted: Tue Nov 05, 2019 5:38 pm
by jay (support)
sumocomputers wrote:
Can you use negative numbers? Like between -1 and 6?


Yes, you can.