Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [gelöst] channelID hat keinen Wert

    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

    [gelöst] channelID hat keinen Wert

    This topic has been deleted. Only users with topic management privileges can see it.
    • paul53
      paul53 @MCU last edited by

      @MCU sagte:

      daran liegen, daß die Kanal-ID nur bis zur 2. Ebene geht?

      Ja, die Kanal-ID liefert immer das parent-Objekt, sofern vorhanden. "Apps" ist kein Objekt, sondern nur ein Ordner. Die Kanal-ID solltest Du erhalten, wenn Du stattdessen die Geräte-ID abfragst.

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

        @paul53 Hab es geändert:

        iobroker-Geräte-ID-ohneFunktion.png

        Funktioniert auch nicht!

        paul53 M 2 Replies Last reply Reply Quote 0
        • paul53
          paul53 @MCU last edited by paul53

          @MCU sagte:

          Funktioniert auch nicht!

          Ja, konnte ich nachvollziehen. Der zusätzliche Punkt in der Datenpunkt-ID stört offenbar.

          Blockly_temp.JPG

          1 Reply Last reply Reply Quote 0
          • M
            MCU @MCU last edited by

            @MCU Ok, dann muß die Datenpunkte verändern:

            /* Apps */
            createState('TASKER.' + TASKER_ID + '.Apps',false, {
            write:true,
            read: false,
            desc: "Apps",
            type: "channel",
            name: "Apps",
            role: "channel",
            def: false
            });

            Wäre das so richtig?
            Vielen Dank.

            paul53 M 2 Replies Last reply Reply Quote 0
            • paul53
              paul53 @MCU last edited by paul53

              @MCU sagte:

              Wäre das so richtig?

              Nein, mit createState kann man keinen "channel" erzeugen.

              let obj = {};
              obj.type = 'channel';
              obj.common = {};
              obj.common.name = 'Alle Applikation-Daten';
              obj.native ={};
              setObject('javascript.0.TASKER.' + TASKER_ID + '.Apps', obj); 
              
              M 1 Reply Last reply Reply Quote 0
              • M
                MCU @MCU last edited by

                @MCU
                /* Apps-Struktur */
                createState('TASKER.' + TASKER_ID + '.Apps',false, {
                write:true,
                read: false,
                desc: "Apps",
                type: "channel",
                name: "Alle Applikation-Daten",
                role: "channel",
                def: false
                });

                Den "Ordner" auch als Channel definiert und schon klappt es. Hatte also nichts mit dem Update auf 4.6.22 zu tun.
                Vielen Dank @paul53

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

                  @paul53 Hat aber geklappt!

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

                    @MCU sagte:

                    Hat aber geklappt!

                    Ja, Du hast zwar ein Objekt erzeugt, allerdings einen Datenpunkt mit dem unzulässigen Typ "channel".

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

                      @paul53 iobroker-Kanal-ID-Channel-angelegt.png

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

                        @MCU Genau so wie ich geschrieben habe: Datenpunkt vom unzulässigen Typ "channel". Du kannst das falsche Objekt aber - wie oben beschrieben - korrigieren: setObject(id, obj) überschreibt das bestehende Objekt.

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

                          @paul53 Hab den Typ geändert. Klappt wunderbar. Vielen Dank für die Hilfe.

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

                            @MCU sagte:

                            Typ geändert. Klappt wunderbar.

                            Dann solltest Du gleich noch das parent-Objekt vom channel korrigieren:

                            let obj = {};
                            obj.type = 'device';
                            obj.common = {};
                            obj.common.name = 'TAB_2';
                            obj.native = {};
                            setObject('javascript.0.TASKER.' + TASKER_ID, obj);
                            
                            M 1 Reply Last reply Reply Quote 0
                            • M
                              MCU @paul53 last edited by

                              @paul53 Super. Mache ich. Vielen Dank.

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

                              Support us

                              ioBroker
                              Community Adapters
                              Donate

                              444
                              Online

                              31.9k
                              Users

                              80.2k
                              Topics

                              1.3m
                              Posts

                              blockly javascript
                              2
                              23
                              953
                              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