Creating a group in OH3 to replace text file based configuration

Hi All,

In OH2.5, I had a group:switch defined for all my lights and I was able to apply the Alexa meta data to define this as a powercontroller. This was great for just uttering ‘Alexa, turn off all lights’ and was defined as below:

Group:Switch:SUM gAllLights          "All Lights"                   { alexa="PowerController.powerState" }

I’m moving things over to OH3 and moving away from text based configuration for some of my stuff. Only this, which wont show gAllLights in the companion app

Any suggestions?

Thanks!

Since creating a group in OH3, my lights were automatically populated into the group and I created the ALL OFF, then OFF, else ON aggregate function.

There seems to be no alexa metadata now for powercontroller.

This is a known issue with the current WebUI Alexa Metadata integration. You will have to use the metadata code tab to set this item as PowerController.

1 Like

Thanks Jeremy!

Seems it didnt work (looks right though)

What items are you adding to the group? The way I have this working is to create a main Group (ie. Living Room Spots) and then creating a sub-group for each control (ie. Living Room Spots Switch and Living Room Spots Brightness). The sub -group is where I put each lights relevant point.

I should add that I set the Metadata so that the main group is ‘Lighting’ and the sub-group corresponds to the function (ie. Living Room Spots Switch = PowerController.powerState and Living Room Spots Brightness = BrightnessController.brightness).

I do also have color working, and in order to that I created a ‘Color’ sub-group which contains the relevant light items. I then have a seperate ‘Color Changer’ item which is used to change the color - A rule runs when the Color Changer item is changed which then sets the ‘Color’ sub-group. Since I follow a naming convention this rule is simply two lines long and linked to all the sub-group color changers:

val groupName = triggeringItemName.toString.substring(0, triggeringItemName.toString.length - 7)
sendCommand(groupName, newState.toString)
1 Like

What didn’t work? Did you run an Alexa discovery after making the configuration change?

Deleted and recreated the group, forgot devices and rediscovered, works now!

Hi Sunny

What is the base aggregation type for your top level group?

I assume for your switch group, one on, all on. For dimmer, you have dimmer SUM. What utterance would you use then to turn off all your spot (powerstate) and dimmers (brightness) ie the top level group?

cheers

Come on, you know how this works by now …

Why, what happens instead? What does your events.log show when you issue command to Group?
Might this have some connection with your other thread complaining about dimmer ON/OFF commands across two separate OH instances?

Personally, I have grouped them by Controller Type, such that I have gAllLights_Switch and gAllLights_Dimmer, these are both sub-groups of gAllLights. The switch groups are ‘One ON then ON else OFF’ and the dimmer groups are ‘MAX’ as I prefer knowing the brightest Bulb (when controlling by group these would in effect be the same).

And whats the utterance you use? I used to use ‘turn off all lights’ but this now doesnt work with a mixture of dimmers/switches

I actually have Alexa configured by placing lights in rooms - so saying ‘Turn off All the Lights’ does so for each room. However, I have some lights which are excluded and I have a custom routine in Alexa which triggers the ‘All Lights’ groups.

no worries thank you