Skip to content
  • Home
  • 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
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. Datenpunkte zusammenführen switch + state

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    3.0k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.1k

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.4k

Datenpunkte zusammenführen switch + state

Scheduled Pinned Locked Moved Solved ioBroker Allgemein
s7.0datenpunkteobjekte
55 Posts 3 Posters 4.4k 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.
  • 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.... :blush:

                        Vielen Dank werde ich direkt testen.:+1:

                        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 :+1:
                          Du bist der beste!
                          Danke!

                          paul53P 1 Reply Last reply
                          0
                          • Elektroniker86E Elektroniker86

                            @paul53
                            Einfach Klasse! Funktioniert einwandfrei :+1:
                            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

                            297

                            Online

                            32.6k

                            Users

                            82.3k

                            Topics

                            1.3m

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

                            • Don't have an account? Register

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