Wait for Blinds to be at level then set new level  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Nephylim
Posts: 23
Joined: Thursday 08 December 2016 11:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Wait for Blinds to be at level then set new level

Post by Nephylim »

Hi there,
I have a question regarding an event involving my venetian blinds.
I want to control them at to bes set to predefined levels like 25% blinds closed or 25% blinds open.

To be sure that the blinds are closed at 25% they have to come from a lower level.
For example if the blinds are at 75% and i set them 25% the flaps would be rotated open.

So to be sure that they are at 25% closed they have to go to a lower level first.

I made an event that looks like this

Code: Select all

if (dz.devices(Schalter).level == 10) then 
            if(dz.devices(Jalousie).level < 25) then
                dz.devices(Jalousie).dimTo(25).silent()
            else dz.devices(Jalousie).dimTo(20).silent()  at this point the next step should only be executed once this position is reached
                 dz.devices(Jalousie).dimTo(25).silent()
            end
the problem now is that the blinds always directly go to 25%.
To work correctly they should go to 20% wait till they are at 20% and then go to 25%

Can someone help me with that?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wait for Blinds to be at level then set new level

Post by waaren »

Nephylim wrote: Saturday 08 May 2021 12:29 To work correctly they should go to 20% wait till they are at 20% and then go to 25%
Can you try

Code: Select all

if (dz.devices(Schalter).level == 10) then 
    dz.devices(Jalousie).dimTo(25).silent()
else dz.devices(Jalousie).dimTo(20).silent()  at this point the next step should only be executed once this position is reached
    dz.devices(Jalousie).dimTo(25).silent().afterSec(10) -- adjust to your needs or change number to calculated value based on current level
end
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Nephylim
Posts: 23
Joined: Thursday 08 December 2016 11:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Wait for Blinds to be at level then set new level  [Solved]

Post by Nephylim »

thank you that works.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest