control blinds with percentage switch and by time

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
Crash123
Posts: 35
Joined: Thursday 27 October 2016 7:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

control blinds with percentage switch and by time

Post by Crash123 » Thursday 22 March 2018 15:15

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, ...

kniazio
Posts: 76
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: control blinds with percentage switch and by time

Post by kniazio » Sunday 25 March 2018 12:21

I join the request.
+1

User avatar
DeBaat
Posts: 29
Joined: Saturday 27 January 2018 15:52
Target OS: NAS (Synology & others)
Domoticz version: V3.8153
Contact:

Re: control blinds with percentage switch and by time

Post by DeBaat » Tuesday 27 March 2018 17:39

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.

Crash123
Posts: 35
Joined: Thursday 27 October 2016 7:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: control blinds with percentage switch and by time

Post by Crash123 » Saturday 31 March 2018 23:57

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 882 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.

kniazio
Posts: 76
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: control blinds with percentage switch and by time

Post by kniazio » Sunday 01 April 2018 8:17

My blinds are (Push On Button), so this method probably will not work.

jpham
Posts: 4
Joined: Wednesday 04 April 2018 13:56
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: control blinds with percentage switch and by time

Post by jpham » Thursday 17 May 2018 21:15

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 24 times

Crash123
Posts: 35
Joined: Thursday 27 October 2016 7:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: control blinds with percentage switch and by time

Post by Crash123 » Friday 18 May 2018 6:51

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 554 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

miroslavpetrov
Posts: 24
Joined: Wednesday 03 February 2016 14:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: control blinds with percentage switch and by time

Post by miroslavpetrov » Monday 28 May 2018 6:17

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.
Domoticz on Raspberry Pi 3 with HomeBridge.
RFXCOM, Xiaomi Smart Home, Broadlink RM3, Shelly Smart Bulbs, EasyESP custom sensors.

astrapowerrr
Posts: 59
Joined: Tuesday 31 January 2017 21:34
Target OS: -
Domoticz version:
Contact:

Re: control blinds with percentage switch and by time

Post by astrapowerrr » Thursday 12 July 2018 11:47

hi intresting topic...
gonna read this..

User avatar
EdddieN
Posts: 333
Joined: Wednesday 16 November 2016 12:31
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: Scotland
Contact:

Re: control blinds with percentage switch and by time

Post by EdddieN » Thursday 12 July 2018 13:37

Interested! following...
11101101 - www.machinon.com

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests