Stopping blinds movement

Post Reply
PatrickM
Posts: 48
Joined: Wednesday 18 June 2014 15:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Stopping blinds movement

Post by PatrickM » Tuesday 01 November 2016 12:32

I'd like to control my Blinds Percentage device with a remote control, but using the script api, as far as I can tell, only allows to open or close it fully. What would be the best approach to stop it halfway? Similar questions have been asked before here and here and apparently some remotes (somfy, z-wave remotes) can do it directly, circumventing domoticz. I'm using a cheap X10 RF remote (with RFLink).

The hardware is Fibaro FGRM-222. When I repeat an open or close command, unfortunately it is ignored or movement is reversed instead of stopped. The local switch does stop movement: if it is moving when you push either open or close it stops first, and you need to push again to resume or reverse movement. I'd like my remote control to work in the same way.

Probably I can get it to work by calling into ozwcp directly from a script (like this). I can use the 'native' open/close or inc/dec commands to stop movement, instead of the on/off commands exposed by domoticz. But I'd have to find a way to determine in my script if the screen is currently moving, perhaps by checking power usage? A more crude but hardware independent approach could be to mess around with timers, using periodic increments to keep the blinds moving, until a new signal is received that stops it but obviously this is inconvenient and probably not very precise/robust (cpu intensive).

Is there some kind of hidden feature, or future plans to achieve this in an elegant, reliable way?

User avatar
Stuntteam
Posts: 437
Joined: Wednesday 06 May 2015 16:39
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Stopping blinds movement

Post by Stuntteam » Tuesday 01 November 2016 14:28

We are looking at a solution for button sequences at RFLink's side of things.
It will take a bit of time to work things out though.
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic RFLink Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

PatrickM
Posts: 48
Joined: Wednesday 18 June 2014 15:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Stopping blinds movement

Post by PatrickM » Wednesday 02 November 2016 19:33

I've settled for the (dzVents) script below, which works reasonably well. There's some delay but most of it is caused by RFLink not receiving repeated button presses. I looks like it's 'deaf' for at least 1 sec. after receiving a button press. If there's any way to improve this all tips are welcome :)

Code: Select all

return {
    active = true,
    on = {
        "$Remote 1", "$Remote 2", "$Remote 3"
    },
    execute = function(domoticz, button)
        local screen; -- zipscreen device
        local power; -- current power usage
        local ozwIdx; -- zipscreen index in ozw
        local threshold = 10;

        --domoticz.log("Button pressed (" .. button.name .. " -> " .. button.state .. ")");

        if (button.name == "$Remote 1") then
            screen = domoticz.devices['Zipscreen L'];
            power = domoticz.devices['Zipscreen L Power'].utility;
            ozwIdx = "5";
        elseif (button.name == "$Remote 2") then
            screen = domoticz.devices['Zipscreen M'];
            power = domoticz.devices['Zipscreen M Power'].utility;
            ozwIdx = "7";
        elseif (button.name == "$Remote 3") then
            screen = domoticz.devices['Zipscreen R'];
            power = domoticz.devices['Zipscreen R Power'].utility;
            ozwIdx = "2";
        end

        if (screen and power) then
            if (power > threshold) then
                domoticz.log(screen.name .. " -> Stop (" .. power .. "W / " .. screen.state .. ")");
                local post = ozwIdx .. "-SWITCH MULTILEVEL-user-button-1-7=false"
                local url = "http://" .. domoticz.settings['Domoticz ip']
                            .. ":" .. domoticz.settings['Domoticz port']
                            .. "/ozwcp/buttonpost.html";
                local cmd = "curl '" .. url .. "' --data '" .. post .. "'";
                --domoticz.log("Execute: " .. cmd);
                os.execute(cmd);
            else
                if (button.state == "On") then
                    domoticz.log(screen.name .. " -> Close (" .. power .. "W / " .. screen.state .. ")");
                    screen.switchOff();
                else
                    domoticz.log(screen.name .. " -> Open (" .. power .. "W / " .. screen.state .. ")");
                    screen.switchOn();
                end
            end
        else
            domoticz.log("Failed to lookup screen (" .. tostring(screen) .. ") \z
                          and/or power usage (" .. tostring(power) .. ")");
        end

        domoticz.log("Fini");
    end
}

kolargol22
Posts: 9
Joined: Friday 25 November 2016 13:42
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Stopping blinds movement

Post by kolargol22 » Friday 25 November 2016 13:46

Stuntteam wrote:We are looking at a solution for button sequences at RFLink's side of things.
It will take a bit of time to work things out though.
+1 i use Brel Motors and on my DC306 remote i have "stop" button but on domoticz + rflink i am able only to fully open or close blinds. It would be nice if i can control when blind stop (perfectly if i can set % on that...)

User avatar
Stuntteam
Posts: 437
Joined: Wednesday 06 May 2015 16:39
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Stopping blinds movement

Post by Stuntteam » Friday 25 November 2016 15:09

Why that? Didn't you select Venetian blinds in Domoticz? That has a stop button..
Or is stop not working?
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic RFLink Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

kolargol22
Posts: 9
Joined: Friday 25 November 2016 13:42
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Stopping blinds movement

Post by kolargol22 » Tuesday 29 November 2016 10:49

Venetian indeed there are but they do not work with homebridge... (HomeKis show it as unrecognized device)

wmmudde
Posts: 22
Joined: Monday 31 July 2017 14:33
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Stopping blinds movement

Post by wmmudde » Tuesday 27 February 2018 17:54

Did you Got this working on HomeKit now ?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests