Retrieve items with multiple tags set

I am trying to rewrite the script below to only retrieve items where both the tag “light” and “kitchen” are set. Any suggestions on how I can do that?

Any help appreciated. Thanks

var items = itemRegistry.getItemsByTag("LightGrownUps");
        for (var i in items) {
          var light = items[i];
         
          var state = light.getState();
          if (light.type == "Color") {
            // We need to remap HSB value to ON / OFF
            state = state.brightness > 0 ? "ON" : "OFF";
          }

          if (state == "ON") {
            events.sendCommand(light.getName(), OFF);
          }
        }```

It was easier than I thought. :wink:

var items = itemRegistry.getItemsByTag("Kitchen","Light");

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.