Page 1 of 1

Error from blockly that is dysfunctional

Posted: Saturday 01 August 2020 14:38
by Solderbro
Hello,

this is from domoticz stable, my first blockly that throw an error instead of switching the plug.

2020-08-01 14:31:36.284 Error: EventSystem: Lua script error (Blockly), Name: BL Küchenventilator Cyrus_2 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: ')' expected near 'comparevariable'

Have never seen such an error from a blockly, what can be wrong?
blockly.png
blockly.png (31.51 KiB) Viewed 716 times
Solderbro

Re: Error from blockly that is dysfunctional

Posted: Monday 03 August 2020 14:31
by knielen
Both your if and your elseif have Sunrise = On. So both are always true.

Re: Error from blockly that is dysfunctional

Posted: Monday 03 August 2020 15:10
by waaren
knielen wrote: Monday 03 August 2020 14:31 Both your if and your elseif have Sunrise = On. So both are always true.
Not quite.. Sunrise and Sunset are times. So never 'On' or 'Off'

It should be something like
Sunrise.png
Sunrise.png (24.7 KiB) Viewed 682 times

Re: Error from blockly that is dysfunctional

Posted: Monday 03 August 2020 15:57
by knielen
waaren wrote: Monday 03 August 2020 15:10
knielen wrote: Monday 03 August 2020 14:31 Both your if and your elseif have Sunrise = On. So both are always true.
Not quite.. Sunrise and Sunset are times. So never 'On' or 'Off'

It should be something like

Sunrise.png
Aah indeed, always hard to see errors when not programming yourself ;)