Falsche Farbanzeige bei IPS_SetVariableProfileAssociation

Hallo,

habe ein Variablenprofil mit 6 Associationen erstellt mit entsprechendem Script wie unten.
Die 2. Farbe (gelb) bei der 2. Association wird korrekt dargestellt, alle anderen kommen nur in rot.
Ist das ein Bug oder habe ich einen Denkfehler?


if($IPS_SENDER == "WebFront")
{
    switch($IPS_VALUE)
    {
       case 1:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer_1-OG-]*/, true);
          IPS_Sleep(200);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer_1-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", 0xFFFFFF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 2:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer_1-OG-]*/, true);
          IPS_Sleep(2500);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer_1-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", 0xFFFF00);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 3:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer_1-OG-]*/, true);
          IPS_Sleep(600);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer_1-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", 0xFFFF00);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;

usw.

Hast du vielleicht vorweg beim Integer-Variablenprofil Farben vorgewählt?
Dein Script ist doch auch nicht vollständig. Du hast 6 Werte aber nur 3 Änderungen dafür vorgesehen…

Hallo,

im Variablenprofil habe keinerlei Farben hinterlegt.
Das mit dem Script ist so OK habe der Länge wegen gekürzt, weil es sich wiedewrholt.
Danke

ich kann in deinen Zuordnungen auch keinen Fehler endeken. Sollte vorher keine Farbe definiert worden sollte es Antrazit sein und nicht Rot.

Bitte passe deine Signatur an damit wir wissen welche IPS Version du hast.

Gruß Nick

Hast Du mal den Cache vom Broswer geleert?

auch das hatte ich schon gemacht, ohne Erfolg.

Version ist 2.5 mit neuestem Update von gestern

bei der Nr. 2 ist auch der Hintergrund weiss, rest ist schwarz.

Funktioniert hier einwandfrei.

Version ist 2.5 mit neuestem Update von gestern
Die hast Du aber nicht drauf. Bei dir wird noch 2196 vom 4.12 angezeigt. Hat aber damit nichts zutun.

<?
if($IPS_SENDER == "WebFront")
{
    switch($IPS_VALUE)
    {
       case 1:
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", 0xFFFFFF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 2:
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", 0xFF40FF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 3:
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", 0xFF8543);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
      case 4:
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", 0x4350FF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 5:
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", 0xFD43FF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 6:
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", 0xFF0000);
          break;
        }
}

?>

Hallo Rainer,

vielen dank für deine Antwort.

Dein Script, sowie VariableProfileAssociation sind bei mir gleich aufgebaut. (siehe Srceens). Deine Farben haben auch funktioniert, bis auf die
Nr. 2.
Habe dann die Farbe auf FFFF00 geändert und es funktioniert nach wie vor nicht.

Gruß wibo


<?
if($IPS_SENDER == "WebFront")
{
    switch($IPS_VALUE)
    {
       case 1:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, true);
          IPS_Sleep(200);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, false);
//          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", 0xFFFFFF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", 0xFFFF00);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
             break;
       case 2:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, true);
          IPS_Sleep(2500);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
//          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", 0xFF40FF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", 0xFFFF00);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 3:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, true);
          IPS_Sleep(600);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
//          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", 0xFF8543);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", 0xFFFF00);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 4:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, true);
          IPS_Sleep(800);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
//          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", 0x4350FF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", 0xFFFF00);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 5:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, true);
          IPS_Sleep(1000);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
//          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", 0xFD43FF);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", 0xFFFF00);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", -1);
          break;
       case 6:
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, true);
          IPS_Sleep(100);
          ModBus_WriteCoil(34490 /*[Wago\Digitale Ausgänge\750-1504-16-DO-POS-18-Beleuchtung\Adresse-578-Dimmer-OG-]*/, false);
          IPS_SetVariableProfileAssociation("Dimmer_1",  1,  "Ein" , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  2,  "Voll", "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  3,  "10"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  4,  "20"  , "", -1);
          IPS_SetVariableProfileAssociation("Dimmer_1",  5,  "30"  , "", -1);
//          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", 0xFF0000);
          IPS_SetVariableProfileAssociation("Dimmer_1",  6,  "Aus" , "", 0xFFFF00);
          break;
    }
}
?>

Screen_5.jpg

Screen_6.jpg

Schalt das ganze mal ohne die Modbus und sleep Befehle durch.

2500ms sind 2,5 sec wo dein Script blockiert ist. Da solltest Du dir eine andere Lösung einfallen lassen.

Hallo Rainer,
Danke für deine Antwort, habe alle Schaltfunktionen und sleep rausgeholt und nach wie vor falsche Anzeige.

Dann spuckt dir doch irgendwo der Browser in die Suppe. Lösch mal die Cookies vom Webfront.

Hallo Rainer,
auch das hatte ich schon alles ausgeführt.
Das gleiche Problem tritt auch auf anderem PC sowie iPad auf.

Hmm, lösch mal die Variable, leg eine neue an und trag bei den Assoziationen nur den Wert von 1-6 ein, sonst nichts. Dann über Webfront mal schalten.

Jetzt wird es ganz verrückt.

Die Variable wird mehrfach angelegt und lässt sich nicht auswählen.
Das Problem hatte gestern ein anderer User gepostet nach letztem IPS Update

Das ist ein Fehler der Konsole in der 2.5 RC1. Hat aber mit deinem Problem nichts zu tun.

paresy

Moment, das ist doch eine Systemvariable. Das wird so nix. Hat denn diese Variable über 6 Assoziationen.

Übrigens ist das was du versuchst, eine sehr sehr schlechte Idee. Es kostet unendlich Performance und zweitens brauchst du für jede einzelne Variable die so funktionieren soll ein eigenes Profil… Also ganz schlecht.

Erstell für alle deine 6 Möglichkeiten die Profile (z.B. Dimmer_1 bis Dimmer_6) und setzte je nach Fall nur das korrekt Profil für die Variable mit IPS_SetVariableCustomProfile.

Warum setzt du die Farben nicht eigentlich fix fest?! Nur das Element das ausgewählt ist, wird doch hell und kräftig angezeigt. Das was du machen willst kostet unnötig Performance für ein kaum sichtbares Detail.

paresy

Außerdem würde ich mir dringend dies ansehen: http://www.ip-symcon.de/forum/f41/wago-taster-16239/

Und… deine Idee funktioniert überhaupt nicht mehr, falls du per Skript und nicht mehr per WebFront schaltest… Oder du hast überall die Profiländerungen mit drin. Das ist aber ekelig :wink:

paresy

Hallo Paresy,

Danke für den Tipp und ein neues Problem.

Dies sollte sowieso nicht die Endlösung sein, war nur zum lernen und Test gedacht.

Hallo Rainer nochmals Danke aber Problem besteht nach wie vor auch nachdem ich eine neue Variable angelegt habe.

Aber jetzt ist ein ganz neues Problem aufgetaucht, was eventuell auch damit zusammenhängen könnte.

Ich habe 2 Media Player Instanzen angelegt unter 2 verschiedenen Kategorien. Zusätzlich wurde ohne mein Zutun eine Media Instanz in der Root angelegt.
Wenn ich jetzt die Media Instanzen lösche stürzt ips ab und der Dienst wird beendet.
Nach Neustart sind die Media Instanzen alle wieder da.
Habe keine Möglichkeit mehr die Media Instanzen zu löschen.

Neues Problem = Neues Thema.

paresy