open on/off screen for xx% - timing script
Posted: Sunday 01 November 2020 12:50
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?
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?