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

Moderator: leecollings

Post Reply
DoMoney
Posts: 8
Joined: Friday 21 December 2018 11:09
Target OS: Windows
Domoticz version:
Contact:

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

Post 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 813 times
but it doesn't work at all, if I will delete one "and", all is working fine.
Please advice.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

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

Post 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)
The most dangerous phrase in any language is:
"We always done this way"
welby
Posts: 36
Joined: Monday 20 November 2017 3:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Australia
Contact:

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

Post by welby »

Yep change the and between the times to OR. The time resets at midnight.
mrf68

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

Post 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.
welby
Posts: 36
Joined: Monday 20 November 2017 3:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Australia
Contact:

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

Post 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.
Attachments
Screenshot (2).png
Screenshot (2).png (11.11 KiB) Viewed 742 times
mrf68

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

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

Who is online

Users browsing this forum: No registered users and 1 guest