Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [FIXED] Problem mit Javascript und View Change

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [FIXED] Problem mit Javascript und View Change

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

      Audi-PC 2016-07-11 18:19:54.921 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      Audi-PC 2016-07-11 18:19:17.046 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      Audi-PC 2016-07-11 18:18:38.962 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      Audi-PC 2016-07-11 18:18:00.370 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      javascript.0 2016-07-11 18:18:00.311 error uncaught exception: coffee.helpers.prettyErrorMessage is not a function

      Audi-PC 2016-07-11 18:17:22.256 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      Audi-PC 2016-07-11 18:16:44.080 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      Audi-PC 2016-07-11 18:16:06.014 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      Audi-PC 2016-07-11 18:15:29.490 error host.Audi-PC instance system.adapter.hmm.0 terminated with code 3 (Adapter disabled or invalid config)

      Audi-PC 2016-07-11 18:15:27.424 error host.Audi-PC instance system.adapter.javascript.0 terminated with code 0 (OK)

      1 Reply Last reply Reply Quote 0
      • P
        pix last edited by

        Hallo,

        Ohne das Skript kann man fast gar nix sagen 🙂

        Bitte Skripte und Logs in Codetags posten und wenn sie länger sind auch einen Spoiler drumrum.

        Gruß

        Pix

        Gesendet mit Tapatalk

        1 Reply Last reply Reply Quote 0
        • F
          firstfreak last edited by

          on("hm-rega.0.34494"/*Haustürklingel*/, function (obj){
              if (obj.newState.val) {
          
                     setState("vis.0.control.instance", 'FFFFFFFF');
                     setState("vis.0.control.data",     'Tuerklingel');
                     setState("vis.0.control.command",  'changeView'); 
                     //Nach 10 Sekunden, zeige wieder Start View
                     setTimeout(function () {
                   setState("vis.0.control.instance", 'FFFFFFFF');
                     setState("vis.0.control.data",     'Allgemein');
                     setState("vis.0.control.command",  'changeView');  
                     }, 10000);
              }
          });
          
          1 Reply Last reply Reply Quote 0
          • blauholsten
            blauholsten Developer last edited by

            @firstfreak:

            on("hm-rega.0.34494"/*Haustürklingel*/, function (obj){
                if (obj.newState.val) {
                    
                       setState("vis.0.control.instance", 'FFFFFFFF');
                       setState("vis.0.control.data",     'Tuerklingel');
                       setState("vis.0.control.command",  'changeView'); 
                       //Nach 10 Sekunden, zeige wieder Start View
                       setTimeout(function () {
                     setState("vis.0.control.instance", 'FFFFFFFF');
                       setState("vis.0.control.data",     'Allgemein');
                       setState("vis.0.control.command",  'changeView');  
                       }, 10000);
                }
            });
            ```` `  
            

            Schaust du hier… http://forum.iobroker.net/viewtopic.php?f=21&t=2791

            1 Reply Last reply Reply Quote 0
            • F
              firstfreak last edited by

              aus dem Thread habe ich alle mögliche ausprobiert, nichts. Ich verzweifel hier gleich.

              1 Reply Last reply Reply Quote 0
              • blauholsten
                blauholsten Developer last edited by

                Was passiert denn wenn du den Code ausführst? Ich gehe davon aus nichts?

                Mach doch mal folgendes….

                
                function test()
                {
                setState("vis.0.control.instance", 'FFFFFFFF');
                           setState("vis.0.control.data",     'Tuerklingel');
                           setState("vis.0.control.command",  'changeView'); 
                           //Nach 10 Sekunden, zeige wieder Start View
                           setTimeout(function () {
                         setState("vis.0.control.instance", 'FFFFFFFF');
                           setState("vis.0.control.data",     'Allgemein');
                           setState("vis.0.control.command",  'changeView');  
                           }, 10000);
                    }
                
                }
                
                test();
                
                

                Wenn du dann das Skript startest sollte was passieren…

                1 Reply Last reply Reply Quote 0
                • F
                  firstfreak last edited by

                  So das kommt dabei raus. Aber danke schonmal
                  1207_script-test.jpg

                  1 Reply Last reply Reply Quote 0
                  • blauholsten
                    blauholsten Developer last edited by

                    Eine Klammer zuviel vom kopieren….

                    function test()
                    {
                                setState("vis.0.control.instance", 'FFFFFFFF');
                               setState("vis.0.control.data",     'Tuerklingel');
                                setState("vis.0.control.command",  'changeView'); 
                               //Nach 10 Sekunden, zeige wieder Start View
                               setTimeout(function () {
                                setState("vis.0.control.instance", 'FFFFFFFF');
                               setState("vis.0.control.data",     'Allgemein');
                               setState("vis.0.control.command",  'changeView');  
                               }, 10000);
                        }
                    
                    test();
                    

                    Ach ja, lege solche Skripte nicht bei GLOBAL an…

                    1 Reply Last reply Reply Quote 0
                    • F
                      firstfreak last edited by

                      ich habe es verschoben aus global raus. es ging (test).

                      Das ist ja cool. Danke

                      Ich versuche das andere jetzt nochmal.

                      1 Reply Last reply Reply Quote 0
                      • F
                        firstfreak last edited by

                        Jetzt geht es, top. Danke

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

                          Bitte Tonic auf fixed ändern.

                          1 Reply Last reply Reply Quote 0
                          • F
                            firstfreak last edited by

                            ein Problem ist aber noch, es schaltet jetzt wie es soll, aber

                            ich habe die zeit sogar von 60000 auf 90000 geändert aber es schaltet immer noch ein paar Sekunden zurück. Wo kann da noch der Fehler sein ?

                            on({id: "hm-rpc.0.KEQ0058102.2.PRESS_LONG", change: "any"}, function (obj){
                                //View wechseln
                                setState("vis.0.control.command", '{"instance": "FFFFFFFF", "data": "Tuerklingel", "command": "changeView"}');
                                //Nach 60 Sekunden wieder Haupt-View anzeigen
                                setTimeout(function () {
                                    setState("vis.0.control.command", '{"instance": "FFFFFFFF", "data": "Allgemein", "command": "changeView"}');
                                }, 90000);
                            });
                            
                            1 Reply Last reply Reply Quote 0
                            • blauholsten
                              blauholsten Developer last edited by

                              @firstfreak:

                              ein Problem ist aber noch, es schaltet jetzt wie es soll, aber

                              ich habe die zeit sogar von 60000 auf 90000 geändert aber es schaltet immer noch ein paar Sekunden zurück. Wo kann da noch der Fehler sein ?

                              on({id: "hm-rpc.0.KEQ0058102.2.PRESS_LONG", change: "any"}, function (obj){
                                  //View wechseln
                                  setState("vis.0.control.command", '{"instance": "FFFFFFFF", "data": "Tuerklingel", "command": "changeView"}');
                                  //Nach 60 Sekunden wieder Haupt-View anzeigen
                                  setTimeout(function () {
                                      setState("vis.0.control.command", '{"instance": "FFFFFFFF", "data": "Allgemein", "command": "changeView"}');
                                  }, 90000);
                              });
                              ```` `  
                              

                              Weiß nicht ob es hilft, aber leere mal den Browser Cache…

                              1 Reply Last reply Reply Quote 0
                              • F
                                firstfreak last edited by

                                @blauholsten:

                                @firstfreak:

                                ein Problem ist aber noch, es schaltet jetzt wie es soll, aber

                                ich habe die zeit sogar von 60000 auf 90000 geändert aber es schaltet immer noch ein paar Sekunden zurück. Wo kann da noch der Fehler sein ?

                                on({id: "hm-rpc.0.KEQ0058102.2.PRESS_LONG", change: "any"}, function (obj){
                                    //View wechseln
                                    setState("vis.0.control.command", '{"instance": "FFFFFFFF", "data": "Tuerklingel", "command": "changeView"}');
                                    //Nach 60 Sekunden wieder Haupt-View anzeigen
                                    setTimeout(function () {
                                        setState("vis.0.control.command", '{"instance": "FFFFFFFF", "data": "Allgemein", "command": "changeView"}');
                                    }, 90000);
                                });
                                ```` `  
                                

                                Weiß nicht ob es hilft, aber leere mal den Browser Cache… `

                                Das hat funktioniert, vielen Dank

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

                                Support us

                                ioBroker
                                Community Adapters
                                Donate

                                938
                                Online

                                31.7k
                                Users

                                79.7k
                                Topics

                                1.3m
                                Posts

                                4
                                15
                                1923
                                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