What can we improve?

Dokumentation

Translation is in progress...

Not all topics are available at the moment and content links may be broken.

Shutter Control

To make the IP-Symcon Shutter Module hardware independent, the module needs a script that takes care of the transmission of commands to your hardware.

All, who have the following hardware, can copy the script and use easily. Other hardware can be easily added. (Find more in this script).

  • Eaton Xcomfort Shutter
  • 1-Wire Shutter
  • Homematic (Dank an hengesb)
  • LCN (Dank an philipp)
  • FS20MS

Normally this script must be present only once in IP-Symcon and it can be accessed by any number of instances. Nothing must be edited.

Calibrate shutters

In the second step, the times are measured, which the shutters needs to go to the individual positions. The measurement must be performed twice. For up and down. To start the corresponding button is pressed, and then the shutters should be set in motion. The button should be pressed again when the position is reached.

After each teaching the values ​​must be transferred with the "Set" button.

Tips & Tricks

On a ride to 0% and 100% five seconds are added to the running time in order to achieve a defined position.

If the duration of the shutter is above the PHP script-limit (180sec) it needs to be increased in php.ini. (see PHP)

Hints for LCN user

The Shuttermodule can be used with the script universally for controlling the shutters/blinds via the outputs, as well as via the relay.

If the Shuttermodule has to control shutters/blinds, which hangs at the two outputs of a UPP/SH/HU, select the instance of the output 1 of the module under "Instance1" and for "Instance2" the instance of the output 2 of the module. This assignment corresponds to the standard direction, as it is controlled from the LCN-Pro with boot up or shutdown. If the connection should be reversed, only the associations between output 1 and 2 should be changed to "Instance1" and "Instance2".

When operating with relay for "Instance1" always the first relay of the two must be specified. The first relay is the one that turns the power on/off. "Instance2" is always the relay which controls the direction. If the direction of travel should be twisted, this must be changed manually in the script. In the "case block for LCN" of the shutter script you can find at the two locations an appropriate comment. For the case of using different wired shutters/blinds at the relay, you must use for the respective configurations two Shutterscripts.

Shutter Script

//Variables provided by ShutterControl Module
//IPS_LogMessage("InstanceID", $_IPS['INSTANCE']); /* InstanceID */
//IPS_LogMessage("Direction", $_IPS['DIRECTION']); /* {0..2} Stop, Up, Down */
//IPS_LogMessage("Duration", $_IPS['DURATION']); /* ms */
 
if($_IPS['SENDER'] != "ShutterControl")
    die("This script can only be started by the ShutterControl Module");
 
define("SC_DIRECTION_STOP", 0);
define("SC_DIRECTION_UP", 1);
define("SC_DIRECTION_DOWN", 2);
 
