if i give the command:
“alexa, turn something on”
to any of my alexa’s she always turns on that particular device.
you cant connect devices or skills to 1 alexa deviice (yet)
the device from alexa is untill yet only used to play music on several devices together, or to start music from 1 device on the other. but you cant do that from out of HA,
The use would be the ability to overload individual device names depending on location. So if I say “turn on the lights” and I’m in the kitchen, I could catch the deviceID that says the command was picked up by the kitchen echo and then turn on the kitchen lights. If I’m in the bedroom and say “turn on the lights”, I could catch the deviceID telling Hass that the command was picked up by the bedroom echo and then turn on the bedroom lights.
Correct, this is what I’m trying to do. Looks like it’s not possible to specify the DeviceID in the intent script though. Was hoping there would be a work around.
I have an Echo in 3 rooms, each with a TV and Lights and would like to be able to give a single “turn on tv” command instead of “turn on bedroom tv”.
I understand that can’t be done for emulated hue but it could with a custom skill or a Haaska skill.
I got this working! You will need to do a little mod in alexa component. Locate alexa/intent.py and add the following lines to the async_handle_intent function right after the line “alexa_response = AlexaResponse(hass, alexa_intent_info)”:
This will add the deviceid as a “slot” so you can use it on templates. To test i did a “launch request” skill (see alexa component docs) and added this to my intents:
amzn1.ask.skill.xxxxxxxxxxx:
action:
- service: notify.someone
data_template:
message: "I was called by {{ deviceid }}"
- service: homeassistant.toggle
data_template:
entity_id: >
{% if deviceid == "amzn1.ask.device.<longstring-device1>" %}
light.w1
{% elif deviceid == "amzn1.ask.device.<longstring-device2>" %}
group.luzes_sala
{% elif deviceid == "amzn1.ask.device.<longstring-device3>" %}
group.luzes_escritorio
{% endif %}
speech:
text: OK
I used the notification part as way to test/retrieve the deviceid.
One problem with the launch request skills is that amazon don’t let you use any word as some of them are used by other skills/purposes, so you cannot just say “alexa, lights”. Just for the fun, and lack of imagination of a better word/phrase, I’m using “alexa, banana” and them HA toggle the lights of the room where my dots/echos is located.
I’m not sure. There seens to exist a strange behaviour when you have multiple echos in which one of them seems to be the “master”, so even if you ask to another echo, the master is the one who talks to the hue bridge.
cant be. (or at least i dont see how)
i have 6 echo’s who all can use hue commands.
which would be the master?
and when i shut that one down, will all others not respond anymore?
no it doesnt matter which one i shut down, there is always response.
i also never connected devices to a single echo, so how is then decides which is the master?
and how does 1 echo send commands to another echo? untill now it is impossible to send a command from 1 device to another, if i am correct.
Well, the first time I notice this behaviour was when I was configuring a echo + HA at my work. This echo was connected to same account as my home echos and I was configuring emulated_hue at my work’s HA so we could control the coffe machine. No matter how many times I asked this echo to “find my devices” it didnt find my emulated_hue. Digging a little further and doing some tcpdumps, I found that my other echo at home was sending packets to broadcast address port 1900 and to my home HA at port 8300.
Btw, while re-testing this now I just saw my echo home trying to send a packet to my work’s echo. Go figure…
running multiple echos in multiple networks.
yeah i can see where that goes wrong.
i just took a look at the emulated hue, and its hard to pinpoint the incoming data from alexa there.
i can try some stuff, but with HA that means restarting HA every time and i dont want to do that now.
but when i look at the Alexa documentation, the device id that is getting the command is always send in the response nowadays.
ill take a look at it when i have created a testing environment.
Since that one was kind easy, I’m also thinking about userid! I dont know if I got it right, but alexa send a userid on the json and it seems that this is based on the voice signature of the user? I thought that the userid is linked to the user account on amazon, but this link sugest that it’s not:
i just did a better search and it seems they have implemented voice recognition at the end of last year.
that makes me very happy so ill dive into that.!!
yeah i found that they announced it was coming in the end of last year, but its still not in the app here.
and i cant find any news thats its actually released in germany, so i think ill have to wait.