Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Erste Gehversuche…Hilfe

    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

    Erste Gehversuche…Hilfe

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

      Hallo,

      danke für die viele hilfe.

      > log("…") muss klein geschrieben werden.
      Erledigt. Funktioniert leider aber trotzdem nicht.

      > Hast Du für den Screen shot extra die Seriennummer durch xxxxx ersetzt und anschließend wieder korrigiert ?
      Jawohl!

      Wie kann ich testen, ob der Adapter defekt ist? einfach neu installieren?

      1 Reply Last reply Reply Quote 0
      • blauholsten
        blauholsten Developer last edited by

        @Mr. Burns:

        Wie kann ich testen, ob der Adapter defekt ist? einfach neu installieren? `

        Schreib in einem Skript

        log("test ob ich funktioniere")
        

        und drück dann auf Speichern und auf play….

        1 Reply Last reply Reply Quote 0
        • Mr. Burns
          Mr. Burns last edited by

          Habe die Zeile durch ein ; abgeschlossen, aber kein Eintrag im LOG.

          Adapter sowie raspberry neustarten hat leider auch nicht geholfen.

          Edit:

          Habe die Instanz des Adapters deinstalliert und den Adapter anschließend gelöscht. Danach neu installiert.

          Leider funktioniert nicht mal die eine Zeile des LOG.

          Ich werde das Gefühl nicht los, das ich etwas falsch mache.

          Edit2:

          Hab den adapter noch einmal deinstalliert. Gelöscht und den raspberry neu gestartet.

          Jetzt funktioniert es. Danke für euere Unterstützung.

          1 Reply Last reply Reply Quote 0
          • blauholsten
            blauholsten Developer last edited by

            Dann bin ich leider raus, tut mir Leid :?

            1 Reply Last reply Reply Quote 0
            • Mr. Burns
              Mr. Burns last edited by

              Frohe Ostern!

              tschuldigung, dass ich schon wieder nerve, aber bin gerade dabei eine und Verknüpfung reinzubasteln und bekomme es nicht hin.

              Das funktioniert: (Danke nochmal für die Hilfe)

              var TAG1 = "hm-rpc.1.JEQ0xxxxxx.16.STATE";
              var TAG2 = "hm-rega.0.xxx";
              var text = "Die Mitteilung";
              
              on (TAG1,function(obj){
                    if (obj.state.val)
                    sendTo('pushover.0', text);
              });
              

              Aber sowas nicht:

              var TAG1 = "hm-rpc.1.JEQxxxxxx.16.STATE";
              var TAG2 = "hm-rega.0.xxx";
              var text = "Die Mitteilung";
              
              on (TAG1 === true && TAG2 === true,function(obj){
                    if (obj.state.val)
                    sendTo('pushover.0', text);
              });
              

              Das auch nicht:

              var TAG1 = "hm-rpc.1.JEQxxxxxx.16.STATE";
              var TAG2 = "hm-rega.0.xxx";
              var text = "Die Mitteilung";
              
              on (TAG1,function(obj){
                    if (obj.state.val === true && TAG2 === true)
                    sendTo('pushover.0', text);
              });
              
              var TAG1 = "hm-rpc.1.JEQxxxxxx.16.STATE";
              var TAG2 = "hm-rega.0.xxx";
              var text = "Die Mitteilung";
              
              on (TAG1,function(obj){
                    if (obj.state.val){if (TAG1 ===true && TAG2 === true),
                    sendTo('pushover.0', text);
              }});
              

              Und ich steh echt auf dem Schlauch…muss wohl dazu sagen, dass mein C echt unterirdisch ist.

              Wenn mir da jemand auf den rechten Pfad helfen würde.

              Gruß

              Thomas

              BTW:

              Scripte dürfen keinesfalls in global abgelegt werden…dann werden Sie wohl nicht abgearbeitet...hätte ich mal früher drauf gehört.

              1 Reply Last reply Reply Quote 0
              • blauholsten
                blauholsten Developer last edited by

                Hi,

                probier mal

                if(obj.newState.val && getState(TAG2).val)
                
                1 Reply Last reply Reply Quote 0
                • htrecksler
                  htrecksler Forum Testing last edited by

                  ` > on (TAG1,function(obj){

                  if (obj.state.val === true && TAG2 === true)

                  sendTo('pushover.0', text);

                  }); `

                  ich denke, da fehlen die Klammern… (Fall ich auch ständig 'drauf rein)

                   if ((obj.state.val === true) && (TAG2 === true))
                  
                  

                  Gruss Hermann

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

                    @Mr. Burns:

                    Aber sowas nicht:

                    var TAG1 = "hm-rpc.1.JEQxxxxxx.16.STATE";
                    var TAG2 = "hm-rega.0.xxx";
                    var text = "Die Mitteilung";
                    
                    on (TAG1 === true && TAG2 === true,function(obj){
                          if (obj.state.val)
                          sendTo('pushover.0', text);
                    });
                    ```` `  
                    

                    Empfehlung:

                    var TAG1 = "hm-rpc.1.JEQxxxxxx.16.STATE";
                    var TAG2 = "hm-rega.0.xxx";
                    var text = "Die Mitteilung";
                    var t1;
                    var t2;
                    
                    function t12() {
                    	if (t1 && t2) sendTo('pushover.0', text);
                    }
                    
                    on(TAG1, function(dp) {
                    	t1 = dp.state.val;
                    	t12();
                    });
                    on(TAG2, function(dp) {
                    	t2 = dp.state.val;
                    	t12();
                    });
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • Mr. Burns
                      Mr. Burns last edited by

                      Danke für eure Unterstützung!

                      Dieses Script funktioniert:

                      if(obj.newState.val && getState(TAG2).val)
                      

                      Dieser:

                      if ((obj.state.val === true) && (TAG2 === true))
                      

                      und dieser:

                      var TAG1 = "hm-rpc.1.JEQxxxxxx.16.STATE";
                      var TAG2 = "hm-rega.0.xxx";
                      var text = "Die Mitteilung";
                      var t1;
                      var t2;
                      
                      function t12() {
                         if (t1 && t2) sendTo('pushover.0', text);
                      }
                      
                      on(TAG1, function(dp) {
                         t1 = dp.state.val;
                         t12();
                      });
                      on(TAG2, function(dp) {
                         t2 = dp.state.val;
                         t12();
                      });
                      

                      leider nicht.

                      Ich habe ein paar Fälle, wo ich den negativen Status abfragen muss. Also bei "false" auslösen oder prüfen auf "false" bzw. ODER Verknüpfungen.

                      wie läßt sich das realisieren?

                      so hat es nicht funktioniert:

                      if(obj.newState.val && getState(TAG2 === true).val)
                      

                      oder

                      if(obj.newState.val && getState(TAG2 === false).val)
                      
                      1 Reply Last reply Reply Quote 0
                      • V
                        versteckt last edited by

                        Hallo,

                        du musst zuerst den Wert holen und kannst ihn dann prüfen:

                        FALSCH:

                        if(obj.newState.val && getState(TAG2 === false).val)

                        RICHTIG:

                        if(obj.newState.val && getState(TAG2).val === false)

                        Mit getState(XXX).val bekommst du den Inhalt der Variable

                        und danach auf Inhalt prüfen.

                        LG Christian

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        550
                        Online

                        31.9k
                        Users

                        80.1k
                        Topics

                        1.3m
                        Posts

                        6
                        16
                        2290
                        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