$instance = IPS_GetInstance($_IPS['INSTANCE']);
switch($instance['ModuleInfo']['ModuleID'])
{
    case "{48FCFDC1-11A5-4309-BB0B-A0DB8042A969}": //FS20
        $running = CreateVariableByName($SC_INSTANCE, "Moving", 0);
        $value = GetValue(IPS_GetStatusVariableID($_IPS['INSTANCE'],"StatusVariable"));
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                if(GetValue($running))
                {
                    FS20_SwitchMode($_IPS['INSTANCE'], $value);
                    SetValue($running, false);
                }
                break;
            case SC_DIRECTION_UP:
                if(!GetValue($running))
                {
                    FS20_SwitchMode($_IPS['INSTANCE'], true);
                    SetValue($running, true);
                }
                if($SC_DURATION > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    FS20_SwitchMode($_IPS['INSTANCE'], true);
                    SetValue($running, false);
                }
                break;
            case SC_DIRECTION_DOWN:
                if(!GetValue($running))
                {
                    FS20_SwitchMode($_IPS['INSTANCE'], false);
                    SetValue($running, true);
                }
                if($SC_DURATION > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    FS20_SwitchMode($_IPS['INSTANCE'], false);
                    SetValue($running, false);
                }
                break;
        }
        break;
    case "{1B7B5B7D-CAA9-4AB5-B9D8-EC805EC955AD}": //xComfort
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                MXC_ShutterStop($_IPS['INSTANCE']);
                break;
            case SC_DIRECTION_UP:
                MXC_ShutterMoveUp($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    MXC_ShutterStop($_IPS['INSTANCE']);
                }
                break;
            case SC_DIRECTION_DOWN:
                MXC_ShutterMoveDown($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    MXC_ShutterStop($_IPS['INSTANCE']);
                }
                break;
        }
        break;
    case "{2D871359-14D8-493F-9B01-26432E3A710F}": //LCN
        $type=LCN_GetUnit($_IPS['INSTANCE']);
        switch($type)
        {
            case 0: //Ausgänge
                switch($_IPS['DIRECTION'])
                {
                    case SC_DIRECTION_STOP:
                        LCN_SetIntensity($_IPS['INSTANCE'],0,0);
                        LCN_SetIntensity($_IPS['INSTANCE2'],0,0);
                        break;
                    case SC_DIRECTION_UP:
                        LCN_SetIntensity($_IPS['INSTANCE'],100,4);
                        if($_IPS['DURATION'] > 0)
                        {
                        IPS_Sleep($_IPS['DURATION']);
                        LCN_SetIntensity($_IPS['INSTANCE'],0,0);
                        }
                        break;
                    case SC_DIRECTION_DOWN:
                        LCN_SetIntensity($_IPS['INSTANCE2'],100,4);
                        if($_IPS['DURATION'] > 0)
                        {
                        IPS_Sleep($_IPS['DURATION']);
                        LCN_SetIntensity($_IPS['INSTANCE2'],0,0);
                        }
                        break;
                }
                break;
            case 2: //Reais
            switch($_IPS['DIRECTION'])
            {
                case SC_DIRECTION_STOP:
                    LCN_SwitchRelay($_IPS['INSTANCE'],false);
                    break;
                case SC_DIRECTION_UP:
                    LCN_SwitchRelay($_IPS['INSTANCE'],true);
                    LCN_SwitchRelay($_IPS['INSTANCE2'],false); // Um Relaisrichtung zu ändern bitte auf true
                    if($_IPS['DURATION'] > 0)
                    {
                        IPS_Sleep($_IPS['DURATION']);
                        LCN_SwitchRelay($_IPS['INSTANCE'],false);
                    }
                    break;
                case SC_DIRECTION_DOWN:
                    LCN_SwitchRelay($_IPS['INSTANCE'],true);
                    LCN_SwitchRelay($_IPS['INSTANCE2'],true);// Um Relaisrichtung zu ändern bitte auf false
                    if($_IPS['DURATION'] > 0)
                    {
                        IPS_Sleep($_IPS['DURATION']);
                        LCN_SwitchRelay($_IPS['INSTANCE'],false);
                    }
                    break;
            }
            break;
        }
        break;
    case "{9317CC5B-4E1D-4440-AF3A-5CC7FB42CCAA}": //1-Wire Shutter
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                OneWireShutter($_IPS['INSTANCE'], 0, $_IPS['DURATION']);
                break;
            case SC_DIRECTION_UP:
                if($_IPS['DURATION'] == 0)
                    $_IPS['DURATION'] = 120000;
                OneWireShutter($_IPS['INSTANCE'], 0, $_IPS['DURATION']);
                break;
            case SC_DIRECTION_DOWN:
                if($_IPS['DURATION'] == 0)
                    $_IPS['DURATION'] = 120000;
                OneWireShutter($_IPS['INSTANCE'], 1, $_IPS['DURATION']);
                break;
        }
        break;
    case "{EE4A81C6-5C90-4DB7-AD2F-F6BBD521412E}": //Homematic Shutter
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                HM_WriteValueBoolean($_IPS['INSTANCE'], "STOP", true);
                break;
            case SC_DIRECTION_UP:
                HM_WriteValueFloat($_IPS['INSTANCE'], "LEVEL", 1.0);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    HM_WriteValueBoolean($_IPS['INSTANCE'], "STOP", true);
                }
                break;
            case SC_DIRECTION_DOWN:
                HM_WriteValueFloat($_IPS['INSTANCE'], "LEVEL", 0.0);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    HM_WriteValueBoolean($_IPS['INSTANCE'], "STOP", true);
                }
                break;
        }
        break;
    default:
        die("No Handler for Module ".$instance['ModuleInfo']['ModuleName']." found");
}
 
function OneWireShutter($ins, $dir, $sec) {
    @TMEX_F29_SetStrobe($ins, True);
    $res = ($dir * 128) + ($sec / 1000);
    @TMEX_F29_SetPort((integer)$ins, (integer)$res);
}
 
function CreateVariableByName($id, $name, $type)
{
    $vid = @IPS_GetVariableIDByName($name, $id);
    if($vid===false) {
        $vid = IPS_CreateVariable($type);
        IPS_SetParent($vid, $id);
        IPS_SetName($vid, $name);
        IPS_SetInfo($vid, "This Variable was created by Script #".$_IPS['SELF']);
    }
    return $vid;
}

Information for upgrading the script

Always three parameters are passed in a call.

  • The InstanceID of the “Transmit Device” set in the Shutter Control Instance
  • The direction in which should be drive.
  • The time that is to be run. (This value is 0 at STOP and the TEST buttons are on the properties page)

In the "Case Statements", the GUIDs for the module must be inserted. All IP-Symcon functions can be used. There must be generated no output (echo), otherwise a failure occurs and will be shown in the message log. The status of the "position" variable is not updated.

Deutsche Webseite verfügbar
Go to cart
Any questions?