I'm trying to build a home control system with behavior dependent on the device which initiated the request.
For example, I'd like to say:
Alexa, turn on the lights (a predefined group specific to the room the Echo is in).
Alexa, turn off the nightstand lamp (in the bedroom the Echo is in).
Alexa, turn off the kitchen lights (in the house the Echo is in).
Alexa, turn off the dining room light in Bangkok (I'm elsewhere).
The Device Address API appears to be exactly what is needed -- I'd put the room name for each device in addressLine2. Unfortunately, it only seems to work with Custom skills; a Smart Home Skill Adapter is not passed the Device ID. Is there a workaround for this?
Any other good ways for a Smart Home skill to determine the source?
The device name appears in the Alexa app History and the Lambda function could open a web socket to read it. However, History doesn't seem to update until the requested operation has completed; the adapter would have to return a fake OK to get the data. If the device control action failed, there would be no good way to report it.
If the home routers run open source firmware, one could have a task that the Lambda function would query, asking which Echo uploaded the most data during the previous five seconds.
If there is no good solution for a Smart Home Skill and we're stuck with a Custom Skill, we surely don't want to be forced to say "Alexa, tell MyRobot to turn on the lights" or similar.
Could the skill be named e.g. Smith? "Alexa Smith, turn on the lights" doesn't sound too bad. But the page at supported-phrases-to-begin-a-conversation shows the invocation name immediately following Alexa, only when no intent is present. Is the syntax "Alexa <invocation name> <intent>" accepted?
Even better, could "Turn On" and "Turn Off" be defined as invocation names, taking precedence over their Smart Home meanings?
How about "Alexa, tell Kitchen Lights to turn off"? This would require creating about two dozen skills. Is that permitted? Is there an easy way to do it programmatically?
I'm interested in hearing from any makers that have implemented device-dependent request handling.
Thanks in advance for any insights.