Page 1 of 1

control blinds with percentage switch and by time

Posted: Thursday 22 March 2018 15:15
by Crash123
I have installed my blinds and would like to control them by the percentage switch for open/close.
Has anybody a script which ask for the percentage in the dashboard and can translate this to a timeaction like 0% - > 0sec, 100% -> 10sec, 10% -> 1sec, ...

Re: control blinds with percentage switch and by time

Posted: Sunday 25 March 2018 12:21
by kniazio
I join the request.
+1

Re: control blinds with percentage switch and by time

Posted: Tuesday 27 March 2018 17:39
by DeBaat
Interested too.

I just installed Somfy blinds with RTS motors.
They can be controlled by the Somfy Telis remotes of which I have two different kinds.
One is a Pure which can open en close the blinds; tilting the blinds can be by stopping the movement just in the right moment.
The second one is a Mod/Var with an additional scrolling wheel which can be used to tilt the blinds more accurately.

Furthermore, I managed to mimic the Pure remote behaviour with a Blinds switch in Domoticz.
However, pressing the Stop button on the switch is too much delayed to be of any help in this.
So I think it would also help when I can mimic the Mod/Var remote with another type of switch in Domoticz.

Any suggestions appreciated.

Re: control blinds with percentage switch and by time

Posted: Saturday 31 March 2018 23:57
by Crash123
I am just trying to learn scripting. So far I have workaround but not finished the script yet.
Switches Blinds.JPG
Switches Blinds.JPG (40.45 KiB) Viewed 1444 times
t2 = starts to close depending on the value t1 and the max time for open to close
uservariables['calculated runtime'] = "50" / "100" * (otherdevices_svalues['t1'])
--50 are the second how long it takes from opened to completely closed, 100 are the max. percentage from the percentage switch

commandArray = {}

if (uservariables['V1'] == 0 and (otherdevices['t2'] == 'On') ) then
commandArray['t2']='Off AFTER '..tostring(uservariables['calculated runtime'])
commandArray['Variable:V1'] = '1'
elseif (uservariables['V1'] == 1 and (otherdevices['t2'] == 'Off') ) then
commandArray['Variable:V1'] = '0'
end

return commandArray
The same could be done for closing with another switch which will use the same t1 switch.

When the script is finished, I can hopefully controll the blinds only with t1. It would be perfect if anybody could help.

Re: control blinds with percentage switch and by time

Posted: Sunday 01 April 2018 8:17
by kniazio
My blinds are (Push On Button), so this method probably will not work.

Re: control blinds with percentage switch and by time

Posted: Thursday 17 May 2018 21:15
by jpham
Hi,

I had the same idea, controlling a blind with a slider. So i created a LUA script in combination with two BASH scripts. In my setup it works with the standard domoticz interface, but if i use Dashticz it sometimes reacts strange.

I have one major problem: if the slider is set below 10%, OTHERDEVICES returns 'nil'. The same thing happens with the switch type "Blinds Percentage". Is this a bug?

I have copied the sunscreen.lua, suncreen_open.sh and sunscreen_close.sh in one file. I can't add three separate files as attachment??
Sunscreen.txt
(5.65 KiB) Downloaded 51 times

Re: control blinds with percentage switch and by time

Posted: Friday 18 May 2018 6:51
by Crash123
I changed the switches because I noticed, that I don´t need a slider. It´s OK, when I have only four steps:
I have two blinds (right and left; R = right blinds, L = left blinds)
Rollo rechts auf = open right blind
Rollo rechts zu = close right blind

It is also not necessary to know the position, where the blind are. If I close them 75% I will open them by clicking 75.
Blinds.JPG
Blinds.JPG (44.32 KiB) Viewed 1116 times
Therefore I tried LUA in four different ways, but no one does work probably :cry:

Code: Select all

commandArray = {}

-- Rollo rechts auf
   
    if (otherdevices_svalues['Rollo rechts auf'] == '10') then
      commandArray['Rollo rechts auf']='Set Level Off AFTER 5'
    elseif (otherdevices_svalues['Rollo rechts auf'] == '20') then
      commandArray['Rollo rechts auf']='Off AFTER 10'
    elseif (otherdevices_svalues['Rollo rechts auf'] == '30') then
      commandArray['Rollo rechts auf']='Set Level 00 AFTER 15'
    elseif (otherdevices_svalues['Rollo rechts auf'] == '40') then
      commandArray['Rollo rechts auf']='Off AFTER 20'
    end

Re: control blinds with percentage switch and by time

Posted: Monday 28 May 2018 6:17
by miroslavpetrov
I also have this problem. I am controlling mechanised windows with Sonoff Dual relais flashed with ESPURNA firmware. It takes 42 seconds to fully open the windows. In espurna I have set an auto off the relais after 42 seconds(When a relay is set to on it turns off after 42s). I have made bash scripts with mqtt commands for opening and closing. For stopping the windows at certain possition, I have made a push on button in domoticz that I called Stop All.
It is a bit of frustrating so I am looking for a better solution. I want to use percentage values or multi switch with different percentages as someone above showed.

Re: control blinds with percentage switch and by time

Posted: Thursday 12 July 2018 11:47
by astrapowerrr
hi intresting topic...
gonna read this..

Re: control blinds with percentage switch and by time

Posted: Thursday 12 July 2018 13:37
by EdddieN
Interested! following...