Best way to publish Groups to Alexa?

hey folks,

i tried my best in the last few weeks and had a lot of curious problems with Groups which are published to Alexa.

Following problems i see:

  • Groups are not discovered by Alexa if you published a massive groups at once.
  • Items inside the Group would not be triggered over Alexa.
  • 1 Day is working all fine; Day X without changes some items in Groups didn’t triggered over Alexa
  • i told the Group but only the First Item inside the API endpoint with this Group membership react.

Here are my configs:

items:

Group:Switch:OR(ON, OFF) gLivingRoom             "Wohnzimmer"               (Wohnung_LivingRoom)             [ "Lighting" ]
Group:Switch:OR(ON, OFF) gWohnzimmerLicht        "Wohnzimmer Licht"                                          [ "Lighting" ]
Group:Dimmer gWohnzimmerDecke                 "Wohnzimmer großes Licht"  (gLivingRoom,gWohnzimmerLicht)   [ "Lighting" ]
Group:Switch:OR(ON, OFF) gWohnzimmerEcke          "Wohnzimmer kleines Licht" (gLivingRoom,gWohnzimmerLicht)   [ "Lighting" ]//{alexa="Endpoint.SWITCH"}
Group:Color gTVLicht                          "TV Licht"                 (gLivingRoom,gWohnzimmerLicht)   [ "Lighting" ]

-------------------- Lamps

Color  TVLampe1Color   "Ambilight1"  (gTVLicht) {channel="hue:0210:459d701324:TVLampe1Color:color" , alexa="BrightnessController.brightness,PowerController.powerState,ColorController.color" [category="LIGHT"]}
Color  TVLampe2Color   "Ambilight2"  (gTVLicht) {channel="hue:0210:459d701324:TVLampe2Color:color" , alexa="BrightnessController.brightness,PowerController.powerState,ColorController.color" [category="LIGHT"]}
Dimmer WohnzimmerLampe3Brightness "Wohnzimmer Decke 3" (gWohnzimmerDecke) {channel="amazonechocontrol:smartHomeDevice:4c4574f0:200b624c-c26b-4d4f-a82a-79308bf5a45c:brightness" , alexa="PowerController.powerState,BrightnessController.brightness" [category="LIGHT"]}
Switch WohnzimmerLampe4PowerState "WohnzimmerLichtEcke_ON" (gLivingRoom_Ecke) {channel="amazonechocontrol:smartHomeDevice:4c4574f0:092025f7-ddfd-4c3e-a54f-a9b1b20fb84d:powerState" , alexa="PowerController.powerState" [category="SWITCH"]}


Environment:

Openhabian on Pi 3+
Alexa Binding is on V3.
Openhab is in Version 3.
HueEmulation is not installed.
Cloud Connector is installed.
things are both Hue and alexa owned lamps. (i got the out of alexa because OH didnt had a Skill for it)

What i tried:

  • Reinstall Openhabian
  • Reconnect Cloud Connector
  • Reinstall Openhab Skill on Alexa side
  • Republished Groups with new Name and new Label.
  • using old and new Tags. [ “Lighting” ] and {alexa=“Endpoint.Light”}

Did you have any tips or improvements?

What functions i want lose:

  • Told the Group the Color
  • Told the Group the brightness
  • Manage the Groups inside of Openhab and not triggered over alexas owned Groups.

Just tag the groups for Alexa

note: Group:Color does not appear to be valid for OpenHab v3

Group					Grp_Lights_FF_DR_Ceiling						"Dining Room Ceiling"						(Grp_Endpoint)																								{alexa="Endpoint.Light"}
Group:Switch:OR(ON,OFF)	Grp_Lights_FF_DR_Ceiling_Switch					"Active Lights [%d]"		<switch>		(Grp_Lights_FF_DR_Ceiling)																					{alexa="PowerController.powerState"}
Group:Dimmer:MAX		Grp_Lights_FF_DR_Ceiling_Brightness				"Brightness [%d]"			<slider>		(Grp_Lights_FF_DR_Ceiling)																					{alexa="BrightnessController.brightnesscolor"}
Group:Color:OR(ON,OFF)	Grp_Lights_FF_DR_Ceiling_Color					"Colour"					<colorpicker>	(Grp_Lights_FF_DR_Ceiling)																					{alexa="ColorController.color"}
Group:Dimmer			Grp_Lights_FF_DR_Ceiling_ColorTemp				"Color Temperature [%d]"	<slider>		(Grp_Lights_FF_DR_Ceiling)																					{alexa="ColorTemperatureController.colorTemperatureInKelvin"}

