Open 2MuchTech opened 8 years ago
This wouldn't happen at the Alexa Skill layer, but you could add some code to the Lambda service to read from a list of aliases (simple text file mapping alias name to real name), and then send the real name to node-sonos-http-api when it detects the alias.
One reason you might want this is because the lambda is not guaranteed to return something that is actually in your presets. For example, half the time when I way play "thunder toads" the lamda sends "Thunder Tones" as the preset value which of course doesn't work. Yes you could put in a function in the lambda which does some kind of lookup and finds the right preset value but its a PITB to edit that list and upload the lamda again. What I do is simply duplicate the preset value in presets.json with the alias name and restart the sonos service. It would be nice if the sonos http api supported aliases because that is where it needs to be, not in the Alexa Skill. I think I'll go write that. The same is true for room names, you can get something that is not actually a room name. But there is no good way to alias those in the sonos http api. You probably would have to do that in the lamdba as suggested.
First, a big thanks to Ryan for doing the heavy lifting here! This is very cool that Alexa can control my Sonos system.
The basic functionality is working at this point, but I'm running into a number of problems that I think are mostly related to my Sonos room names. I have a fairly large number (18) of Sonos Connect:Amps in my system, and to make it easier to find the one(s) I want in the Sonos iOS app, I have prefixed my room names so they sort in a logical order in the ROOMS list in Sonos. For example, I have all of the bedroom Connect:Amps starting with the number "1". This works quite well in the Sonos app where you see a list of all the rooms, but it's not very good for Echo Sonos because you have to remember exactly what the room name is. Also, apparently the Amazon Developer Console's Service Simulator doesn't support numbers in the Utterance.
So I'm wondering if the Alexa Skill system supports the concept of aliases? If I could have the ROOMS custom Slot populated with the actual room name that Node Sonos HTTP API needs, but also give aliases that Alexa would understand, that would solve my problem without compromising ease of use in the Sonos iOS app. I'm guessing there's a way to do this built into Alexa Skills... allowing multiple names for a given object is critical for a voice control app's ease of use. I'd appreciate any pointers for resolving this. Thanks!