Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test js-controller v2.0.x (GitHub)

    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

    Test js-controller v2.0.x (GitHub)

    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User @apollon77 last edited by

      @apollon77
      Ja ich habe ein file/file System.
      Die Umänderung in unit geht kurzzeitig bis sich wieder die Temperatur ändert und dann taucht wieder das Hieroglyphzeichen auf.
      Hier die Datei aus Objekte: zigbee.0.00158d00034d13af.json

      apollon77 2 Replies Last reply Reply Quote 0
      • coyote
        coyote Most Active last edited by

        @apollon77 irgendwie wollen manche Scripte nicht laufen und warum steht bei mir an jedem Script "Instanz deaktiviert" obwohl sie aktiviert ist? 🤔

        javascript.JPG

        Dieses Script hier will auch nicht mehr:

        
        var HueApi = require("node-hue-api").HueApi;
         
        // Replace IP and username!!!
         var host = "192.168.66.31",
             username = "16f4f7d727e98e3f3eaXXXXXXX",
             api = new HueApi(host, username);
             
         var groups_ = [],
             lights_ = [],
             objects_ = [];
          
         // Log JSON results
         var displayResults = function(result) {
             console.log('Reponse: '+JSON.stringify(result, null, 2));
         };
          
         // Parse Light Group 0 (All Lights)
         var parseGroup0 = function(result) {
             if (!result.lights){return} // Empty group
             
             var id = result.id,
                 lights = result.lights,
                 name = "All Lights";
             console.debug('group: '+name+', lights: '+lights);
             groups_[lights] = name;
         };
          
         // Parse Light Groups
         var parseGroups = function(result) {
             for (var i = 0; i < result.length; i++) {
                 if (!result[i].lights){continue} // Empty group
                 
                 var id = result[i].id,
                     lights = result[i].lights,
                     name = result[i].name;
                 console.debug('group: '+name+', lights: '+lights);
                 groups_[lights] = name;
             }
         };
          
         // Parse Lights
         var parseLights = function(result) {
             for (var i = 0; i < result.length; i++) {
                 var id = result[i].id,
                     name = result[i].name;
                 console.debug('light: '+name+', id: '+id);
                 lights_[id] = name;
             } 
         };
          
         // Create States in ioBroker
         var createStates = function(result) {
             // Resync button
             createState('PhilipsHue.Scenes.Resync', false, {role: "button", name: 'Resync Philips Hue Groups, Lights and Scenes'});
          
             for (var i = 0; i < result.length; i++) {
                 if (!result[i].appdata.data){continue} // skip internal szenes
          
                 var id = result[i].id,
                     lights = result[i].lights,
                     name = result[i].name.replace(/"/g,''),
                     pathname = name.replace(/ /g,'_');
                 
                 // Get light names
                 var light_names = [];
                 for (var j = 0; j < lights.length; j++) {
                     var light_name = lights_[lights[j]];
                     light_names.push(light_name);
                 }
          
                 // Room, group or lights linked with scene
                 var group = 'Group: '+groups_[lights] || 'Lights: '+light_names.join(", ");
                 
                 // Create States and skip duplicates
                 if (!objects_[lights+pathname]){
                     console.debug('scene: '+name+', '+group);
                     createState('PhilipsHue.Scenes.'+pathname+'.'+id, false, {role: "button", name: 'Scene: '+name+' ('+group+')'});
                     objects_[lights+pathname] = true;
                 }
             }
         };
          
         // Delete States
         function deleteStates(){
             console.log('Deleting current objects for scenes...');
             objects_ = [];
             $('javascript.0.PhilipsHue.Scenes.*').each(function (id) {
                 deleteState(id);
             });
         }
          
         // Fetch data from Hue API
         function init(){
             api.getGroup(0, function(err, group0) {
                 if (err) throw err;
                 console.log('Processing group 0...');
                 //displayResults(group0);
                 parseGroup0(group0);
             });
             api.groups(function(err, groups) {
                 if (err) throw err;
                 console.log('Processing ' + groups.length + ' groups...');
                 //displayResults(groups);
                 parseGroups(groups);
             });
          
             api.lights(function(err, lights) {
                 if (err) throw err;
                 console.log('Processing ' + lights.lights.length + ' lights...');
                 //displayResults(lights);
                 parseLights(lights.lights);
             });
          
             api.scenes(function(err, scenes) {
                 if (err) throw err;
                 console.log('Processing ' + scenes.length + ' scenes...');
                 //displayResults(scenes);
                 createStates(scenes);
             });
         }
          
         // Init on start
         init();
          
         // Activate scene
         on({id: /^javascript\.0\.PhilipsHue.Scenes\./, val: true}, function (obj) {
             if (obj.id == 'javascript.0.PhilipsHue.Scenes.Resync'){return}
             sceneId = obj.id.split('.').pop();
             console.log('Activating '+obj.name);
             api.activateScene(sceneId, function(err, result) {
                 if (err) throw err;
                 displayResults(result);
             });
             setState(obj.id, false);
         });
          
         // Resync
         on({id: 'javascript.0.PhilipsHue.Scenes.Resync', val: true}, function (obj) {
             console.log('Resync triggered...');
             groups_ = [];
             lights_ = [];
             deleteStates();
             init();
         });
          
         /*schedule("0 3 * * *", function () {
             console.log('Resync triggered...');
             groups_ = [];
             lights_ = [];
             deleteStates();
             init();
         });*/
        
        javascript.0	2019-10-10 19:49:59.137	info	(15370) script.js.Hue_Szenen_abfragen: registered 2 subscriptions and 1 schedule
        javascript.0	2019-10-10 19:49:59.099	info	(15370) Start javascript script.js.Hue_Szenen_abfragen
        javascript.0	2019-10-10 19:49:55.995	info	(15370) Stop script script.js.Hue_Szenen_abfragen
        

        Das wars mehr kommt da nicht mehr... Ne Idee wo ich suchen kann? Mir ist es nur aufgefallen, als meine Hue Lampe heute nicht an ging, wird über ein Script gesteuert.

        apollon77 1 Reply Last reply Reply Quote 0
        • apollon77
          apollon77 @Guest last edited by

          @Nuggelbeb ok wenn zigbee das überschreibt bitte issue bei zigbee anlegen.

          1 Reply Last reply Reply Quote 0
          • apollon77
            apollon77 @coyote last edited by

            @coyote ich hab beim JavaScript Adapter dazu ein issue gesehn.

            coyote 1 Reply Last reply Reply Quote 0
            • coyote
              coyote Most Active @apollon77 last edited by

              @apollon77 ah ok, alles klar.

              Warum das Script nicht mehr korrekt läuft, muss ich selbst mal schauen, irgendwas passt da nicht.
              Die anderen Scripte laufen anscheinend ja.

              1 Reply Last reply Reply Quote 0
              • apollon77
                apollon77 @Guest last edited by

                @Nuggelbeb welche zigbee Version?

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @apollon77 last edited by

                  @apollon77

                  Installierte Version: 0.11.3

                  apollon77 1 Reply Last reply Reply Quote 0
                  • apollon77
                    apollon77 @Guest last edited by

                    @Nuggelbeb @arteck sagte mir du sollst mal aktuelle GitHub nehmen.

                    ? 1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User @apollon77 last edited by

                      @apollon77
                      Auf GitHub ist es doch die aktuelle Version.
                      1.JPG

                      1 Reply Last reply Reply Quote 0
                      • D
                        darkiop Most Active last edited by

                        Direkt von Github installieren (Adapter --> Katze Symbol oder 'iobroker url http://.....), dann hast die letzten Commits unabhängig der letzten Version.

                        ? 1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User @darkiop last edited by

                          @darkiop
                          Okay, da ist es V 0.11.4
                          Bis jetzt geht es. melde mich morgen noch einmal.

                          ? 1 Reply Last reply Reply Quote 0
                          • MathiasJ
                            MathiasJ last edited by

                            Weiß jemand, was mit Frankjoke los ist?
                            So wie ich mich kenne, zerschieße ich was bei einer Änderung. Dashalb lasse ich es lieber.......

                            apollon77 1 Reply Last reply Reply Quote 0
                            • apollon77
                              apollon77 @MathiasJ last edited by

                              @MathiasJ Er ist dran. Das eine File manuell abzupassen tut vorher und nachher!

                              1 Reply Last reply Reply Quote 0
                              • coyote
                                coyote Most Active last edited by

                                @apollon77 kannst du mir vllt da weiterhelfen? Habe diese "node-hue-api" gerade nochmal neu in die javascript instanz hinzugefügt, dann kommt folgendes:

                                host.debian	2019-10-10 22:53:54.042	info	instance system.adapter.javascript.0 terminated with code 156 (156)
                                host.debian	2019-10-10 22:53:54.042	error	Caught by controller[9]: (node:20588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by
                                host.debian	2019-10-10 22:53:54.042	error	Caught by controller[8]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
                                host.debian	2019-10-10 22:53:54.042	error	Caught by controller[8]: (node:20588) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 192.168.66.31:443
                                host.debian	2019-10-10 22:53:54.042	error	Caught by controller[7]: (node:20588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[6]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[6]: (node:20588) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 192.168.66.31:443
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[5]: (node:20588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[4]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[4]: (node:20588) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 192.168.66.31:443
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[3]: (node:20588) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js proc
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[2]: (node:20588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by
                                host.debian	2019-10-10 22:53:54.041	error	Caught by controller[1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
                                host.debian	2019-10-10 22:53:54.040	error	Caught by controller[1]: (node:20588) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 192.168.66.31:443
                                host.debian	2019-10-10 22:53:54.040	error	Caught by controller[0]: ********************************************************************************
                                host.debian	2019-10-10 22:53:54.040	error	Caught by controller[0]: Please consult the documentation at https://github.com/peter-murray/node-hue-api for the documentation on the new API.
                                host.debian	2019-10-10 22:53:54.040	error	Caught by controller[0]: require("node-hue-api").v3
                                host.debian	2019-10-10 22:53:54.040	error	Caught by controller[0]: You need to migrate your code to use the new API available via import
                                host.debian	2019-10-10 22:53:54.040	error	Caught by controller[0]: This will be removed in v4.x of node-hue-api.
                                host.debian	2019-10-10 22:53:54.040	error	Caught by controller[0]: This shim provides a limited backporting of the features available in the updated API in v3.x.
                                host.debian	2019-10-10 22:53:54.039	error	Caught by controller[0]: Backwards compatibility shim for node-hue-api.
                                host.debian	2019-10-10 22:53:54.035	error	Caught by controller[0]: ********************************************************************************
                                javascript.0	2019-10-10 22:53:52.981	info	(20588) Terminated (START_IMMEDIATELY_AFTER_STOP): Without reason
                                javascript.0	2019-10-10 22:53:52.432	info	(20588) Got terminate signal TERMINATE_YOURSELF
                                

                                Vorher hatte das ohne Probleme funktioniert

                                apollon77 1 Reply Last reply Reply Quote 0
                                • apollon77
                                  apollon77 @coyote last edited by

                                  @coyote sagte in [Aufruf] js-controller 2.0 Beta Test:

                                  192.168.66.31:443

                                  Also einmal 192.168.66.31:443 ECONREFUSED heist Connection Refused. DU kannst dich da nicht hin verbinden oder sowas. Da sist aber jetzt 100% Offtopic hier

                                  coyote 1 Reply Last reply Reply Quote 0
                                  • coyote
                                    coyote Most Active @apollon77 last edited by coyote

                                    @apollon77 ja das ist mir eigentlich schon klar, die HueBridge ist aber erreichbar, also eigentlich kann es da nicht dran liegen und der Fehler kam ja erst als ich den node-hue-api in der Javascript Instanz nochmal hinzugefügt hab, deshalb dachte ich es könnte was mit dem js-controller zu tun haben, da es vorher ohne Probleme lief.
                                    Es geht mir eher um die unteren Zeilen

                                    apollon77 1 Reply Last reply Reply Quote 0
                                    • apollon77
                                      apollon77 @coyote last edited by

                                      @coyote Docker? Netzwerk? Firewall? SOwas vllt? Kannst Du von dem ioBroker Host die seite mit curl oder so erreichen? Owas ... aber anderer Thread Bitte!

                                      coyote 1 Reply Last reply Reply Quote 0
                                      • coyote
                                        coyote Most Active @apollon77 last edited by

                                        @apollon77 weder noch und ja ich kann auch über die iobroker objekte von hue, direkt meine lampen schalten, also ist die Bridge ja erreichbar. Hat damit nichts zu tun. Mir geht es nur um diese node-hue-api, das funktioniert nicht mehr. Gestern mit der 2.0.24 ging das ja noch ohne Probleme, sonst noch ne Idee?

                                        apollon77 1 Reply Last reply Reply Quote 0
                                        • apollon77
                                          apollon77 @coyote last edited by

                                          @coyote keine ohne jetzt tief rein zu schauen. Die Änderungen 24->25 sind diesbezüglich auch an sich irrelevant.

                                          coyote 1 Reply Last reply Reply Quote 0
                                          • coyote
                                            coyote Most Active @apollon77 last edited by

                                            @apollon77 hm ok, naja könnte auch schon vorher ein Problem gewesen sein und ich hab es nicht gemerkt, erst als ich heute die Objekte neu synchronisieren wollte. Naja, dann weiß ich es momentan erst auch mal nicht, muss ich weiter suchen. Keine Ahnung was er jetzt für ein Problem mit dem node-hue-api hat, da bin ich nicht tief genug drin in der Materie.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            458
                                            Online

                                            31.8k
                                            Users

                                            80.0k
                                            Topics

                                            1.3m
                                            Posts

                                            js-controller
                                            48
                                            1047
                                            254525
                                            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