Alexa and Room-Awareness?

Hey,
maybe someone already had idea and has a solution for me:
I am using openhab with knx and some amazon dots.
Now that works more or less.

But lets say i want to switch on the light in my living-room. So i have to say
Alexa. Turn of the light in my livingroom.

Is there any chance to get to know which dot has received the command, so i would be able to say:
Alexa, turn on the light.
And because i am in my living-room … openhab can turn on the light in the living-room.

Any idea???

Thanks,
Patrick

Hey!
I never tried it, but I have recently read that it is possible via adding your echo to a smart home group in the Alexa app.
Have a look here:

Cheers
Jens

As far as I know the Amazon echo Service, I’m afraid, there’s no Attribute which echo got the command.
So I guess, you have to leave it as is.

besides, if you had the opportunity and you’re sure your alexas won’t hear another you would have to trigger a hidden item tagged with “light” and then in a rule make sure, which alexa it was and which item to trigger. So I guess, staying with the actual Setup would be the way I’d go… :wink:
(so you can turn on the light/Switch/Action from another room also! which works for me, so if I’m in my bedroom I can make sure, the lights in the living room are out).

That’s already live since the beginning of Alexa. and yes, you can add some lights into a group and Alexa would then trigger the group for you as one. Would be the same, if you made a group within openHAB and assigned that one an Alexa name…

I never said, that it is a new feature … I just have not seen it before :wink:
But as you mentioned it: How canI distinguish in a rule from which alexa a command was triggered?

Right now it’s not possible to do within OpenHAB. And that is because OpenHAB is not the one receiving the voice command, it is Amazon Voice Services receiving the command, and then AVS pulls out the Item you want to control and the State you’d like to set it to and then sends the commanded state to the item in OpenHAB. So if you just say “Light OFF” it will look for a device called light and send it the OFF command, it doesn’t send anything else to OpenHAB.

If there was a way to get the full voice command data (i.e. the item, the command, and the originating device) then I’m sure a binding or addition could be made in the skill to send that back to OpenHAB but as of not it just sends one thing, the command, and it sends it to one place, and that’s the item you’re trying to control. And it’s probably better that way, otherwise you would have to write all the code to find the item that was commanded and send it the command.

As Matthew pointed out - neither the Alexa Skill for openHAB nor Alexa Voice Service has an attribute for which echo the command was sent from. The “Group”-Feature is the other way round. In fact Alexa triggers each item in the group for you in openHAB.

When you say the echo of a group “light on” or “light off”, it turns the lamps of the group assigned to it on/off. are in group other devices (sockets, etc.) these are not switched.

The problem with OpenHAB is that all devices are detected with the type switch therefore, the “light on” or “light off” command does not work

I don’t quite catch, what you would like to say.
To clarify for everyone (please see the alexa-related documentation (http://docs.openhab.org/addons/ios/alexa-skill/readme.html):

switching outlets/lights/…

  1. put the homekit-Tag ['switchable'] or ['Lighting'] in your .items file:
Dimmer Light_EG_WoZi_LG		 "living room [%d %%]"	<selfSlider>	(gLightsEG, EG_WoZi)	[ "Lighting" ]		{ knx="1/1/0+<1/1/3, 1/1/01, 1/1/2+<1/1/4" }
Switch Light_EG_WoZi_WandEss	"Dining room"	<switch>	(gLightsEG, EG_WoZi)	[ "Switchable" ]	{ knx="1/1/6+1/1/7"}
  1. let Alexa search for your items (it will detect thosehomekit-tagged items and identifiy them via their name)
  2. you can now say “Alexa, turn dining room on/off” or “Alexa, turn living room to 50%” -> regardless, whether it’s an outlet socket or a lighting - what ever you have connected to your Switch or Dimmer item.
    (You could of Course tell Alexa to turn on/off a Group within openHAB:
Group:Switch:OR(ON, OFF)	EG_WoZi "Wohnzimmer" <living>	(gEG)[ "Switchable" ]

now Alexa will turn off the Group “Wohnzimmer” for you - and all Switch/Dimmer items within the OH-Group “EG_WoZi”.

now. Within the Alexa App you can also create Groups - just for Alexa! Those Groups are Held only within Alexa! you can now add the found smarthome devices Alexa found and put them in the Alexa Group. Alexa will now tell OH2 for each item in the Group to turn on/off or dim the items.
But the Alexa-Groups won’t communicate with openHAB at all.

So, to be sure what “Group” we’re talking about. nevertheless None of this helps the TO - as neither the Alexa-Skill nor the AVS knows presently the echo-ID or gets it passed…

So,

Instead of saying alexa livingroom lights on you could say just alexa lights on

So with hue emulator it should actually send the command living Room lights if you grouped it correctly in the alexa app.
Can anyone confirm this?

@Stefan39135

Yes - that was my experience yesterday as well. But in my case I really tagged it as [“Switchable”] and not as [“Lighting”].
Have you tried it with [“Lighting”]?

yes - i tried both [“Lighting”] and [“Switchable”] but both are shown in the alexa App as Switch

i only found this in german, but it describs what i want to do

https://www.alefo.de/wiki/anleitungen:smart_home:smarthome_gruppe_fuer_licht_an_aus_anlegen

but it is not possible because all devices from openhab are detected as switch

I have lots of bulbs in my alexa App - but strangely enough also the same items as Switches. I’ll give it a new try tonight. But still: “Alexa, turn lights off” - is still not bound to the room a specific Alexa is in - but to all items, Alexa detected as lights. That’s merely a “central light”-Switch - but not a “all lights in a dynamic room”-Switch?

That’s not entirely true - it is possible with the groups to add an ECHO or a DOT then the commands that come across this ECHO only Switch devices in the Group:

living room group
light 1
light 2
echo WZ

“light on” -> ECHO WZ - only switches the 2 lights in this group

Wow! Ok… I just tried some… and this is exactly what the TO wanted…

Prerequisites

  1. have multiple Echos
  2. install and configure the Alexa openHAB2 skill (http://docs.openhab.org/addons/ios/alexa-skill/readme.html)
  3. configure your items as described in the Docs with homekit-Tags
  4. let Alexa search for your items
  5. generate Alexa Groups (in the App, note: won’t work via the WebApp!)
  6. use some Alexa Group and add the echo, you want to have to control the lights
  7. now you can use “Alexa, turn light on/off” or “Alexa, light to 50%”

note: it will work regardless if you use “Switch” or “Dimmer”. Your “Switches” will even turn on, if you dim then >0%. And of course its not important whats behind your item. Could be a light, could be an outlet, could be a dummy/proxy item or even a openHAB Group.
.
see screenshots for reference:

Close to a solution. But… i can use each name only once in the app…

So i cannot create 5 groups “Licht”, one for each room, what was my idea… :frowning:

AAAnd… I can add each echo only once.

So it is not possible to greate those groups for “Licht” and the same for p. ex. Temperature

it’s irrelevant what name you use for the Group. if one echo is in it - you tell that one “Alexa, turn ligh on/off” and she will do it. You could Name the Group “Group1” or “Group2”… :wink:

ah. no, that’s not how it works.

  1. the Alexa Group in which your room’s echo is in functions as a means for “Light on/off”, you can create one regardless of Groups or stuff in openHAB.
  2. If you’d like to have Alexa to control your room temperature, please be sure you configure those as described within openHAB as a Thermostat group following the homekit logic. Then you can tell Alexa to control this one. (But please follow the documentation as described above - and open a new thread on this, if somethings unclear for you)

Nice that it works for you,
then back to my problem I’m using the tag [“lighting”] all lights are recognized as Switches

How did you get it to recognize the device as a light