Of course I could use several commands such as: events.sendCommand(“Alexa1”,“Text to speak”);
This could be repeated with all Alexa Devices. But when one of them changes or if I’ll get another one, I’d have to change all rules …
So there should be a more general way, probably groups.
I could imagine things to work like this, but am quite unsure about the details:
- Define a group like “AlexaDevices”
- Have the AlexaDevices join that group. ← the entire device (Alexa1) or just the relevant item/channel such as Alexa1_TTS ?
thanks for your help. But it still doesn’t work. Here’s what I did now:
Define the group/item AlexaEG as string
Have 2 (for now) items with the correct channels (_Sprich is the German channel for Speak or TTS), Looks like this:
Send the text to the group item with this rule:
wiedergabedevice = "AlexaHolger_Sprich";
ausgabe = "Felix, fang bitte kein neues Spiel mehr an!";
events.sendCommand("AlexaHolger_SprichLautstarke","90"); <-- not relevant here, just to set the loudness
//events.sendCommand(wiedergabedevice,ausgabe); <-- referring to the single Alexa from line 1 works
events.sendCommand("AlexaEG",ausgabe); // this doesn't work
What happens is that the group gets the text, but not its members. So how do I tell OH to put the text to all of the group’s members?
First, AlexaEG should not be in the model. It’s not an Equipment. It’s not a Location. It’s a functional Group. At best, if it were to be put into the model, it belongs at the root of the Locations.
You might do well to review/rereview the Model and Items page of the getting started tutorial. Semantic Model | openHAB
Pay close attention to the restrictions:
- A Location can only be the direct member of zero or one Location Group.
- An Equipment can only be the direct member of zero or one Location, or the direct member of zero or one Equipment. Put another way, an Equipment can only be the direct member of one Group that has a semantic tag.
- A Point can only be the direct member of zero or one Location, or the direct member of zero of one Equipment. Put another way, a Point can only be the direct member of one Group that has a Location or Equipment tag.
Because the model represents the physical, it makes no sense to deviate from these restrictions. An Equipment or Point cannot be in more than one location at the same time. A Point cannot be a part of more than one Equipment at the same time.
And later down
As discussed above, many Items and Groups are expected to be outside of the semantic model. Perhaps they are only supporting Items only used for Rules.
Look at Semantic Model | openHAB which shows how to create an Item outside the Model. You’ll choose Group for the type. Once you select that you’ll see a “Group members base type” option appear. Set that to String.
I can’t tell what you’ve defined the Group as in these screen shots. So I can’t tell. But review the instructions above for creating a Group outside the semantic model and go from there.
Just in that screen shot your model is going to need a lot of rework in order to properly generate the Overview Page and be used by HABot. If you are using neither, you shouldn’t bother with the model at all.
Thank you, now I got it working (although there was no option to set the group item to string, just numbers and other types, so I left it)!
Actually I didn’t use the overview page so much (and have no idea what to do with HABot) so I didn’t notice there was a problem with my model. I used it to have some kind of structure/overview for myself when looking for items/equipment. But I’ll rethink that and maybe can make better use of the model then …