Using the same voice commands based on area

Hi,

I’ve just started setting up HA recently and have things up and running so far.

To give a quick summary of what I have setup:

I’m using Amazon Echo devices for voice input with Nabu Casa. I am currently just controlling lights in three rooms. My areas are ‘Kitchen’, ‘Living Room’ and ‘Bed Room’. Each room has a minimum of one controllable light (they are ceiling lights and lamps) and one Amazon Echo.

My question is. Can I setup HA so I can simply say ‘Alexa turn on the light’ and have HA interpret that command so it turns on the light in the room/area that the command was received in? i.e. If the kitchen echo receives the command, the kitchen light goes on. Rather than having to be specific with ‘Alexa switch on the kitchen light’.

Apologies if the answer to this is brutally obvious. I’m working my way through the docs and I’m still getting my head around how things in HA work. :smiley:

Thanks in advance,
Doogie

Yes it can be done but requires Node Red and a pallet called node-red-contrib-alexa-remote2-applestrudel (node-red-contrib-alexa-remote2-applestrudel (node) - Node-RED)

Search for that pallet and/or “Room Aware Alexa” here. I have done it successfully but use Node Red & Hubitat.

You can do this using functionality provided by the Alexa service. Within the Alexa app you can create Groups. Create a group called, say, ‘lounge’. Add an Echo and a light. Alexa will then know that asking Alexa to turn on the light with that Echo device implies that light.

Thanks Stephenn, I’ll look into that :smiley: . That’s what I had initially done templeton but it wasn’t wanting to play ball, it would work now and then but wasn’t 100%

Cheers for the replies, it’s appreciated.

The fun part of using Node Red and that palette is that you’re not limited to saying “Turn on the lights” like you are if you use groups in Alexa. For example, I say “illuminate” (borrowed from The movie Demolition Man) to turn on lights. I can also say " It is hot in here" and the appropriate ceiling fan will turn on.

1 Like

I like that lol. I’m watching through some tutorials on how to use Node Red now. It looks very powerful.

There are two more ways of doing this.

If you install the Alexa Media Player integration from HACS, among many other things it will give you a sensor last_alexa containing the name of the Echo device which “heard” your command. You can use this to select the appropriate lights.

If you have motion sensors you can store the name of the room each time movement is detected and use this to select the lights. (This only works if there is just one person in the house.)

Excellent, I’ll keep that in mind. I have the Alexa Media Player installed and I have a couple of presence sensors that I haven’t done anything with yet.

Does Alexa Media Player create that Entity? I have AMP installed but none of the Entities associated with it have “last” in their name.

No, AMP creates a service that automatically targets the last called device for use in automations and scripts, but you will need to create the sensor yourself if you want it for other uses. There are a number of examples available on AMP Wiki: Automations

Using recent additions to template functions you don’t need to create a group anymore:

template:
  - sensor:
      - name: Last Alexa
        state: |-
          {{ expand(integration_entities('alexa_media') | select('search', 'media_player'))
          | selectattr('attributes.last_called', 'eq', True) | map(attribute='entity_id') | first }}

Yes, sorry. Details are here:

Thank you. I predominantly use Hubitat but constantly experimenting with Home Assistant and still probably a newbie. I’m curious if this is a more reliable method then the Node Red pallet.

It’s been over 2 years since I experimented with any of the NR pallets, so I can’t really offer any comment.

I can say that the using the Room-Aware and Area-Aware automation schema I linked to previously are relatively reliable, but not 100%. In my limited experiments, setting up Groups in the Alexa app for lights seems to be a bit more reliable.

Caveat: I use the HAASKA custom skill, not HA Cloud so YMMV…

1 Like