Time condition not working Topic is solved

Moderator: leecollings

Post Reply
Padster
Posts: 21
Joined: Friday 26 May 2017 20:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Time condition not working

Post 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 1292 times
anno
Posts: 36
Joined: Wednesday 01 March 2017 13:00
Target OS: Windows
Domoticz version: all
Contact:

Re: Time condition not working

Post by anno »

you need the time also in else if
long time domiticz user, running 8 domoticz installations on vm's nuc i3. And espeay hosting more than 30.
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Time condition not working

Post 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 :)
Padster
Posts: 21
Joined: Friday 26 May 2017 20:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Time condition not working

Post by Padster »

Thanks guys for the answer - its been driving me nuts.
Lebo2d9
Posts: 139
Joined: Tuesday 06 September 2016 20:39
Target OS: Raspberry Pi / ODroid
Domoticz version: L stab
Location: Belgium
Contact:

Re: Time condition not working

Post by Lebo2d9 »

Hi
I use a dummy switch that is set by times and check the status of the switch in blockly.
Domoicz on RPI3 (wifi) directly connected 3x ds18b20 for CV temp, Evohome (9 zone), 1 remote 220V switch based on ESP-12. RFXtrx433E, 16x AMST-606, 5 Somfy RTS motors
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest