Page 1 of 1

Hall lights

Posted: Monday 25 January 2016 23:08
by Ronnyboy
Hello
Can someneone tell me what i'm doing wrong with this blockly.

This is the log
21:59:58.221 Error: EventSystem: Lua script error (Blockly), Name: Hal verlichting na zessen_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: 'then' expected near 'comparevariable
And this is the blockly

Re: Hall lights

Posted: Monday 25 January 2016 23:12
by jvdz
Your time condition looks wrong. You have:
Time >18:00 < 23:59

Think that needs to be :
Time > 18:00 And Time < 23:59

Jos

Re: Hall lights

Posted: Monday 25 January 2016 23:26
by Ronnyboy
Changed it,but didnt work!

Re: Hall lights

Posted: Tuesday 26 January 2016 3:52
by nayr
If (Voordeurcontact = Open and (Time > (( 18:00 < 23:59) & (hal = Off)))

is what you have in your screenshot, totally invalid logic

You have your ands nested incorrectly, try something that looks like:

If - (vooordeurcontact = open) and (hal = off) and ((time > 18:00) and (time < 23:59))

Re: Hall lights

Posted: Tuesday 26 January 2016 13:33
by Ronnyboy
hmm.. tried that to,but no response!

Re: Hall lights

Posted: Tuesday 26 January 2016 14:35
by StanHD
Hi,

The top one is currently my working Blockly. I have edited it to the lower one to emulate your Blockly.
Image

Might help?

Re: Hall lights

Posted: Tuesday 26 January 2016 15:36
by Ronnyboy
strange,
where did you get that first "and" block from
i cant find it

Re: Hall lights

Posted: Tuesday 26 January 2016 17:46
by StanHD
Right Click the block & select "External Inputs". It works the same but I find it easier to understand when there are nested "And" / "Or" operators.

Re: Hall lights

Posted: Tuesday 26 January 2016 19:54
by Ronnyboy
YES that works !! Thank you very much!

Re: Hall lights

Posted: Wednesday 20 February 2019 11:46
by behave49
Having the same problem, can't see the solution image anymore.
Can someone help me out here

Re: Hall lights

Posted: Wednesday 20 February 2019 18:43
by jvdz
I would help when you post your script/blockly logic so we can see what is happening.

Jos

Re: Hall lights

Posted: Wednesday 08 May 2019 18:03
by behave49
Wow didnt see youre reply till now haha.

Here is my screenshot. What i want is to give me a notification if my dore is open at night.
I get this error..2019-05-08 17:46:59.429 Error: EventSystem: Lua script error (Blockly), Name: Nacht alarm deur open_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: 'then' expected near 'comparevariable'

I get this error with al my blocky scripts if i want to enter a time schedule

Re: Hall lights

Posted: Thursday 09 May 2019 11:20
by pvm
Using a time frame which passes the 0:00 barrier never worked for me.
I created a dummy switch, turn it on and off using timers and use that switch in blockly

Re: Hall lights

Posted: Thursday 09 May 2019 14:46
by behave49
I tried the time not passing 0:00 but the same error.
Can you tell me ( show me) how you solved that?

Re: Hall lights

Posted: Thursday 09 May 2019 16:37
by pvm
behave49 wrote: Thursday 09 May 2019 14:46 I tried the time not passing 0:00 but the same error.
Can you tell me ( show me) how you solved that?
Add dummy hardware
Add dummy switch
Set timer on that
In your blockly check switch == on

Do you have a specific question on this?

Re: Hall lights

Posted: Thursday 09 May 2019 16:57
by tozzke
You Blockly is wrong, make it like this:
Image

Your 'On' block is at the wrong location and timewise Domoticz looks at one day only. It can't be past 17:30 and at the same time before 5:30 on the same day, therefor you need to use 'or'

Re: Hall lights

Posted: Friday 10 May 2019 11:19
by behave49
I tried the "or" but did not work, same error

Re: Hall lights

Posted: Friday 10 May 2019 17:26
by tozzke
behave49 wrote: Friday 10 May 2019 11:19 I tried the "or" but did not work, same error
Could you show your Blockly? I think something else is still wrong. The 'Open' block in your opening post/first Blockly and the 'On' block in your second screenshot are both positioned incorrectly. As @nayr already said but you didn't follow his advice.