and logged with my amazon account, after that it added all my echo devices/rooms/skills in things
now i have to edit the things and write the location of every echo? (it will be used as location var for the rule?)
after that from the item
Group gAlexaVoiceCommand "Alexa Voice Command" <--- don't touch
String BedroomEchoDotLastVoiceCommand "Last Voice Command" (gAlexaVoiceCommand) {channel="CHANGETHISID?:lastVoiceCommand"} <-- change id
String BedroomEchoDotTextToSpeech "Text to Speech" {channel="CHANGETHISID?:textToSpeech"} <-- change id
Switch BedroomFanPower "Bedroom Fan" {alexa="Switchable"} <--- useless just for example?
Switch AlexaActivityFan "Fan" {alexa="Activity", expire="1s"} <-- command that trigger the rule?
so when u say “alexa fan” the rule is triggered and follow the map config?
Correct. The activity item is a placeholder allowing a command to be received through the textToSpeech channel without returning a voice error and to trigger the rule.
i don’t understand the channel parameter and the string value, is something u writed bc trigger some command of alexa?
bc i don’t see mentioned in the rules, so i don’t understand if is required stuff or is something else (u noticed the changes i made?)
now i just need to do a bit of regex magic for my case
in the end i just changed the texttospeech in textCommand and used this
>
if (category === null) return;
val deviceName = transform("MAP", "alexa.map", category.toUpperCase + "-" + location)
if (deviceName == "") return;
val command = triggeringItem.state.toString.replace(category,deviceName)
sendCommand(triggeringItem.name.replace("LastVoiceCommand", "TextToSpeech"), command)
basically the map change from the generic name to the correct name and trigger again alexa with the “correct” command… only problem is that alexa answer 2 times, but in this way i can say something like “open curtain at 50%” and is triggered without handle all the special cases