Page 1 of 1

Nightlights, on movement, between 20:35 and 06:45

Posted: Thursday 22 February 2018 21:27
by Falken
Hi!

I am very new to the Blockly universe, and even more new to the Domoticz automations system.

I am trying to create my first Blockly script, that I want to control a light scheme (Philips Hue) when movement is detected by a simple 433 mhz motion detector. It should only activate between 20:35 and 06:45.

WHAT am I doing wrong? I have redone this script 45 times, so if this result looks like complete bulls*it, my explanation is that I have re done it so many time that it broke.. :lol:

Re: Nightlights, on movement, between 20:35 and 06:45

Posted: Thursday 22 February 2018 21:57
by StanHD
Try:-

If [(Rorel....... = On) and (Time >= 20:35 Or Time <= 06:45)]

Note that you also have the second time set to greater, rather than less.




Re: Nightlights, on movement, between 20:35 and 06:45

Posted: Thursday 22 February 2018 21:58
by i000
Hi, you can change to this diagram:
If (Motion =on) and ( Time >XX or Time < XX)

Re: Nightlights, on movement, between 20:35 and 06:45

Posted: Friday 23 February 2018 15:34
by Domosapiens
Start with the AND block
see
https://www.domoticz.com/wiki/Blockly

Re: Nightlights, on movement, between 20:35 and 06:45

Posted: Friday 23 February 2018 16:27
by StanHD
Will this help?

The lower example uses "External Inputs" on the And block, which I find easier to understand. That's just a personal choice though. :)

Image

Re: Nightlights, on movement, between 20:35 and 06:45

Posted: Friday 23 February 2018 17:34
by markk

Re: Nightlights, on movement, between 20:35 and 06:45

Posted: Friday 23 February 2018 21:56
by Falken
StanHD wrote:Try:-

If [(Rorel....... = On) and (Time >= 20:35 Or Time <= 06:45)]

Note that you also have the second time set to greater, rather than less.
Haha, that's what I meant when I said I scripted it to s*it! I tried so many combinations not knowing what I was doing that it eventually broke.
StanHD wrote:Will this help?

The lower example uses "External Inputs" on the And block, which I find easier to understand. That's just a personal choice though. :)

Image
This does indeed help! It's working now!

Thanks to all of you who have responded. Great to know that this forum is out there with talented souls like your selves!

Skickat från min SM-G955F via Tapatalk