Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. Variablen mit "states" -> Probleme mit Rega und "jqui select value"

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Variablen mit "states" -> Probleme mit Rega und "jqui select value"

    This topic has been deleted. Only users with topic management privileges can see it.
    • Bluefox
      Bluefox last edited by

      Wie sieht dein Datenpunkt aus?

      1 Reply Last reply Reply Quote 0
      • V
        vegetto last edited by

        Vielen Dank für deine Antwort paul53!

        Mit Version 0.6.4 funktioniert wunderbar: ich kann in iobroker.admin das Wert für die multi-state Werte und sie bleiben Zahlen. Damit wird die System Variablen in rega richtig gespeichert.

        Damit kann ich jetzt sehr einfach meine gespiegelte iobroker Variablen in sync halten:

        addVariableSync("hm-rega.0.2134"/*homeState*/);
        addVariableSync("hm-rega.0.2735"/*homeStatePreview*/);
        
        function addVariableSync(objId) {
            var obj = getObject(objId);
            var objVal = getState(objId).val;
            var objName = obj.common.name;
        
            //Create and set local variable
            createState(objName, objVal, false, obj.common);
            setState(objName, objVal);
        
            //Update local variable when CCU variable changes
            on(objId,objName);
        
            //Update CCU variable when local variable changes
            on(objName,objId);
        }
        
        

        Das Problem mit dem jqui - Select ValueList ist aber geblieben: ich kann die Variablen aktualizieren aber das Widget reflektiert, die Änderungen nicht…

        [{"tpl":"tplJquiSelectList","data":{"oid":"javascript.0.homeState","visibility-cond":"==","visibility-val":1,"values":"0;1;2;3","texts":"Sleeping;AwakeBeforeWork;Empty;Awake","height":"150","open":false,"name":"homeState"},"style":{"left":9,"top":"49px","width":"221px","height":"30px"},"widgetSet":"jqui"}]
        
        

        Btw: was macht eingentlich das Common -> Open Option?

        1 Reply Last reply Reply Quote 0
        • V
          vegetto last edited by

          @Bluefox:

          Wie sieht dein Datenpunkt aus? `

          Meinst Du das Rega oder Javascript Datenpunkt? Das Rega Datenpunkt ist meinem erste Post (erste "Spolier"). Hier ist das javascript Datenpunkt:

          {
            "common": {
              "name": "homeState",
              "type": "number",
              "read": true,
              "write": true,
              "role": "state",
              "states": {
                "0": "sleeping",
                "1": "awakeBeforeWork",
                "2": "empty",
                "3": "awake"
              },
              "min": 0,
              "max": 3
            },
            "native": {},
            "type": "state",
            "_id": "javascript.0.homeState",
            "acl": {
              "object": 1638,
              "state": 1638
            }
          }
          
          
          1 Reply Last reply Reply Quote 0
          • paul53
            paul53 last edited by

            @Bluefox:

            Wie sieht dein Datenpunkt aus? `
            So:

            {
              "common": {
                "name": "Wochenprogramm",
                "role": "",
                "type": "number",
                "desc": "Auswahl Wochenprogramm für Wandthermostate",
                "states": "0:Normalwoche;1:Woche 1;2:Woche 2",
                "min": 0,
                "max": 2,
                "def": 0,
                "read": true,
                "write": true
              },
              "native": {},
              "acl": {
                "object": 1638,
                "owner": "system.user.admin",
                "ownerGroup": "system.group.administrator",
                "state": 1638
              },
              "_id": "javascript.0.Wochenprogramm",
              "type": "state"
            }
            
            1 Reply Last reply Reply Quote 0
            • V
              vegetto last edited by

              @paul53:

              {
                "states": "0:Normalwoche;1:Woche 1;2:Woche 2",
              
              ```` `  
              

              Sollte es nicht ein Objectt statt ein String sein?

              "states": {"0":"Normalwoche","1":"Woche 1","2":"Woche 2"
              
              
              1 Reply Last reply Reply Quote 0
              • paul53
                paul53 last edited by

                @vegetto:

                Sollte es nicht ein Objectt statt ein String sein? `
                Beide Versionen sind möglich (http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules).

                1 Reply Last reply Reply Quote 0
                • Bluefox
                  Bluefox last edited by

                  @paul53:

                  @Bluefox:

                  Wie sieht dein Datenpunkt aus? `
                  So:

                  {
                    "common": {
                      "name": "Wochenprogramm",
                      "role": "",
                      "type": "number",
                      "desc": "Auswahl Wochenprogramm für Wandthermostate",
                      "states": "0:Normalwoche;1:Woche 1;2:Woche 2",
                      "min": 0,
                      "max": 2,
                      "def": 0,
                      "read": true,
                      "write": true
                    },
                    "native": {},
                    "acl": {
                      "object": 1638,
                      "owner": "system.user.admin",
                      "ownerGroup": "system.group.administrator",
                      "state": 1638
                    },
                    "_id": "javascript.0.Wochenprogramm",
                    "type": "state"
                  }
                  ```` `  
                  

                  Es war noch ein Fehler drin. /opt/iobroker/node_modules/iobroker.admin/www/js/adminStates.js, Zeile 208

                  Aus

                      var parts = s.split(':');
                  
                  

                  bitte das machen

                  var parts = s****[v]****.split(':');

                  1 Reply Last reply Reply Quote 0
                  • Bluefox
                    Bluefox last edited by

                    @paul53:

                    @vegetto:

                    Sollte es nicht ein Objectt statt ein String sein? Beide Versionen sind möglich ([http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules)).
                    Ehrlich gesagt, es geht hier nicht um jqGrid, sondern um ioBroker. Aber genau für dich habe ich das in admin ermöglicht. Ich empfehle trotzdem ein Object zu benutzen.

                    1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 last edited by

                      @Bluefox:

                      var parts = s[v].split(':'); `
                      Danke, damit funktioniert es. Es wird jetzt zwar der Wert im Reiter "Zustände" angezeigt und nicht mehr der aktuelle Zustandstext wie vorher. Bei Änderung des Wertes im Reiter "Zustände" werden die Zustandstexte zur Auswahl angeboten, was o.k. ist.

                      1 Reply Last reply Reply Quote 0
                      • V
                        vegetto last edited by

                        Paul,

                        hast Du ein jqui - select valuelist für dieses Datenpunkt? Wie sieht es bei Dir die "Values" und "Text" Feldern?

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        813
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        3
                        12
                        1759
                        Loading More Posts
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes
                        Reply
                        • Reply as topic
                        Log in to reply
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                        The ioBroker Community 2014-2023
                        logo