@crissiboy
Das geht auch mit noch mehr Button. Ich habe z.B. für meine Heizungssteuerung 5 Möglichkeiten zur Auswahl gemacht:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 1: // Normal
IPS_SetVariableProfileAssociation("Heizung-Modus", 1, "Normal", "", 0xFFB800);
IPS_SetVariableProfileAssociation("Heizung-Modus", 2, "kurz abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 3, "dauernd abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 4, "Party", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 5, "Wartung", "", -1);
IPS_RunScript(12301);
break;
case 2: // kurz abwesend
IPS_SetVariableProfileAssociation("Heizung-Modus", 1, "Normal", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 2, "kurz abwesend", "", 0x9999FF);
IPS_SetVariableProfileAssociation("Heizung-Modus", 3, "dauernd abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 4, "Party", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 5, "Wartung", "", -1);
IPS_RunScript(12302);
break;
case 3: // dauernd abwesend
IPS_SetVariableProfileAssociation("Heizung-Modus", 1, "Normal", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 2, "kurz abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 3, "dauernd abwesend", "", 0x0000FF);
IPS_SetVariableProfileAssociation("Heizung-Modus", 4, "Party", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 5, "Wartung", "", -1);
IPS_RunScript(12303);
break;
case 4: // Party
IPS_SetVariableProfileAssociation("Heizung-Modus", 1, "Normal", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 2, "kurz abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 3, "dauernd abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 4, "Party", "", 0xFFF000);
IPS_SetVariableProfileAssociation("Heizung-Modus", 5, "Wartung", "", -1);
IPS_RunScript(12304);
break;
case 5: // Wartung
IPS_SetVariableProfileAssociation("Heizung-Modus", 1, "Normal", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 2, "kurz abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 3, "dauernd abwesend", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 4, "Party", "", -1);
IPS_SetVariableProfileAssociation("Heizung-Modus", 5, "Wartung", "", 0xFF0000);
IPS_RunScript(12305);
break;
}
}
?>