Group					Light_FF_DR_Downlight_01						"Dining Room Downlight 01"																													
Switch					Light_FF_DR_Downlight_01_Switch					"On/Off"					<switch>		(Light_FF_DR_Downlight_01, Grp_Lights_FF_DR_Downlight_Switch, Grp_Lights_FF_DR_Ceiling_Switch)				{channel="hue:0210:00178866094c:hue_bulb_ff_dr_dl01:color"}
Dimmer					Light_FF_DR_Downlight_01_Dimmer					"Brightness"				<slider>		(Light_FF_DR_Downlight_01, Grp_Lights_FF_DR_Downlight_Brightness, Grp_Lights_FF_DR_Ceiling_Brightness)		{channel="hue:0210:00178866094c:hue_bulb_ff_dr_dl01:color"}
Color					Light_FF_DR_Downlight_01_Color					"Colour"					<colorpicker>	(Light_FF_DR_Downlight_01, Grp_Lights_FF_DR_Downlight_Color, Grp_Lights_FF_DR_Ceiling_Color)				{channel="hue:0210:00178866094c:hue_bulb_ff_dr_dl01:color"}
Dimmer					Light_FF_DR_Downlight_01_ColorTemp				"Colour Temperature"		<slider>		(Light_FF_DR_Downlight_01, Grp_Lights_FF_DR_Downlight_ColorTemp, Grp_Lights_FF_DR_Ceiling_ColorTemp)		{channel="hue:0210:00178866094c:hue_bulb_ff_dr_dl01:color_temperature"}
String					Light_FF_DR_Downlight_01_Alert					"Alert"										(Light_FF_DR_Downlight_01)																					{channel="hue:0210:00178866094c:hue_bulb_ff_dr_dl01:alert"}
Switch					Light_FF_DR_Downlight_01_ColorLoop				"Color loop"				<switch>		(Light_FF_DR_Downlight_01)																					{channel="hue:0210:00178866094c:hue_bulb_ff_dr_dl01:effect"}

As far as your group Alexa-enabled item configuration, it looks good. Group items with a defined item type are considered as a single endpoint by the Alexa skill. So, for example, a Group:Color item is actually seen as Color item by the skill. This is why you shouldn’t use group endpoint metadata configuration, such as {alexa="Endpoint.Light"} on these specific group items. Also, any Alexa-enabled items part of these groups should also be discovered as single endpoints as well. If you are having issue discovering new items, make sure to go over the troubleshooting guide.

Based on your observation, it seems to me that this is more an issue on OH side where some of the items aren’t responding to commands received. I would suggest checking your OH server logs. Also, check the Alexa devices discovered. You may want to clear all existing items and trigger a discovery. Moreover, make sure that you label your Alexa-enabled items with unique names.

Jeremy,

So if we shouldnt use group endpoint ‘light’ what do we use? The individual items have metadata enabled Alexa but its not clear for a lighting group , what we should use? The documentation has no examples of how to control a group of light switches.

What is not clear? My explanation above is still accurate on how the skill models state derived groups opposed to standard “functional” groups.

1 Like

Groups previously could be tagged with old V2 tags of lighting and they would send OFF commands to all members. Now, you can’t have anything on a group but endpoint.Lightbulb, so its not clear to me how you send OFF/ON commands to all group members

You should not use V2 tags when migrating to OH3 to configure the Alexa integration. The support for these will be removed in the upcoming changes when running an OH3 server to prevent conflicts with the semantic classification.

Where did you read that? Do you understand what’s the difference between state derived and standard “functional” groups?

For v3 you can add Metadata more than just ‘endpoint.Light’ by switching to the code tab:

value: PowerController.powerState
config:
  category: LIGHT
1 Like

sigh

That’s just a property of openHAB Groups. Like it or not, want it or not, regardless of any tags, if you send a command to a Group it gets distributed to member Items.

Maybe the question is how to send a command to a Group type Item from Alexa.

To summarize my original explanation above:

  • State derived groups, used to propagate commands to group members, can only be modeled as single endpoint (e.g. PowerController.powerState)
  • Standard “functional” groups, used to define a group of functionalities, can only be modeled as group endpoint (e.g. Endpoint.Light)

Hopefully, this is clear enough.

As far as new method, nothing has changed in how to configure your items for Alexa in OH3. If your concern is about the WebUI Alexa integration, you can always use the item file definition or the code tab as an alternative. Nobody is forcing you to use the new UI or at least to migrate all your existing items at the same time. You can take your time so you can get more familiar with the new functionalities added in OH3.

Keep in mind, there is a major metadata syntax update for the Alexa skill coming down the pipes including a rework of the current WebUI integration.

Thanks. Is there some kind of caching going on with items which are discovered by myopenhab.org alexa skill? Even after enable/disabling the skill and removing ALL devices, certain group name functionality won’t work. It’s like its cached and old, name.

Can you please define what you mean by “won’t work”?

I have not noticed any caching when configuring things in the past - I remove the ‘devices’ from Alexa and then just run the Discover process again. Note I rarely remove all devices as it would take me a bit of time to assign them back to the rooms.

Hi Jeremy

I have a group of light switches, called gAllLights with name All Lights.

