Zw-Parameter Name und Elementauswahl auslesen

Hallo IPS-ler,

möchte hinter einigen Geräten ein zusätzliche Funktion als integer mit eigenem Profil hinterlegen.
Zweck ist zusätzliche Funktionen über WF bereit zu stellen.

Das ganze würde ich gern über ein Skript mit entsprechenden Schleifen anlegen.

Von Hand wäre das echt nervig.

es gibt doch bestimmt einen befehl der mir die Parameter Namen als Array auswirft.
Und vielleicht auch noch die Elementauswahl.

vielen Dank im voraus

Peter

Das Array habe ich schon mal simuliert.

<?
$array = array(
    "1" => "Activate / Deaktivate funktional all on / off",
);
$arrayb = array(
    "0" => "all on is not Aktiv / all off is not Aktiv",
    "1" => "all on is not Aktiv / all off is Aktiv",
    "2" => "all on is Aktiv / all off is not Aktiv",
    "255" => "all on is Aktiv / all off is Aktiv",
);

end($arrayb);         
$key = key($arrayb); 
reset($arrayb);

$parentid = 15630;
$Aktionsskript = 48463;

$profilname = $array[1];

$strprofilname = str_replace(" ", "", $profilname);
$strprofilname = preg_replace ( '/[^a-z0-9 ]/i', '', $strprofilname );
$parameterid = IPS_CreateVariable(1);

IPS_SetName($parameterid, $profilname); 
if (IPS_VariableProfileExists($strprofilname))
	{
}
else
	{
	IPS_CreateVariableProfile($strprofilname, 1);
	$i = -1;
	$count = count($arrayb);
	while ($i++ < $key)
			{
			if (empty($arrayb[$i])) 
				{
				$funktion = $arrayb[$key];
				IPS_SetVariableProfileAssociation($strprofilname, $key, $funktion, "", 0xFFFFFF);
				$i=$key;	
				print_r ($arrayb);
				}
				else
				{
				$funktion = $arrayb[$i];
				IPS_SetVariableProfileAssociation($strprofilname, $i, $funktion, "", 0xFFFFFF);
				print_r ($arrayb);
				}
			}
	}
IPS_SetVariableCustomProfile($parameterid , $strprofilname);
IPS_SetParent($parameterid, $parentid); 
IPS_SetVariableCustomAction($parameterid, $Aktionsskript);
?>

Gibt keinerlei Funktion dafür. Du kannst aber den Mirror der ZWDB von uns dafür nutzen:

Wird dann aber jedes mal Online abgefragt.


$id = 12345;
$deviceString = IPS_GetProperty($id, 'ManufacturerID') . IPS_GetProperty($id, 'ProductType') . IPS_GetProperty($id, 'ProductID');
print_r(json_decode(file_get_contents('http://zwdb.symcon.de/' . $deviceString . '.json')));

paresy