how to send text to my Alexa device?
mduzgun opened this issue · comments
Hi ,
I want to send text command my physical Alexa device.
But I take error that is "no body".
Help me anyone this issue?
let serialOrName="G2A0WK04..........";
let sequenceType=null;
let commands=[{"command":"speak","value":"hello"}];
alexa.sendMultiSequenceCommand(serialOrName, commands, sequenceType, function(err, res) {
if (!err && res) {
console.log ("alexa.sendMultiSequenceCommand is success");
}
});
Please provide debug log.
"no body" may be no error but just info because what should be the return of such a seak command? Amazon is not returning a body there sometimes
I expect voice from Alexa device, but I don't take any voice. Is this method and parameters correct?
Please provide debug logging
PS: Why you use the MultoCommand call when you only send one command?
I send request to my Alexa device using "sendSequenceCommand" function. But I don't hear any voice from pysical Alexa device.
for (let deviceSerial of Object.keys(alexa.serialNumbers)) {
console.log ("deviceSerial :"+deviceSerial);
}
let serialOrName="G2A0WK048432057N";
let command="speak";
let value="hello";
alexa.sendSequenceCommand(serialOrName, command, value, function(err, res) {
console.log ("error: "+err)
console.log ("result: "+res)
if (!err && res) {
console.log ("alexa.sendSequenceCommand is successfull");
}
});
logs:
deviceSerial :5e350cdec7534b12aa8f4dca0d359232
deviceSerial :87c51d3bcffe48019bf9c55fb4928df6
deviceSerial :G2A0WK048432057N
deviceSerial :DB35389691CA4C4AA1037BAFEBFE9E1A
Alexa-Remote: No authentication check needed (time elapsed 5916)
Alexa-Remote: Sending Request with {"host":"layla.amazon.de","path":"/api/behaviors/preview","method":"POST","timeout":10000,"headers":{}}and data={"behaviorId":"PREVIEW","sequenceJson":"{"@type":"com.amazon.alexa.behaviors.model.Sequence","startNode":{"@type":"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode","operationPayload":{"deviceType":"A18O6U1UQFJ0XK","deviceSerialNumber":"G2A0WK048432057N","locale":"de-DE","customerId":"A2Q8GQKLT884AQ","textToSpeak":"hello"},"type":"Alexa.Speak"}}","status":"ENABLED"}
Alexa-Remote: Response: No body
error: Error: no body
result: null
Alexa-Remote WS-MQTT: Open: https://dp-gw-na-js.amazon.com/?x-amz-device-type=ALEGCNGL9K0HM&x-amz-device-serial=undefined-1557129948454
Alexa-Remote WS-MQTT: Initialization Msg 1 sent
Alexa-Remote WS-MQTT: Initialization Msg 2+3 sent
Alexa-Remote WS-MQTT: Initialization not done within 30s
Alexa-Remote WS-MQTT: Close: 1005:
I try alexaServiceHost: 'pitangui.amazon.com' in alexa.init, so I can hear voice from Alexa device.
problem is solved :)
I exactkly wanted to ask for language settings or such things ... great to see you solved it!