OH/Alexa show the power state is ON, because 1 light is on. The companion app discover the group just fine. However when I say ‘Alexa, turn off all lights’ she beeps to acknowledge, yet it doesnt turn off.

If I say ‘Alexa, turn off all light switches’ - the group turns off just fine. Previously, it was the name that would trigger the group. Now, I’m not sure. There is something I’m not understanding correctly.

What am I missing?

I’ve had a little read of some posts on Reddit etc.

I think the issue is the group name being ‘All Lights’ since ‘Light’ is actually a device type in Alexa. To test try renaming the group ie: ‘All Illumination’.

From what I read a good work around is to create an ‘Inside Lights’ group and ‘Outside Lights’ group the so you can say ‘Turn of Outside Lights’

1 Like

Hi Sunny, I had this working for a few years without issue on OH2.5/2.4. But yes, it works with another name…Ill try your suggestion. The wife wont be happy :stuck_out_tongue:

So, is my theory sound here to be able to switch off all Switches and Dimmers in one hit?

1 x Group for Outside Dimmers (alexa brightness and power controller, all items Dimmer type)
1 x Group for Outside Switches (alexa power controller, all items Switch type)
1 x Group for Inside Dimmers (alexa brightness and power controller, all items DImmer type)
1 x Group for Inside Switches (alexa power controller, all items Switch type)

1 x Group for All Lights , label ‘BLAH’ (encompasses all 4 above groups) with alexa power controller

The aim is to issue 0/100 to Dimmers and ON/OFF to all lights, irrespective of being a switch or a light by saying ‘alexa , turn off all BLAH’

I’d do it by creating a main ‘Outside’ group and which holds the sub groups ‘Outside Switches’ and ‘Outside Dimmers’ the sub-groups have the corresponding Items (ie. FrontPorch_Switch or ForntPorch_Dimmer).

Set the ‘Outside’ group Amazon Alexa meta to ‘Lighting’ and then set the Alexa meta for the sub-groups according to their use (ie. Dimmer = BrightnessController.brightness and Switch = PowerController.powerstate.

This should allow you to use the ‘Outside Lights’ group name as part of the utterance - hence you can say ‘Set the outside lights to 50%’ or ‘turn off outside lights’

I do try and stay away from using the Light or Lights in defining my groups as this is also a device type - instead I use words like Lamp, spots, strips, tubes etc.

To expand a bit, if you have several Alexa devices you can configure each device’s location and hence be able to say ‘Alexa, turn on the lights’ and only the lights in the room where the device is turn on. You configure this by adding the devices to the same room. An issue some may face here is that they don’t want all the lights to come on and a work-around for that is to set those devices to an endpoint ‘Other’ so Alexa doesn’t think they are lights but can still control their power / brightness / color.

Going back to your last post, my explanation above should result in the following:

1 x Group for All lights (alexa Lighting)
1 x Group for All Dimmers (alexa BrightnessController.brightness)
1 x Group for All Switches (alexa PowerController.powerstate)
1 x Group for Outside Lights (alexa Lighting - member of All Lights)
1 x Group for Outside Dimmers (alexa BrightnessController.brightness - Dimmer items - member of All dimmers)
1 x Group for Outside Switches (alexa PowerController.powerstate - Switch items - member of All  switches)
1 x Group for Inside Lights (alexa Lighting  - member of All lights)
1 x Group for Inside Dimmers (alexa BrightnessController.brightness - Dimmer items - member of All dimmers)
1 x Group for Inside Switches (alexa PowerController.powerstate - Switch items - member of All switches)

A couple of things you can try to keep the wife happy:

1). If Alexa responds with OK to a statement such as ‘turn off all lights’ - use a rule to check the ‘LastVoiceCommand’ channel of the echo control binding and if the command matches trigger the groiup accordingly.

2). Alexa may not respond with OK and hence it can be confusing - the work around is to create a Routine in the Alexa app to match the utterance. This routine doesn’t actually have to do anything since you can create the rule as per step 1 and still match on the ‘lastVoiceCommand’ - the routine simply gets the right response from Alexa.

Are you sure you don’t have an Alexa group named “All lights” on your account? Keep in mind that the Alexa language processing matches group over device names if both are the same. The fact it is acknowledging your request, a command is sent to a device or group on your account. Have you checked your OH event logs to see if a command is sent to your server after making the request?

When it comes to groups, I usually suggest using Alexa groups over OH ones so you can take advantage of the group implementation at the Alexa level. The only downside is that each time you delete all your OH-related devices from your Alexa account (which shouldn’t happen that often), you will need to re-add the relevant devices back to that group.

1 Like

Thanks Sunny

I have my light switches in the respective Switches group, but there will be nothing in the Lights sub groups, and that makes All Lights top level group redundant.

So I’m not sure what the point of those are? You’d think this would be far more straight forward :slight_smile: