open on/off screen for xx% - timing script

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

Moderator: leecollings

Post Reply
renerene
Posts: 356
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

open on/off screen for xx% - timing script

Post by renerene »

My screen works with simple open/close action. Can not use the controller to set percentage.

It takes 10 seconds to close my screen. If I want it to be halfway I can stop the closing action action after 5 seconds.
Now i want to make a script to take this type of action to the next level. So, make a dummy device named 'setpointScreen' that holds the percentage of the screen position. I can set that dummy device in other scripts. For instance, set the screens halfway when it is sunny wheather, or open the bathroom window just a little bit when someone takes a shower and but it is freezing outside

Input parameters for the script
- device name (screen, window)
- dummy device for setpoint percentage
- total closing time

Things to consider
- the script needs to know current position of the screen. Specially if the screen has been operated manually in the mean while. This can be done by triggering the script on every action of the screen and monitor the on/off time. This time can be recalculated
- if operating time is longer total closing time, position can be reset to 0 or 100%. With lot of short actions following next to eachother, actual position may vary from digital position, because using the time measurements don't feel like accurate

Did some of you already made such a script?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: open on/off screen for xx% - timing script

Post by waaren »

renerene wrote: Sunday 01 November 2020 12:50 Did some of you already made such a script?
Check this post for a proof of concept. It turned out to be real pain to get it failsafe and I spent too much time on it to keep it fun to work on it.
Hope you have more succes.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest