Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. Auf ein iorboker Objekt in einem Array auslösen

    NEWS

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    • Save The Date: ioBroker@Smart Living Forum Solingen, 14.06.

    Auf ein iorboker Objekt in einem Array auslösen

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

      Kann man auf ein iorboker Objekt (mit der id natürlich) in einem Array auslösen, wenn sich sein Zustand ändert?

      In diesem solle mehre iobroker Objekte rein.
      Mit freundlichen Grüßen

      Kevin

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

        Ja, man kann auch ein Array mit Datenpunkt-IDs an on() übergeben.

        1 Reply Last reply Reply Quote 0
        • X
          XerXes777 last edited by

          Moin,

          danke für deine Antwort.
          Kannst du mir bei der Zusammenstellung des Codes für den Befehl on() helfen?

          Mein array sieht akutell so aus:

          const idDB = [
            {
              objectName: 'Kontakt1',
              description: 'Kontakt1 in bedroom',
              iobrokerID: 'Here is the ID',
              unitTrue: true,
              unitFalse: false,
              other: '1'
            },
            {
              objectName: 'Kontakt2',
              description: 'Kontakt2 in livingroom',
              iobrokerID: 'Here is the ID',
              unitTrue: true,
              unitFalse: false,
              other: '1'
            },
            {
              objectName: 'Kontakt3',
              description: 'Kontakt3 in kitchen',
              iobrokerID: 'Here is the ID',
              unitTrue: '1',
              unitFalse: '0',
              other: '1'
            }];
          

          Und möchte auf die ID´s in 'iobrockerID' auslösen.
          Geht das ?

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

            @XerXes777 sagt:

            Geht das ?

            Ja, etwa so.

            var ids = [];
            for(let i = 0; i < idDB.length; i++) {
               ids[i] = idDB[i].iobrokerID;
            }
            
            on(ids, callback);
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Support us

            ioBroker
            Community Adapters
            Donate

            944
            Online

            31.6k
            Users

            79.4k
            Topics

            1.3m
            Posts

            2
            4
            242
            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