Conflict between actions?


#1

1) Give a description of the problem
Action doesn´t fire on work days

**2) What is the expected behavior?
If it is saturday or sunday and presence sensor 2 is present, the switch should come on at 07.30. This bit works
If it is a work day, presence sensor 2 is present and switch 4 is on, the switch should come on at 07.30. This bit doesn´t work.
If it is 20.30 the switch should turn off. This bit works.

3) What is happening/not happening?
On work days the switch does not turn on.

My guess is that there is a conflict between the 2 “on” actions, but cannot get my head around it.


#2

I believe the trigger happens, and then the “only on” part is evaluated. The top block will be evaluated, and if it isn’t the right day, the trigger will be ignored. It won’t trigger both blocks to see which should be run. I’d try changing the time on one of the blocks to 7:29 as that will create two different triggers. The other option is to have one if block that triggers every day, and then have an if check inside to see if it is the weekend or a weekday.


#3

Thanks.

Not sure I understand the second option, but will try the first one


#4

Option 2 would be something like this:

if time 7:30 and presence sensor 2 is present
then
  if $dayOfWeek is in range 6 to 7.   [Saturday or Sunday]
    or
     {$dayOfWeek is in range 1 to 5 and Switch 4 is on}. [note this needs to be a group condition]
  then
     turn on switch 2
  endif
endif
if time is 2030
then
  turn off switch 2
endif

Hope this makes sense.


#5

I thought $dayOfWeek was zero thru six, with Sunday = 0

For the weekend, the logic can be
IF $dayOfWeek is outside the range of 1 and 5


#6

Honestly, now I’m confused how this is defined. A quick search found another post from you saying it was 1-7 (Execute only on certain day (anytime)). Would help if these things were defined somewhere. I guess it deserves an experiment this weekend. I know Thursday showed as 4. Just not sure if Sunday is 0 or 7.


#7

I don’t remember the specifics off the top of my head… I’ll try to test this Sunday, LOL


#8

I forgot to check this on Sunday, but I found an old post from ady that states that Sunday = 0

Once I can confirm this for sure, I will edit and correct my other post.


#9

Thanks. I forgot to check also. Will set a reminder for this week.


#10

BTW, I finally remembered to do this today and $dayOfWeek definitely showed as 0 for Sunday.


#11

Hey thanks! I will update my other post from awhile back.