« Back to Product

Documentation

Group addresses and scripts

Supplement to KNX: Conversion of group addresses and scripts for the KNX bus.

Conversion of group addresses

Convert from two-level group addresses to three-level group addresses

If a two-level representation of the group addresses has been selected in the ETS, the addresses can be converted with the help of this tool. If the OPC export is used, the ETS takes over this process automatically.

     

Convert free group addresses to three level group addresses

If you have selected the free representation of the group addresses in the ETS, unfortunately an OPC export is not possible. With the help of this tool the addresses can be converted.

    

Script to read states from the bus

Since only variable changes are perceived by IP-Symcon, it is necessary to query IP-Symcon when restarting to see if there have been any status changes in order to ensure a consistent display.
For this a start script can be added in the Event-Control .

$gatewayIDs = IPS_GetInstanceListByModuleID("{1C902193-B044-43B8-9433-419F09C641B8}");
$instanceIDs = IPS_GetInstanceList();
foreach($gatewayIDs as $gatewayID) {
    foreach($instanceIDs as $instanceID) {
        $i = IPS_GetInstance($instanceID);
        if($i['ConnectionID'] == $gatewayID) {
            switch($i['ModuleInfo']['ModuleID']) {
                case "{24A9D68D-7B98-4D74-9BAE-3645D435A9EF}": //Shutter
                case "81F54858-72B1-4C2C-8CE3-7E00A3168378": //RGB (Legacy until IP-Symcon 5.0)
                case "{81F54858-72B1-4C2C-8CE3-7E00A3168378}": //RGB (IP-Symcon 5.1+)
                case "4D7F7548-0979-4ABD-9BB3-81F9477C0903": //RGBW (Legacy until IP-Symcon 5.0)
                case "{4D7F7548-0979-4ABD-9BB3-81F9477C0903}": //RGBW (IP-Symcon 5.1+)
                    EIB_RequestStatus($instanceID);
                    break;

                case "{D62B95D3-0C5E-406E-B1D9-8D102E50F64B}": //Group
                    if(IPS_GetProperty($instanceID, "GroupCapabilityRead")) {
                        EIB_RequestStatus($instanceID);
                    }
                    break;
                case "{FB223058-3084-C5D0-C7A2-3B8D2E73FE8A}": //Device
                    KNX_RequestStatus($instanceID);
                    break;
                default:
                    //DPTs
                    if(strpos($i['ModuleInfo']['ModuleName'], "DPT") !== false) {
                        if(IPS_GetProperty($instanceID, "CapabilityRead")) {
                            KNX_RequestStatus($instanceID);
                        }
                    }
                    break;
            }
        }
    }
}

Script to output the group addresses

The following script can be used to output the group addresses including id, name and location.

echo "ID,Name,Location,GA,MoreGA" . PHP_EOL;

$gatewayIDs = IPS_GetInstanceListByModuleID("{1C902193-B044-43B8-9433-419F09C641B8}");
$instanceIDs = IPS_GetInstanceList();
foreach($gatewayIDs as $gatewayID) {
    foreach($instanceIDs as $instanceID) {
        $i = IPS_GetInstance($instanceID);
        if($i['ConnectionID'] == $gatewayID) {
            switch($i['ModuleInfo']['ModuleID']) {
                case "{24A9D68D-7B98-4D74-9BAE-3645D435A9EF}": //Shutter
                    printGA($instanceID, "GroupMove");
                    if (IPS_GetProperty($instanceID, "EnableStep")) {
                        printGA($instanceID, "GroupStep");
                    }
                    printGA($instanceID, "GroupStop");
                    if (IPS_GetProperty($instanceID, "EnablePosition")) {
                        printGA($instanceID, "GroupPosition");
                    }
                    if (IPS_GetProperty($instanceID, "EnableBladePosition")) {
                        printGA($instanceID, "GroupBladePosition");
                    }
                    break;
                case "81F54858-72B1-4C2C-8CE3-7E00A3168378": //RGB (Legacy until IP-Symcon 5.0)
                case "{81F54858-72B1-4C2C-8CE3-7E00A3168378}": //RGB (IP-Symcon 5.1+)
                case "4D7F7548-0979-4ABD-9BB3-81F9477C0903": //RGBW (Legacy until IP-Symcon 5.0)
                case "{4D7F7548-0979-4ABD-9BB3-81F9477C0903}": //RGBW (IP-Symcon 5.1+)
                case "{D62B95D3-0C5E-406E-B1D9-8D102E50F64B}": //Group
                    printGA($instanceID, "Group");
                    break;
                case "{FB223058-3084-C5D0-C7A2-3B8D2E73FE8A}": //Device
                    printGAs($instanceID);
                    break;
                default:
                    //DPTs
                    if(strpos($i['ModuleInfo']['ModuleName'], "DPT") !== false) {
                        printGA($instanceID, "");
                    }
                    break;
            }
        }
    }
}

function printGA($id, $prefix) {
    $c = json_decode(IPS_GetConfiguration($id), true);
    echo sprintf("%d,%s,%s,", $id, IPS_GetName($id), IPS_GetLocation($id));
    echo sprintf("%d/%d/%d", $c[$prefix . "Address1"], $c[$prefix . "Address2"], $c[$prefix . "Address3"]);
    foreach (json_decode($c[$prefix . "Mapping"], true) as $a) {
        echo "," . sprintf("%d/%d/%d", $a[$prefix . "Address1"], $a[$prefix . "Address2"], $a[$prefix . "Address3"]);
    }
    echo PHP_EOL;
}

function printGAs($id) {
    $c = json_decode(IPS_GetConfiguration($id), true);
    foreach(json_decode($c['GroupAddresses'], true) as $ga) {
        echo sprintf("%d,%s,%s,", $id, IPS_GetName($id), IPS_GetLocation($id));
        echo sprintf("%d/%d/%d", $ga["Address1"], $ga["Address2"], $ga["Address3"]);
        foreach ($ga["Mapping"] as $a) {
            echo "," . sprintf("%d/%d/%d", $a["Address1"], $a["Address2"], $a["Address3"]);
        }
        echo PHP_EOL;
    }
}
Any questions?