Page 1 of 1

Double "and" with "if" doesn't work

Posted: Thursday 17 January 2019 23:25
by DoMoney
Hi.
I need to switch on the light by movement at the specified period of time. I have created the event:
Motion sensor question.jpg
Motion sensor question.jpg (35.29 KiB) Viewed 818 times
but it doesn't work at all, if I will delete one "and", all is working fine.
Please advice.

Re: Double "and" with "if" doesn't work

Posted: Friday 18 January 2019 0:36
by waaren
DoMoney wrote: Thursday 17 January 2019 23:25 Hi.
I need to switch on the light by movement at the specified period of time. I have created the event:
Motion sensor question.jpg
but it doesn't work at all, if I will delete one "and", all is working fine.
Please advice.
Time > 08:00 and Time < 01:00 are mutual exclusive

Re: Double "and" with "if" doesn't work

Posted: Friday 18 January 2019 8:36
by emme
I'm not clear about the time frame in which you want le light on...
Expect it would be from 8:00am to 1:00am (so it is 8:00 ==> 24:00 and 00:00 ==> 1:00)
I would try to revert the condition:

if Burglar = on AND (Time > 8:00 OR Time < 1:00)

Re: Double "and" with "if" doesn't work

Posted: Friday 18 January 2019 9:37
by welby
Yep change the and between the times to OR. The time resets at midnight.

Re: Double "and" with "if" doesn't work

Posted: Sunday 20 January 2019 12:57
by mrf68
welby wrote: Friday 18 January 2019 9:37 Yep change the and between the times to OR. The time resets at midnight.
If you only change then “and”, the alarm will go off any time after 8 am. You need to swap the Burglar=On block with Time>08:00 and then change the “and” to “or” between both time statements.

Re: Double "and" with "if" doesn't work

Posted: Monday 21 January 2019 7:51
by welby
mrf68 wrote: Sunday 20 January 2019 12:57
welby wrote: Friday 18 January 2019 9:37 Yep change the and between the times to OR. The time resets at midnight.
If you only change then “and”, the alarm will go off any time after 8 am. You need to swap the Burglar=On block with Time>08:00 and then change the “and” to “or” between both time statements.
Really because i have this one working ok.

Re: Double "and" with "if" doesn't work

Posted: Monday 21 January 2019 17:37
by mrf68
Really, it’s exact the same. You changed more than just the and to or, you rearranged some things that made it work.