Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. [Gelöst]javascripte laufen nicht mehr

    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]javascripte laufen nicht mehr

    This topic has been deleted. Only users with topic management privileges can see it.
    • liv-in-sky
      liv-in-sky @Lollo last edited by

      @lollo bitte auch die oberen nachbessern - danke

      L 1 Reply Last reply Reply Quote 0
      • L
        Lollo @liv-in-sky last edited by

        @liv-in-sky die "oberen" sind doch in den "unteren" enthalten und waren nicht vollständig.

        liv-in-sky 1 Reply Last reply Reply Quote 0
        • liv-in-sky
          liv-in-sky @Lollo last edited by liv-in-sky

          @lollo weißt du wie nervig das ist - bis an diesen punkt hier zu scrollen - da verlieren die leute die lust, den thread zu lesen

          hast du zufällig unter global ein script liegen ? du musst expertenmodus aktivieren !

          Image 1.png

          1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @Lollo last edited by

            @lollo sagte in javascripte laufen nicht mehr:

            script.js.common.Licht.Johanna_Licht_und_Alexa_aus compile failed: at script.js.common.Licht.Johanna_Licht_und_Alexa_aus:1

            Was steht in diesem Script in Zeile 1?

            Da es anscheinend bei allen Skripts die Zeile 1 ist, ist die Frage von @liv-in-sky mehr als berechtigt

            L 1 Reply Last reply Reply Quote 0
            • L
              Lollo @Homoran last edited by

              @liv-in-sky
              du hast Recht... ich habe den linkeddevices Adapter testweise ausprobiert und dann wieder gelöscht, da ich den manage devices Adapter nutze.

              im global Ordner ist nun folgendes skript:

              var  = {};
              .getId = function() {return "linkeddevices.0"};
              
              .Johanna_Stehlampe = {};
              .Johanna_Stehlampe.getId = function() {return "linkeddevices.0.Johanna_Stehlampe"};
              .Johanna_Stehlampe.on = {};
              .Johanna_Stehlampe.on.getId = function () { let obj = getObject("linkeddevices.0.Johanna_Stehlampe.on"); if (obj && obj.common && obj.common.custom && obj.common.custom["linkeddevices.0"] && obj.common.custom["linkeddevices.0"].isLinked === false) console.warn("object 'linkeddevices.0.Johanna_Stehlampe.on' is not linked anymore!"); return "linkeddevices.0.Johanna_Stehlampe.on"; };
              .Johanna_Stehlampe.on.getState = function () { let obj = getObject("linkeddevices.0.Johanna_Stehlampe.on"); if (obj && obj.common && obj.common.custom && obj.common.custom["linkeddevices.0"] && obj.common.custom["linkeddevices.0"].isLinked === false) console.warn("object 'linkeddevices.0.Johanna_Stehlampe.on' is not linked anymore!"); return getState("linkeddevices.0.Johanna_Stehlampe.on"); };
              .Johanna_Stehlampe.on.setState = function (val, ack=false) { let obj = getObject("linkeddevices.0.Johanna_Stehlampe.on"); if (obj && obj.common && obj.common.custom && obj.common.custom["linkeddevices.0"] && obj.common.custom["linkeddevices.0"].isLinked === false) console.warn("object 'linkeddevices.0.Johanna_Stehlampe.on' is not linked anymore!"); setState("linkeddevices.0.Johanna_Stehlampe.on", val, ack); };
              .Johanna_Stehlampe.on.setStateDelayed = function (val, delay, ack=false) { let obj = getObject("linkeddevices.0.Johanna_Stehlampe.on"); if (obj && obj.common && obj.common.custom && obj.common.custom["linkeddevices.0"] && obj.common.custom["linkeddevices.0"].isLinked === false) console.warn("object 'linkeddevices.0.Johanna_Stehlampe.on' is not linked anymore!"); setStateDelayed("linkeddevices.0.Johanna_Stehlampe.on", val, ack, delay); };
              .Johanna_Stehlampe.on.getObject = function () { let obj = getObject("linkeddevices.0.Johanna_Stehlampe.on"); if (obj && obj.common && obj.common.custom && obj.common.custom["linkeddevices.0"] && obj.common.custom["linkeddevices.0"].isLinked === false) console.warn("object 'linkeddevices.0.Johanna_Stehlampe.on' is not linked anymore!"); return getObject("linkeddevices.0.Johanna_Stehlampe.on"); };
              .Johanna_Stehlampe.on.getParentId = function () { let obj = getObject("linkeddevices.0.Johanna_Stehlampe.on"); if (obj && obj.common && obj.common.custom && obj.common.custom["linkeddevices.0"] && obj.common.custom["linkeddevices.0"].isLinked === false) console.warn("object 'linkeddevices.0.Johanna_Stehlampe.on' is not linked anymore!"); return getObject("linkeddevices.0.Johanna_Stehlampe.on").common.custom["linkeddevices.0"].parentId; };
              

              @Homoran

              das ist das script welches Du meintest:

              on({id: 'deconz.0.Sensors.24.buttonevent', change: "ne"}, function (obj) {
                var value = obj.state.val;
                var oldValue = obj.oldState.val;
                if (getState("deconz.0.Sensors.24.buttonevent").val == 1002) {
                  setState("hue.0.Johanna.on"/*Johanna.on*/, true);
                } else if (getState("deconz.0.Sensors.24.buttonevent").val == 2002) {
                  setState("hue.0.Johanna.on"/*Johanna.on*/, false);
                }
              });
              
              liv-in-sky Homoran 3 Replies Last reply Reply Quote 0
              • liv-in-sky
                liv-in-sky @Lollo last edited by

                @lollo sagte in javascripte laufen nicht mehr:

                im global Ordner ist nun folgendes skript:

                ja -da ist der fehler drin var={}

                also stoppe das script - am besten kopiere es und lösche es dann

                1 Reply Last reply Reply Quote 0
                • Homoran
                  Homoran Global Moderator Administrators @Lollo last edited by

                  @lollo sagte in javascripte laufen nicht mehr:

                  im global Ordner ist nun folgendes skript:

                  und das wird jetzt vor jedem anderen Skript ausgeführt, ob es passt oder nicht

                  1 Reply Last reply Reply Quote 0
                  • liv-in-sky
                    liv-in-sky @Lollo last edited by

                    @lollo

                    wie @Homoran sagt

                    ein script unter global wird an jedes andere script dazukopiert (damit es global erreichbar wird) - nutzen nur profis, weil damit genau solche fehler passieren können -

                    L 1 Reply Last reply Reply Quote 0
                    • L
                      Lollo @liv-in-sky last edited by

                      @liv-in-sky
                      @Homoran

                      dann kann ich das skript unter global doch einfach löschen, da ich es doch eh nicht brauche., oder ?

                      liv-in-sky 1 Reply Last reply Reply Quote 0
                      • liv-in-sky
                        liv-in-sky @Lollo last edited by

                        @lollo denke schon, wenn du nicht weißt, was es macht - daher kopiere es in einen editor und lösche es - dann hast du es zur not

                        Homoran L 2 Replies Last reply Reply Quote 0
                        • Homoran
                          Homoran Global Moderator Administrators @liv-in-sky last edited by

                          @liv-in-sky sagte in javascripte laufen nicht mehr:

                          daher kopiere es in einen editor und lösche es

                          😂 Löschen im Editor bringt aber nichts 😂

                          1 Reply Last reply Reply Quote 0
                          • L
                            Lollo @liv-in-sky last edited by

                            @liv-in-sky
                            @Homoran

                            vielen Dank an euch beiden. Ihr seid Spitze... und ich hab wieder was gelernt. So macht iobroker erst richtig spaß.

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

                            Support us

                            ioBroker
                            Community Adapters
                            Donate

                            930
                            Online

                            31.9k
                            Users

                            80.1k
                            Topics

                            1.3m
                            Posts

                            3
                            19
                            749
                            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