Skip to content
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. Datenpunkte zusammenführen switch + state

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.1k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.8k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.1k

Datenpunkte zusammenführen switch + state

Scheduled Pinned Locked Moved Solved ioBroker Allgemein
s7.0datenpunkteobjekte
55 Posts 3 Posters 4.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Elektroniker86E Elektroniker86

    @paul53 sagte in Datenpunkte zusammenführen switch + state:

    on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function() {

    MEGA!!!

    Jetzt funktioniert es !!! 😊

    paul53P Offline
    paul53P Offline
    paul53
    wrote on last edited by paul53
    #42

    @Elektroniker86 sagte:

    Jetzt funktioniert es !!!

    Sorry, es war mein Fehler: Hatte nicht daran gedacht, dass der Trigger eine vollständige ID braucht.
    Funktioniert es auch so ?

    // IDs anpassen
    const idButton = 's7.0.DBs.DB1.NI02';
    const idActor = 's7.0.DBs.DB1.Q02';
     
    const js = 'system.adapter.javascript.' + instance;
    const common = getObject(idButton).common;
    const idVis = 'LOGO.s7-0.' + common.name.replace(/\s/g, '_');
     
    common.read = true;
    createState(idVis, getState(idActor).val, common);
     
    on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function() {
        setState(idButton, true);
    });
     
    on(idActor, function(dp) {
        setState(idVis, dp.state.val, true);
    });
    

    EDIT: Zeile 7 replace geändert.

    Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
    Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

    Elektroniker86E 4 Replies Last reply
    1
    • paul53P paul53

      @Elektroniker86 sagte:

      Jetzt funktioniert es !!!

      Sorry, es war mein Fehler: Hatte nicht daran gedacht, dass der Trigger eine vollständige ID braucht.
      Funktioniert es auch so ?

      // IDs anpassen
      const idButton = 's7.0.DBs.DB1.NI02';
      const idActor = 's7.0.DBs.DB1.Q02';
       
      const js = 'system.adapter.javascript.' + instance;
      const common = getObject(idButton).common;
      const idVis = 'LOGO.s7-0.' + common.name.replace(/\s/g, '_');
       
      common.read = true;
      createState(idVis, getState(idActor).val, common);
       
      on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function() {
          setState(idButton, true);
      });
       
      on(idActor, function(dp) {
          setState(idVis, dp.state.val, true);
      });
      

      EDIT: Zeile 7 replace geändert.

      Elektroniker86E Offline
      Elektroniker86E Offline
      Elektroniker86
      wrote on last edited by
      #43

      @paul53

      Moment ich teste.

      1 Reply Last reply
      0
      • Elektroniker86E Elektroniker86

        @paul53

        Was ist mit dem Log ?
        Kann man diese Zeile wieder entfernen?

        paul53P Offline
        paul53P Offline
        paul53
        wrote on last edited by
        #44

        @Elektroniker86 sagte:

        Kann man diese Zeile wieder entfernen?

        Ja, war nur zum Test, ob getriggert wird.

        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

        1 Reply Last reply
        0
        • paul53P paul53

          @Elektroniker86 sagte:

          Jetzt funktioniert es !!!

          Sorry, es war mein Fehler: Hatte nicht daran gedacht, dass der Trigger eine vollständige ID braucht.
          Funktioniert es auch so ?

          // IDs anpassen
          const idButton = 's7.0.DBs.DB1.NI02';
          const idActor = 's7.0.DBs.DB1.Q02';
           
          const js = 'system.adapter.javascript.' + instance;
          const common = getObject(idButton).common;
          const idVis = 'LOGO.s7-0.' + common.name.replace(/\s/g, '_');
           
          common.read = true;
          createState(idVis, getState(idActor).val, common);
           
          on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function() {
              setState(idButton, true);
          });
           
          on(idActor, function(dp) {
              setState(idVis, dp.state.val, true);
          });
          

          EDIT: Zeile 7 replace geändert.

          Elektroniker86E Offline
          Elektroniker86E Offline
          Elektroniker86
          wrote on last edited by
          #45

          @paul53

          Einwandfrei läuft !!!

          paul53P 1 Reply Last reply
          0
          • Elektroniker86E Elektroniker86

            @paul53

            Einwandfrei läuft !!!

            paul53P Offline
            paul53P Offline
            paul53
            wrote on last edited by
            #46

            @Elektroniker86 sagte:

            Einwandfrei läuft !!!

            Dann kannst Du dieses Skript als Vorlage für weitere Skripte nutzen und musst nur Zeilen 2, 3 und gegebenfalls Zeile 7 anpassen.

            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

            Elektroniker86E 1 Reply Last reply
            0
            • paul53P paul53

              @Elektroniker86 sagte:

              Jetzt funktioniert es !!!

              Sorry, es war mein Fehler: Hatte nicht daran gedacht, dass der Trigger eine vollständige ID braucht.
              Funktioniert es auch so ?

              // IDs anpassen
              const idButton = 's7.0.DBs.DB1.NI02';
              const idActor = 's7.0.DBs.DB1.Q02';
               
              const js = 'system.adapter.javascript.' + instance;
              const common = getObject(idButton).common;
              const idVis = 'LOGO.s7-0.' + common.name.replace(/\s/g, '_');
               
              common.read = true;
              createState(idVis, getState(idActor).val, common);
               
              on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function() {
                  setState(idButton, true);
              });
               
              on(idActor, function(dp) {
                  setState(idVis, dp.state.val, true);
              });
              

              EDIT: Zeile 7 replace geändert.

              Elektroniker86E Offline
              Elektroniker86E Offline
              Elektroniker86
              wrote on last edited by
              #47

              @paul53 sagte in Datenpunkte zusammenführen switch + state:

              Sorry, es war mein Fehler: Hatte nicht daran gedacht, dass der Trigger eine vollständige ID braucht.

              Gar kein Problem, ich bin froh das man hier geholfen bekommt.
              Ich selbst hätte das so nicht hinbekommen ein Blockly bekomm ich noch gebacken aber diese Sprache spreche ich leider nicht.
              Wirklich daumen hoch Danke !!!

              1 Reply Last reply
              0
              • paul53P paul53

                @Elektroniker86 sagte:

                Einwandfrei läuft !!!

                Dann kannst Du dieses Skript als Vorlage für weitere Skripte nutzen und musst nur Zeilen 2, 3 und gegebenfalls Zeile 7 anpassen.

                Elektroniker86E Offline
                Elektroniker86E Offline
                Elektroniker86
                wrote on last edited by
                #48

                @paul53 sagte in Datenpunkte zusammenführen switch + state:

                gegebenfalls Zeile 7 anpassen.

                Wieso Zeile 7?

                paul53P 1 Reply Last reply
                0
                • Elektroniker86E Elektroniker86

                  @paul53 sagte in Datenpunkte zusammenführen switch + state:

                  gegebenfalls Zeile 7 anpassen.

                  Wieso Zeile 7?

                  paul53P Offline
                  paul53P Offline
                  paul53
                  wrote on last edited by
                  #49

                  @Elektroniker86 sagte:

                  Wieso Zeile 7?

                  Gibt es nicht auch "LOGO.s7-1." ?

                  Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                  Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                  Elektroniker86E 1 Reply Last reply
                  0
                  • paul53P paul53

                    @Elektroniker86 sagte:

                    Wieso Zeile 7?

                    Gibt es nicht auch "LOGO.s7-1." ?

                    Elektroniker86E Offline
                    Elektroniker86E Offline
                    Elektroniker86
                    wrote on last edited by
                    #50

                    @paul53 sagte in Datenpunkte zusammenführen switch + state:

                    Gibt es nicht auch "LOGO.s7-1." ?

                    Ahh so ja, hab gesehen das in meinem Script bei Zeile 2 anfängt.
                    Passt habs verstanden.

                    1 Reply Last reply
                    0
                    • paul53P paul53

                      @Elektroniker86 sagte:

                      Jetzt funktioniert es !!!

                      Sorry, es war mein Fehler: Hatte nicht daran gedacht, dass der Trigger eine vollständige ID braucht.
                      Funktioniert es auch so ?

                      // IDs anpassen
                      const idButton = 's7.0.DBs.DB1.NI02';
                      const idActor = 's7.0.DBs.DB1.Q02';
                       
                      const js = 'system.adapter.javascript.' + instance;
                      const common = getObject(idButton).common;
                      const idVis = 'LOGO.s7-0.' + common.name.replace(/\s/g, '_');
                       
                      common.read = true;
                      createState(idVis, getState(idActor).val, common);
                       
                      on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function() {
                          setState(idButton, true);
                      });
                       
                      on(idActor, function(dp) {
                          setState(idVis, dp.state.val, true);
                      });
                      

                      EDIT: Zeile 7 replace geändert.

                      Elektroniker86E Offline
                      Elektroniker86E Offline
                      Elektroniker86
                      wrote on last edited by
                      #51

                      @paul53

                      Hey, vielen Dank nochmals für das tolle Script.
                      Habe mittlerweile alles umgestellt und den Scenen Adapter verbannt.
                      So, nun habe ich meine Rollladensteuerung in der LOGO umprogrammiert damit ich die auch von 0-100% ansteuern kann und den Stand sehe.

                      Du ahnst es sicher schon aber kann man dieses Script auch so umschreiben das dass auch für die Rolladen funktioniert?

                      Quasie gleiches Prinzip, ich habe einen Datenpunkt zum ansteuern 0-100% (s7.1.DBs.DB1.NAI01) und ein Datenpunkt vom Status, wo er gerade steht (s7.1.DBs.DB1.AM01)

                      Vielen Dank im voraus!

                      paul53P 1 Reply Last reply
                      0
                      • Elektroniker86E Elektroniker86

                        @paul53

                        Hey, vielen Dank nochmals für das tolle Script.
                        Habe mittlerweile alles umgestellt und den Scenen Adapter verbannt.
                        So, nun habe ich meine Rollladensteuerung in der LOGO umprogrammiert damit ich die auch von 0-100% ansteuern kann und den Stand sehe.

                        Du ahnst es sicher schon aber kann man dieses Script auch so umschreiben das dass auch für die Rolladen funktioniert?

                        Quasie gleiches Prinzip, ich habe einen Datenpunkt zum ansteuern 0-100% (s7.1.DBs.DB1.NAI01) und ein Datenpunkt vom Status, wo er gerade steht (s7.1.DBs.DB1.AM01)

                        Vielen Dank im voraus!

                        paul53P Offline
                        paul53P Offline
                        paul53
                        wrote on last edited by
                        #52

                        @Elektroniker86 sagte:

                        kann man dieses Script auch so umschreiben das dass auch für die Rolladen funktioniert?

                        Kann man.

                        // IDs anpassen
                        const idCmd = 's7.1.DBs.DB1.NAI01';
                        const idStat = 's7.1.DBs.DB1.AM01';
                         
                        const js = 'system.adapter.javascript.' + instance;
                        const common = getObject(idCmd).common;
                        const idVis = 'LOGO.s7-1.' + common.name.replace(/\s/g, '_');
                         
                        common.read = true;
                        createState(idVis, getState(idStat).val, common);
                         
                        on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function(dp) {
                            setState(idCmd, dp.state.val);
                        });
                         
                        on(idStat, function(dp) {
                            setState(idVis, dp.state.val, true);
                        });
                        

                        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                        Elektroniker86E 2 Replies Last reply
                        1
                        • paul53P paul53

                          @Elektroniker86 sagte:

                          kann man dieses Script auch so umschreiben das dass auch für die Rolladen funktioniert?

                          Kann man.

                          // IDs anpassen
                          const idCmd = 's7.1.DBs.DB1.NAI01';
                          const idStat = 's7.1.DBs.DB1.AM01';
                           
                          const js = 'system.adapter.javascript.' + instance;
                          const common = getObject(idCmd).common;
                          const idVis = 'LOGO.s7-1.' + common.name.replace(/\s/g, '_');
                           
                          common.read = true;
                          createState(idVis, getState(idStat).val, common);
                           
                          on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function(dp) {
                              setState(idCmd, dp.state.val);
                          });
                           
                          on(idStat, function(dp) {
                              setState(idVis, dp.state.val, true);
                          });
                          
                          Elektroniker86E Offline
                          Elektroniker86E Offline
                          Elektroniker86
                          wrote on last edited by
                          #53

                          @paul53

                          Wow, das ging ja schnell.... 😊

                          Vielen Dank werde ich direkt testen.👍

                          1 Reply Last reply
                          0
                          • paul53P paul53

                            @Elektroniker86 sagte:

                            kann man dieses Script auch so umschreiben das dass auch für die Rolladen funktioniert?

                            Kann man.

                            // IDs anpassen
                            const idCmd = 's7.1.DBs.DB1.NAI01';
                            const idStat = 's7.1.DBs.DB1.AM01';
                             
                            const js = 'system.adapter.javascript.' + instance;
                            const common = getObject(idCmd).common;
                            const idVis = 'LOGO.s7-1.' + common.name.replace(/\s/g, '_');
                             
                            common.read = true;
                            createState(idVis, getState(idStat).val, common);
                             
                            on({id: 'javascript.0.' + idVis, change: 'ne', fromNe: js}, function(dp) {
                                setState(idCmd, dp.state.val);
                            });
                             
                            on(idStat, function(dp) {
                                setState(idVis, dp.state.val, true);
                            });
                            
                            Elektroniker86E Offline
                            Elektroniker86E Offline
                            Elektroniker86
                            wrote on last edited by
                            #54

                            @paul53
                            Einfach Klasse! Funktioniert einwandfrei 👍
                            Du bist der beste!
                            Danke!

                            paul53P 1 Reply Last reply
                            0
                            • Elektroniker86E Elektroniker86

                              @paul53
                              Einfach Klasse! Funktioniert einwandfrei 👍
                              Du bist der beste!
                              Danke!

                              paul53P Offline
                              paul53P Offline
                              paul53
                              wrote on last edited by
                              #55

                              @Elektroniker86 sagte:

                              Funktioniert einwandfrei

                              Dann entferne noch das Fragezeichen, indem Du bei der Lösung rechts unten auf den 3 Punkten "Mark this post as the correct answer" anwählst.

                              Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                              Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              Support us

                              ioBroker
                              Community Adapters
                              Donate
                              FAQ Cloud / IOT
                              HowTo: Node.js-Update
                              HowTo: Backup/Restore
                              Downloads
                              BLOG

                              749

                              Online

                              32.4k

                              Users

                              81.4k

                              Topics

                              1.3m

                              Posts
                              Community
                              Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                              ioBroker Community 2014-2025
                              logo
                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Recent
                              • Tags
                              • Unread 0
                              • Categories
                              • Unreplied
                              • Popular
                              • GitHub
                              • Docu
                              • Hilfe