Page 1 of 1
Closing blinds partly with blocky
Posted: Tuesday 22 March 2016 14:54
by franzel
@ all
I'd like to close a blind somewhere halfway, depending a specific circumstance or at a specific moment. As I do not know how to do this in Lua I'd wanted to do this in blocky. I used the setup shown in the attachment. Unfortunately the blinds go fully down and doesn't stop after 5 sec.
The only thing I'd like to do is starting closing the blinds and after 5 seconds the motor should stop so the blinds are partly closed. When I do this by hand, this works perfectly.
What am I doing wrong?

- Knipsel.PNG (10.86 KiB) Viewed 4414 times
Re: Closing blinds partly with blocky
Posted: Tuesday 22 March 2016 16:37
by StanHD
Please confirm:- On = Close? Off = Stop?
If that is the case then you need:-
Set <logeerkamer> = <On>
Set <logeerkamer> = <Off> After <5> Seconds
Please note that you must not use a "Time" block for the seconds. Use a standard "integer" block.
Re: Closing blinds partly with blocky
Posted: Tuesday 22 March 2016 17:37
by capman
Just change the "Off" command to "On". It works for me.
Set <logeerkamer> = <On>
Set <logeerkamer> = <On> After <5> Seconds
Re: Closing blinds partly with blocky
Posted: Tuesday 22 March 2016 17:52
by franzel
Thanks for the reply.
I think I already tried this scenario but I'm not certain. I definitely try it out ASAP and let you know.
Re: Closing blinds partly with blocky
Posted: Tuesday 22 March 2016 19:17
by franzel
I just tried several scenes with different modes, and finally it works as I wished it to work.
Thanks to both of you for your help.
Now I've learned the basic features. I had to pick the latest offered option, so twice 'on'. Otherwise the blinds went right back up.
Now I can order the UV sensor which I will use to trigger the blinds. I just have to play a bit with the numer of seconds.

- Knipsel.PNG (10.52 KiB) Viewed 4378 times
I'm going to experiment with two or three criteria and, depending the UV rate, the time of the day and the date, the blinds will go down for 10-100%. I'm sure this will take a while, but eventually I will succeed.

Re: Closing blinds partly with blocky
Posted: Sunday 27 March 2016 15:33
by franzel
I played a bit with a UV sensor in combination with my previous blocky scenario but unfortunately did doesn't work.
What I would like is the following.
Depending the amount of UV, for instance more then 0.3, and the time is between 12:00am and 06:00PM the blinds should go down for about 50%. The % has been taken care of by the number of seconds after the second 'on' command. In case the sun goes down for about 5 minutes, nothing should happen. In case the sun goes down for let's say 15 minutes, the blinds should go up again.
To do this I thought I just have to read the value of the UV sensor which is the criterium for going down and adding some time limits. Unfortunately I didn't succeed in doing this properly.
To prevent, that the blinds continuous go up and down again there should also be a way which I do not know.
It appears that I still have much to learn concerning blocky.
Who can assist me how to do this in blocky?
Re: Closing blinds partly with blocky
Posted: Sunday 27 March 2016 15:49
by franzel
This is how I did it, hoping this would work.

- event.png (17.41 KiB) Viewed 4306 times
Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 15:09
by franzel
Meanwhile this blocky works partly. The blinds go down at the desired level, but after a few minutes, the action is repeated so after three cycles, the blinds are completely down.
Can anyone assist me how to prevent that the blinds go fully down and go fully up at a certain time?

- Knipsel.PNG (11.26 KiB) Viewed 4283 times
Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 15:48
by StanHD
How about:-
If [UV] > 0.2 And User Variable = 0
Do Set Device = On
Set Device = On After 10 seconds
Set User Variable = 1
Else If [UV] < 0.1 And User Variable = 1
Set Device = Off
Set User Variable = 0
Just using a variable to stop the loop. (Also a 0.1 "Dead Band" to prevent rapid cycling.)
Worth a try?

Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 15:58
by franzel
Certainly I'll give it a try.
Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 16:37
by franzel
I made the following changes. I added the user variable which initially is 0.

- Knipsel2.PNG (27.68 KiB) Viewed 4272 times
If I understand it right the first loop checks the variable which has been changed from 0 to 1. So no second action is initiated.
As soon as the UV value has decreased below 0.2 the blinds will go up. At least that's how it looks to me.
(Also a 0.1 "Dead Band" to prevent rapid cycling.)
This, I don't understand how I should create the delay.
Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 16:42
by franzel
I forgot to thank you. Stupid me.
Your tips really helped me on the right way.
Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 16:55
by StanHD
The "Dead Band" is the difference between closing at say >0.2 and not opening again until say <0.1. So if you leave both values at 0.2, then tiny changes about the set-point may cause the blinds to keep cycling up and down. (may not be needed, testing will sort it out)
Typical situation:-

Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 18:31
by franzel
I think I know what you're trying to explane.
Meanwhile I added a timetable during which the action should take place. That's the time the sun really gets annoying when it shines on my flatscreen.

I think it looks ok to simulate that I'm home as I'm actually away from home.

- planning.png (44.53 KiB) Viewed 4256 times
Re: Closing blinds partly with blocky
Posted: Wednesday 30 March 2016 18:43
by StanHD
Looks good. Let us know how it goes.

Re: Closing blinds partly with blocky
Posted: Thursday 31 March 2016 15:06
by franzel
This afternoon I noticed that I have to play a bit with the values or add another criterium. I noticed that the amount of UV isn't equal to the amount of actual direct sunlight. Today there is hardly no sun but the blinds went halfway anyway due to a value of > 4. The upper value has to be adjusted to a threshold value of about 5 and the lower threshold about 2. At least that's what I think. Just to simulate I'm at home these seem to be the right values.
I plan to add another thing. A kind of random number which takes care that the blinds go to a different level every time. That's another challenge I think.
