Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Gruppe von Hue lampen an bzw. aus

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Gruppe von Hue lampen an bzw. aus

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

      @dos1973 eine Szene wird nicht anders als eine Lampe aufgerufen

      1 Reply Last reply Reply Quote 0
      • sigi234
        sigi234 Forum Testing Most Active @dos1973 last edited by sigi234

        @dos1973 sagte in Gruppe von Hue lampen an bzw. aus:

        nein. ich suche eine Möglichkeit bestimmten Szenen aufzurufen...
        mich wundert dass hier nicht mehr davon zu lesen ist.

        Alexa2 Adapter - Smart Home Devices!

        Zum Beispiel:

        Screenshot (3167)_LI.jpg

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

          @dos1973 eine Szene wird nicht anders als eine Lampe aufgerufen

          Quatsch, ich habe "Gruppe" mit "Szene" verwechselt.

          Es gibt ein Script zum Auslesen der Szenen, diese liegen dann unter:
          javascript.0.HUE_Scenes

          var HueApi = require("node-hue-api").HueApi
          
          var host = "192.168.xxx.xxx", //die IP der HUE-Bridge
              username = "DeinUserName", //der HUE-Bridge Anmeldename
              api = new HueApi(host, username),
              light_list = [];
              
          var groups = [],
              objects = [];
          
          var displayResults = function(result) {
              console.log(JSON.stringify(result, null, 2));
          };
          
          var parseGroups = function(result) {
              for (var i = 0; i < result.length; i++) {
                  var id = result[i].id,
                  name = result[i].name;
                  console.debug('group: '+name+' id: '+id);
                  groups[id] = name;
              }
              groups[0] = 'All lights';
          };
          
          var createStates = function(result) {
              createState('Hue_Scenes.Resync', false, {role: "button", name: 'Resync Groups and Scenes'});
          
              for (var i = 0; i < result.length; i++) { 
                  var regex = /\w{5}_r(\d{2})_d(\d{2})/;
                  if (!regex.test(result[i].appdata.data)){continue;}
          
                  var room = regex.exec(result[i].appdata.data)[1],
                  number = regex.exec(result[i].appdata.data)[2],
                  id = result[i].id,
                  lights = result[i].lights,
                  name = result[i].name.replace(/"/g,''),
                  pathname = name.replace(/ /g,'_'),
                  group = groups[parseInt(room)] || lights;
                  
                  if (!objects[room+number] || number == 99){
                      console.debug('scene: '+name);
                      createState('Hue_Scenes.'+pathname+'.'+id, false, {role: "button", name: 'Scene: '+name+' ('+group+')'});
                      objects[room+number] = true;
                  }
              }
          };
          
          function deleteStates(){
              $('javascript.0.Hue_Scenes.*').each(function (id) {
                  deleteState(id);
              });
          }
          
          api.groups(function(err, groups) {
              if (err) throw err;
              console.debug('Processing groups...');
              //displayResults(groups);
              parseGroups(groups);
          });
          
          api.scenes(function(err, scenes) {
              if (err) throw err;
              console.debug('Processing scenes...');
              //displayResults(scenes);
              createStates(scenes);
          });
          
          on({id: /^javascript\.0\.Hue_Scenes\./, val: true}, function (obj) {
              sceneId = obj.id.split('.').pop();
              console.debug('Activating '+obj.name);
              api.activateScene(sceneId, function(err, result) {
                  if (err) throw err;
                  displayResults(result);
              });
              setState(obj.id, false);
          });
          
          on({id: 'javascript.0.Hue_Scenes.Resync', val: true}, function (obj) {
              console.debug('Resync triggered...');
              
              groups = [];
              api.groups(function(err, groups) {
                  if (err) throw err;
                  console.debug('Processing groups...');
                  parseGroups(groups);
              });
              
              console.debug('Deleting current scenes...');
              objects = [];
              deleteStates();
              
              api.scenes(function(err, scenes) {
                  if (err) throw err;
                  console.debug('Processing scenes...');
                  createStates(scenes);
              });
          });
          
          1 Reply Last reply Reply Quote 0
          • D
            dos1973 last edited by

            das Script schaue ich mir mal an. Danke

            BBTown 1 Reply Last reply Reply Quote 0
            • BBTown
              BBTown @dos1973 last edited by

              @dos1973 achte auf die Verfügbarkeit von "node-hue-api" im javascript Adapter:
              8788a758-6bf1-4e07-9b21-60da7125d327-image.png

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

                Unter github beim Hue Adapter gibt es eine Anforderung das dort zu implementieren. Ein Daumen hoch kann helfen das es vielleicht mal eingebunden wird...

                BBTown 1 Reply Last reply Reply Quote 0
                • BBTown
                  BBTown @cash last edited by

                  @cash und wenn Du das hier gleich verlinkt hättest, dann würden das auch alle finden ...

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

                    Ist mit dem ipad immer etwas aufwendiger aber wenn es hilft:

                    https://github.com/iobroker-community-adapters/ioBroker.hue/issues/39

                    Baenker created this issue in iobroker-community-adapters/ioBroker.hue

                    closed Szenen von der Hue-Bridge abfragen und über Objekte aktivierbar machen #39

                    1 Reply Last reply Reply Quote 0
                    • D
                      dos1973 last edited by

                      Mein Daumen hast Du

                      1 Reply Last reply Reply Quote 0
                      • Uli977
                        Uli977 @haselchen last edited by

                        @haselchen Hallo und sorry dass ich nicht direkt geantwortet habe. Ich habe letzten Endes meine Hue Tap nach der Szene Wohnzimmer abgefragt. Damit gings dann irgendwie auf einmal.

                        Viele Grüße!

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        842
                        Online

                        32.0k
                        Users

                        80.5k
                        Topics

                        1.3m
                        Posts

                        vis
                        6
                        16
                        751
                        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