Page 1 of 1

Time condition not working

Posted: Wednesday 20 September 2017 19:25
by Padster
Hi,

I've a Blockly that turns my hall light on and off dependent on movement and LUX. The brightness the light is set to should be 80% between 9am and 9pm and 60% outwith those hours.

The movement and LUX part of the script works fine but the light always comes on at 60%.

The system time is correct. Can anyone see what is wrong with my logic.
time.JPG
time.JPG (27.27 KiB) Viewed 1339 times

Re: Time condition not working

Posted: Wednesday 27 September 2017 16:37
by anno
you need the time also in else if

Re: Time condition not working

Posted: Wednesday 27 September 2017 17:10
by tozzke
Else if's in Domoticz (or in Blockly?) aren't "real" else if's, more something like or if's
So you'll have to add a time condition to the second part in this manner:
'and [[Time > [21:00]] or [Time <= [9:00]]'

when you pass midnight in a time condition, you'll have to use 'or' because Domoticz calculates with time on the same day. It can't be after 21:00 AND before 9:00 on the same day, therefore or :)

Re: Time condition not working

Posted: Friday 29 September 2017 10:44
by Padster
Thanks guys for the answer - its been driving me nuts.

Re: Time condition not working

Posted: Saturday 30 September 2017 15:47
by Lebo2d9
Hi
I use a dummy switch that is set by times and check the status of the switch in blockly.