Die unzähligen Glühweine und Biere zur Weihnachtszeit haben mal wieder ihren Soll erfüllt und den Kopf frei gemacht und ich konnt dank euren Tipps die Steuerung jetzt endlich umsetzen =D Vielen Dank!
Ich poste das jetzt hier einfach mal, falls irgendwer vor ähnlichen Problemen steht.
Integer Variable anlegen -> 16 Assoziationen -> Script DMX Binwrite
Integer Variable anlegen -> ~hexcolor -> Script DMX Umsetzung
und noch eine Integer Variable für den Dezimalwert aus der DMX Binwrite
DMX Binwrite
<?
function SetAssociation($tagnr,$tagname,$fbin,$bit){
$fbit = $fbin & $bit;
if ($fbit != 0){
IPS_SetVariableProfileAssociation("Channels", $tagnr, $tagname, "", -1);
$bin = $fbin & (65535 - $bit);
}
else{
IPS_SetVariableProfileAssociation("Channels", $tagnr, $tagname, "", 0x33CC00);
$bin = $fbin ^ $bit;
}
return ($bin);
}
if($IPS_SENDER == "WebFront"){
$bin = GetValue(32779 /*[Channel 2]*/);
switch($IPS_VALUE){
case 1:
$bin = SetAssociation(1, "CH1", $bin, 1);
break;
case 2:
$bin = SetAssociation(2, "CH2", $bin, 2);
break;
case 3:
$bin = SetAssociation(3, "CH3", $bin, 4);
break;
case 4:
$bin = SetAssociation(4, "CH4", $bin, 8);
break;
case 5:
$bin = SetAssociation(5, "CH5", $bin, 16);
break;
case 6:
$bin = SetAssociation(6, "CH6", $bin, 32);
break;
case 7:
$bin = SetAssociation(7, "CH7", $bin, 64);
break;
case 8:
$bin = SetAssociation(8, "CH8", $bin, 128);
break;
case 9:
$bin = SetAssociation(9, "CH9", $bin, 256);
break;
case 10:
$bin = SetAssociation(10, "CH10", $bin, 512);
break;
case 11:
$bin = SetAssociation(11, "CH11", $bin, 1024);
break;
case 12:
$bin = SetAssociation(12, "CH12", $bin, 2048);
break;
case 13:
$bin = SetAssociation(13, "CH13", $bin, 4096);
break;
case 14:
$bin = SetAssociation(14, "CH14", $bin, 8192);
break;
case 15:
$bin = SetAssociation(15, "CH15", $bin, "16384");
break;
case 16:
$bin = SetAssociation(16, "CH16", $bin, "32768");
break;
}
}
SetValue(32779 /*[Channel 2]*/, $bin);
?>
DMX Umsetzung
<?
SetValue($IPS_VARIABLE, $IPS_VALUE);
$Color = GetValueInteger(43551 /*[RGB Master-Control]*/);
$rot = floor($Color/65536);
$blau = floor(($Color-($rot*65536))/256);
$gruen = $Color-($blau*256)-($rot*65536);
$dez = GetValueInteger(32779 /*[Channel 2]*/);
$tobin = decbin($dez);
$bin = sprintf("%016s
",$tobin);
$binrev = strrev($bin);
for ($i = 1; $i <= 16; $i++) {
$a = $i*3-2;
$b = $i*3-1;
$c = $i*3;
if ($binrev[$i] == 1) {
DMX_fade(47912 /*[DMX Output Devices]*/, $a, $rot, 0.5);
DMX_fade(47912 /*[DMX Output Devices]*/, $b, $blau, 0.5);
DMX_fade(47912 /*[DMX Output Devices]*/, $c, $gruen, 0.5);
}
}
?>
=D Vielen Dank nochmal