Variable mit 3 Assoziationen

Hallo,

da ich absolut nicht weiter komme, wollte ich mal fragen, ob es möglich ist, eine Variable (Int) im WF mit 3 Assoziationen darzustellen(klar, das geht ;)) und dann aber bei einem Mausklick herausbekommen, auf welche Ausprägung geklickt wurde ?
Es sollen quasi 3 Buttons in einer Zeile sein, und hinter jedem Button soll eine Funktion(Script) liegen. Ähnlich wie bei einer Boolean-Toggle-Schaltung, nur halt mit 3 Tasten.

Servus,

ich habe das so gemacht, dass ich immer wenn ich drauf-klicke auf die nächste Darstellung weiterspringe.

Sprich - wenn es drei Werte gibt (0/1/2) - dann springe ich die sequentiell durch - immer um eines weiter wenn ich draufklicke.

Das mache ich auch mit einem Script.

lg

Thomas

@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;
   }
}
?>

heizmod.JPG

Hallo,

danke euch - das Entscheidende, was mir fehlte war

SetValue($IPS_VARIABLE, $IPS_VALUE);

:frowning:

@nancilla: fehlt das bei dir nicht auch ?

@tholzing: sequentiell geht inm diesem Fall leider nicht

Nö, weil ich damit andere Scripte (IPS-Runscript) aufrufe, welche noch von einer anderen Instanz gestartet werden und dann Bools setzen.