Page 1 of 1

Blinds blocky

Posted: Tuesday 19 November 2019 20:34
by wouterlet
I used to switch my blinds at sunset. But my wife doesn't want them down before 19:30. So I tried to make a blocky that switches the blinds by sunset, but not before 19:30. In the attachement is my try that should work in my opinion, but nothing happens at 19:30.
Who has an idea?

Re: Blinds blocky

Posted: Thursday 21 November 2019 20:43
by wouterlet
I don't know if it helps, but in my logfile I see:

2019-11-21 20:03:00.422 Error: EventSystem: Lua script error (Blockly), Name: Gordijnen beneden_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: ')' expected near 'comparevariable'

I can't conclude what is wrong exactly, maybe you can?
Of course it's the part: time=sunset and (time=sunset>time=19:30)
Whithout that part it works find

Is there another way to write this?

Re: Blinds blocky

Posted: Thursday 21 November 2019 21:03
by tozzke
There are multiple things wrong with your blockly. E.G. you can't compare 2 times with each other (sunrise and sunset are nothing more than variable times depending on your location)
try doing it this way:
Image

I added the 'Blind 1 = Open' and 'Blind 1 = Closed' to prevent retriggering

Re: Blinds blocky

Posted: Wednesday 27 November 2019 23:08
by wouterlet
Thanks that was the trick. So no more comparing times. Thanks!