Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. E3DC Hauskraftwerk steuern

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    E3DC Hauskraftwerk steuern

    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      ArnoD @smartboart last edited by

      @smartboart sagte in E3DC Hauskraftwerk steuern:

      @ArnoD
      du kannst das über die enumeration lösen indem du beide states einer Funktion zuordnest oder eben im script über einen funktionsaufruf..

      z.B:

      var cacheSelectorState = $('state[state.id=*.STATE](functions="Zaehler")'); // Gewerk Zaehler
      cacheSelectorState.on(function(obj) { // bei Zustandänderung *.STATE im Gewerk Zaehler
      if (logging) log('Auslösender Zaehler: ' + obj.id + ': ' + obj.state.val); // Info im Log, welcher Zustand sich geändert hat
      Berechnen(); // Funktionsaufruf
      });
      

      Dieses Beispiel ist interessant.
      Wie müsste ich die folgenden Programmzeilen umschreiben ?

      if (existsState(sPvLeistung_kWh)){
          on({id: sPvLeistung_kWh,change: "ne"}, function (obj){SummePvLeistung();});
      }
      if (existsState(sEinspeiserLeistung_kWh)){
          on({id: sEinspeiserLeistung_kWh,change: "ne"}, function (obj){SummePvLeistung();});	
      }
      

      Verstehe die erste Zeile in deinem Beispiel noch nicht ganz.

      smartboart 1 Reply Last reply Reply Quote 0
      • smartboart
        smartboart @ArnoD last edited by

        @ArnoD
        wenn ich einen Screenshot von den beiden Objekten aus dem admin bekomme, bastle ich das zusammen.
        Wie gesagt beide Objekte müssen dann im Admin unter Aufzählungen dem Gewerk Zaehler zugeordnet sein.

        mit folgendem Script kann man prüfen ob die selektorfunktion funktioniert..

        const test = $ ('state[state.id=*.STATE](functions=Zaehler)');
        test.each(function(id,i){
        log(id);
        });
        
        A 3 Replies Last reply Reply Quote 0
        • A
          ArnoD @smartboart last edited by

          @smartboart
          Du meinst in dieser Maske ?

          bild1.png

          smartboart 1 Reply Last reply Reply Quote 0
          • A
            ArnoD @smartboart last edited by

            @smartboart sagte in E3DC Hauskraftwerk steuern:

            Wie gesagt beide Objekte müssen dann im Admin unter Aufzählungen dem Gewerk Zaehler zugeordnet sein.

            stehe auf dem Schlauch 🙂
            Wo kann ich das Objekt dem Gewerk Zaehler zuordnen?

            1 Reply Last reply Reply Quote 0
            • A
              ArnoD @smartboart last edited by

              @smartboart

              ok, meinst du das ?
              funktioniert nur nicht.
              bild1.png

              smartboart 1 Reply Last reply Reply Quote 0
              • smartboart
                smartboart @ArnoD last edited by

                @ArnoD sagte in E3DC Hauskraftwerk steuern:

                @smartboart

                ok, meinst du das ?
                funktioniert nur nicht.
                bild1.png

                ja genau da

                1 Reply Last reply Reply Quote 0
                • smartboart
                  smartboart @ArnoD last edited by

                  @ArnoD sagte in E3DC Hauskraftwerk steuern:

                  @smartboart
                  Du meinst in dieser Maske ?

                  bild1.png

                  ja

                  smartboart 1 Reply Last reply Reply Quote 0
                  • smartboart
                    smartboart @smartboart last edited by

                    @ und der 2. state?

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      ArnoD @smartboart last edited by

                      @smartboart
                      Den gib es bei mir nicht ,da ich nur einen Zähler habe.
                      Aber der eine wird mir schon nicht angezeigt wenn ich dein test script laufen lasse.

                      smartboart 2 Replies Last reply Reply Quote 0
                      • smartboart
                        smartboart @ArnoD last edited by

                        @ArnoD ja der selektor mus angepasst werden, deshalb wollte ich ja die states sehen. hab gleich mittag, dann kann ich testen...

                        1 Reply Last reply Reply Quote 0
                        • smartboart
                          smartboart @ArnoD last edited by

                          @ArnoD sagte in E3DC Hauskraftwerk steuern:

                          @smartboart
                          Den gib es bei mir nicht ,da ich nur einen Zähler habe.
                          Aber der eine wird mir schon nicht angezeigt wenn ich dein test script laufen lasse.

                          der state muss sich einmal ändern und wenn eine eneumeratio also aufzählung dazu kommt muss es neu gestartet weden.

                          zeig mal dein Versuch.groß kleinschreibung ist auch wichtig

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            ArnoD @smartboart last edited by

                            @smartboart

                            so habe ich es probiert. Ich habe auch schon Zaehler groß geschrieben.

                            const test = $ ('state[state.id=*.STATE](functions=zaehler)');
                            test.each(function(id,i){
                            log('************************'+id);
                            });
                            
                            smartboart 1 Reply Last reply Reply Quote 0
                            • smartboart
                              smartboart @ArnoD last edited by

                              @ArnoD sagte in E3DC Hauskraftwerk steuern:

                              @smartboart

                              so habe ich es probiert. Ich habe auch schon Zaehler groß geschrieben.

                              const test = $ ('state[state.id=*.STATE](functions=zaehler)');
                              test.each(function(id,i){
                              log('************************'+id);
                              });
                              

                              .state klein

                              A 1 Reply Last reply Reply Quote 0
                              • A
                                ArnoD @smartboart last edited by

                                @smartboart

                                const test = $ ('state[state.id=*.state](functions=Zaehler)');
                                test.each(function(id,i){
                                log('************************'+id);
                                });
                                

                                geht auch nicht

                                smartboart 1 Reply Last reply Reply Quote 0
                                • smartboart
                                  smartboart @ArnoD last edited by

                                  @ArnoD ok hast mal ein Bild von der Enum konfiguration? dortwird automatisch wenn man Zaehler einträgt im untern Felt zaehler klein gesetzt

                                  smartboart A 2 Replies Last reply Reply Quote 0
                                  • smartboart
                                    smartboart @smartboart last edited by

                                    Unbenannt.JPG

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      ArnoD @smartboart last edited by

                                      @smartboart bild1.png

                                      ja ist so, werde mal beide Groß schreiben.

                                      smartboart 1 Reply Last reply Reply Quote 0
                                      • smartboart
                                        smartboart @ArnoD last edited by

                                        @ArnoD
                                        das .state im Selektor steht für siehe bild gelbe markierung
                                        Unbenannt.JPG

                                        smartboart 1 Reply Last reply Reply Quote 0
                                        • smartboart
                                          smartboart @smartboart last edited by

                                          problem ist wenn man darauf triggert, müssen alle states so aufgebaut sein. bei meinen modbus zählern ist z.B. . value hinterlegt

                                          smartboart A 2 Replies Last reply Reply Quote 0
                                          • smartboart
                                            smartboart @smartboart last edited by smartboart

                                            bei mir sieht das dann so aus...
                                            siehe log unten

                                            Unbenannt.JPG

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            809
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            70
                                            3331
                                            1363281
                                            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