I'm currently working on developing my first Alexa skill in Node.js using the developer console. The idea is conceptually simple.
While I can do something similar using the Alexa Routines, it doesn't allow me to return to the original volume, thus wanting to write a skill to do so.
I'm currently struggling to work out how to get the current volume and have been looking through the docs and not found any help. Alexa.Speaker may be what I'm looking for, but I don't know how to access it through my Custom Skill.
My questions are:
How do I get the volume of the device the Alexa command is being called on?
How do I set the volume of the device the Alexa device the command is being called on?
var currentVolume = 5;
const RingEchoDevicesHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'RingEchoDevices';
},
handle(handlerInput) {
currentVolume = // Get Echo Dot's volume
* Set echo dot's volume to 10
const speakOutput = 'Hello World!';
return handlerInput.responseBuilder
.speak(speakOutput)
.getResponse();
}
};
Thanks for any help.
I would press the pause button on your skill development.
You cannot gain access to volume settings etc via custom skills.
In fact I can't think of a way of doing what you're asking for, you can only ask Alexa what volume setting is current. You can't access that value in routines or in custom skills.
So a rethink is in order I believe.